---
schema_version: "1"
id: 4def48ddda8ea80356a48b7ba4671a5ebba9fd409809e0c94cec82a1940a5af9
title: Deploy a Function
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-functions/functions/guide/quick-start/deploy-function.md
canonical_url: https://developer.salesforce.com/docs/platform/functions/guide/deploy-function.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c43eeaa49adcf2f4b2991a95fb74d86bab1beaf47d2faf250e29d601214a817c
products:
  - Salesforce Functions
---
# Deploy a Function

Now that you’ve developed and tested your function locally, deploy your project so you can invoke your function from your Salesforce org. The first time a Salesforce Functions project is deployed, the upload can be 500 MB or more.

## Add Project to Git

Before you deploy, commit your functions code changes to a git repo. The deploy process uses changes tracked in git to know what to deploy. Since you just created this project, add the project to a new repo.

From the root directory of your project, use the following git commands:

```sh
git init
git add .
git commit -m "Initial project commit after project creation"
```

At this point you can optionally push your changes to github.com, but it isn't required for deploying a function.

Your project is now ready to deploy. If you make additional changes to your function code, use `git add` and `git commit` to commit those changes to the repo before deploying again.

For more details on adding your repo to github.com, see [Create a repo](https://docs.github.com/en/get-started/quickstart/create-a-repo).

## Deploy Function to Compute Environment

To deploy your project's function, use the following command with the scratch org alias we created earlier.

```sh
sf deploy functions -o MyOrgAlias
```

The deploy process can take several minutes.

To check the status of your deployed project, use `sf env list`.

```sh
sf env list
Salesforce Orgs
============================================================================================================================================
| Aliases Username                                         Org ID             Instance Url                        Auth Method Config
| ─────── ──────────────────────────────────────────────── ────────────────── ─────────────────────────────────── ─────────── ──────────────
|         functionsuser@salesforce-developers.com          00D3h000000Gr9mEAC https://na111.salesforce.com        web
| DevHub  myuserfunctions@salesforce.com                   00D5e000002URZtEAO https://user-dev-ed.my.salesforce.… web
| d16673… myuser1234@d16673dc-20210803-functions-trial.com 00D5e000003TQoSEAW https://d16673dc-20210803-function… web         target-dev-hub
| Bob_De… bob@ding.dong                                    00DB0000000KfREMA0 https://fc2bfda2-20210913-function… web
| Prod_O… alan@ding.dong                                   00DB0000000KfREMA0 https://fc2bfda2-20210913-function… web

Scratch Orgs
==========================================================================================================================================
| Aliases Username                      Org ID             Instance Url                                                 Auth Method Config
| ─────── ───────────────────────────── ────────────────── ──────────────────────────────────────────────────────────── ─────────── ──────
|         test-15zzduduspjn@example.com 00D3D000000BJJLUA4 https://mycompany.scratch.my.salesforce.com                  web

Compute Environments
============================================================================================================
| Alias         Project Name            Connected Org Alias Connected Org Id   Compute Environment Name
| ───────────── ─────────────────────── ─────────────────── ────────────────── ─────────────────────────────
| Prod_Env_Alan GA_Bug_Bash_Prod_Manual Prod_Org_Alan       00DB0000000KfREMA0 ga-bug-00db0000000kfrema0-203
```

For more details on deploying projects, see the [Salesforce Functions Developer Guide](https://developer.salesforce.com/docs/platform/functions/dev-guide/deploy.md).
