--- layout: "docs" page_title: "Environment - Runtime" sidebar_current: "docs-runtime-environment" description: |- Learn how to configure the Nomad runtime environment. --- # Runtime Environment Some settings you specify in your [job specification][jobspec] are passed to tasks when they start. Other settings are dynamically allocated when your job is scheduled. Both types of values are made available to your job through environment variables. ## Summary
Variable Description
`NOMAD_ALLOC_DIR` Path to the shared alloc directory
`NOMAD_TASK_DIR` Path to the local task directory
`NOMAD_SECRETS_DIR` Path to the task's secrets directory
`NOMAD_MEMORY_LIMIT` The task's memory limit in MB
`NOMAD_CPU_LIMIT` The task's CPU limit in MHz
`NOMAD_ALLOC_ID` The allocation ID of the task
`NOMAD_ALLOC_NAME` The allocation name of the task
`NOMAD_ALLOC_INDEX` The allocation index; useful to distinguish instances of task groups
`NOMAD_TASK_NAME` The task's name
`NOMAD_JOB_NAME` The job's name
`NOMAD_IP_ The IP of the port with the given label
`NOMAD_PORT_ The port value with the given label
`NOMAD_ADDR_ The IP:Port pair of the port with the given label
`NOMAD_ADDR__ The allocated address, given as IP:Port for the given label of other tasks in the same group
`NOMAD_PORT__ The allocated port for the given label of other tasks in the same group
`NOMAD_IP__ The allocated IP address for the given label of other tasks in the same group
`NOMAD_HOST_PORT_ The host port for the given label if the port is port mapped
`NOMAD_META_` The metadata of the task
`VAULT_TOKEN` The task's Vault token. See [Vault Integration](/docs/vault-integration/index.html) for more details
~> Port labels and task names will have any non-alphanumeric or underscore characters in their names replaced by underscores `_` when they're used in environment variable names such as `NOMAD_ADDR__