---
schema_version: "1"
id: b48b0ea29e768f75cd4a4ae24690ea83026030b13eae7f0af6de83c91402dc92
title: Manage Compute Environments
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-functions/functions/guide/dev-guide/manage-envs.md
canonical_url: https://developer.salesforce.com/docs/platform/functions/guide/manage-envs.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 396f3025318616dbcbf041e627cba85ac9c2a196cb137b826bab95753f4269ab
products:
  - Salesforce Functions
---
# Manage Compute Environments

## Create a Compute Environment for an Org

Before you can deploy a function or invoke a function from an org, you must create a compute environment. A compute environment in the Salesforce cloud represents a place where your deployed functions run. When you create a compute environment you specify an org that the compute environment is connected to. That org can then access and invoke functions deployed to that compute environment.

When developing a function, create compute environments associated with your sandbox or scratch orgs. When you're ready to deploy the function to production, create a compute environment associated with your production org and deploy your function to that compute environment.

To create a compute environment, use the `sf env create compute` command, specifying the org, and optionally an alias that you can use after the compute environment has been created:

```sh
sf env create compute -o MyOrgAlias -a MyComputeEnv

Creating compute environment for org ID 00D90060200AAPG... done!
New compute environment created with name MyComputeEnv-00D90060000AAPG-afg66b
Connecting environments... done!
Your compute environment with alias "MyComputeEnv" is ready.
```

### List Compute Environments

To check which compute environments you've created, use the `sf env list` command:

```sh
sf env list
Current environments for project MyFunctionProject

Type: Compute Environment
ALIAS        PROJECT NAME      CONNECTED ORG ALIAS CONNECTED ORG ID   COMPUTE ENVIRONMENT NAME
MyComputeEnv MyFunctionProject MyScratchOrgAlias   00DS0000003dRFdTAM myfunct-00ds0000003drfdpam-786
```

### Delete Compute Environments

If you no longer need a compute environment, or you wish to disconnect a connected org, use the `sf env delete` command with the compute environment alias to remove the compute environment:

```sh
sf env delete -e MyComputeEnv
```

## Manage Function Environment Variables

[Manage and set environment variables](https://developer.salesforce.com/docs/platform/functions/guide/envvars.md) your function needs at runtime.
