Home
/
Workspaces
/
Environment variables

Environment variables

Coder injects a standard set of environment variables that allow you to access contextual information about your workspace.

To obtain a list of environment variables and their values, launch the Terminal via the Coder Dashboard and run:

env | grep CODER_

Available environment variables

Environment variableDescription
CODER_ASSETS_ROOTThe directory where coder adds Coder-specific assets during workspace creation, such as the coder-cli binary
CODER_CPU_LIMITThe CPU core limit given to your workspace
CODER_IMAGE_DIGESTThe content-addressable identifier for your image
CODER_IMAGE_TAGThe image tag used to create your workspace
CODER_IMAGE_URIThe URI of the image used to build the workspace
CODER_MEMORY_LIMITThe memory limit given to your workspace in GB
CODER_ORGANIZATION_IDThe ID of the organization to which the workspace belongs.
CODER_RUNTIMEThe container runtime used to start the workspace (either kubernetes/default or kubernetes/sysbox if the workspace is a CVM
CODER_URLThe base URL of your Coder deployment
CODER_USER_EMAILYour email address
CODER_USERNAMEYour user name
CODER_WORKSPACE_IDThe unique ID of your workspace
CODER_WORKSPACE_NAMEThe name of your workspace
CODER_WP_NAMEThe name of the workspace provider hosting the workspace

Other variables

Coder uses the following environment variables for its internal operation:

Important: These variables may be modified or removed in future releases without prior notice and are not covered by Coder's backward compatibility policy. These are documented here for your information only.

Environment variableDescription
CODER_AGENT_TOKENThe token used by the Coder Agent to authenticate with coderd. The Coder Agent handles tunnelled connections, collects workspace statistics (such as processor and memory utilization), and manages programs, such as editors.
CODER_AGENT_URLThe URL that the coder agent process uses to connect to coderd. If this is not set, the agent will connect to CODER_URL instead, enabling the coder agent and coder command-line tool to connect to different installations.
CODER_BOOTSTRAP_SCRIPTThe script used to initiate the workspace startup sequence when the self-contained workspace builds feature is active; begins by downloading the "bootstrap agent" from the coderd process.
See an opportunity to improve our docs? Make an edit.