We use cookies to make your experience better.
Learn how to work with CODER_* environment variables inside workspaces.
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_
| Environment variable | Description | 
|---|---|
| CODER_ASSETS_ROOT | The directory where coder adds Coder-specific assets during
            workspace creation, such as the coder-clibinary | 
| CODER_CPU_LIMIT | The CPU core limit given to your workspace | 
| CODER_IMAGE_DIGEST | The content-addressable identifier for your image | 
| CODER_IMAGE_TAG | The image tag used to create your workspace | 
| CODER_IMAGE_URI | The URI of the image used to build the workspace | 
| CODER_MEMORY_LIMIT | The memory limit given to your workspace in GB | 
| CODER_ORGANIZATION_ID | The ID of the organization to which the workspace belongs. | 
| CODER_RUNTIME | The container runtime used to start the workspace (either kubernetes/defaultorkubernetes/sysboxif the workspace is a CVM | 
| CODER_URL | The base URL of your Coder deployment | 
| CODER_USER_EMAIL | Your email address | 
| CODER_USERNAME | Your user name | 
| CODER_WORKSPACE_ID | The unique ID of your workspace | 
| CODER_WORKSPACE_NAME | The name of your workspace | 
| CODER_WP_NAME | The name of the workspace provider hosting the workspace | 
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 variable | Description | 
|---|---|
| CODER_AGENT_TOKEN | The 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_URL | The URL that the coder agentprocess uses
            to connect tocoderd. If this is not set, the agent
            will connect toCODER_URLinstead, enabling thecoder agentandcodercommand-line tool
            to connect to different installations. | 
| CODER_BOOTSTRAP_SCRIPT | The 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 coderdprocess. | 
See an opportunity to improve our docs? Make an edit.