---
layout: "docs"
page_title: "env Stanza - Job Specification"
sidebar_current: "docs-job-specification-env"
description: |-
The "env" stanza configures a list of environment variables to populate the
task's environment before starting.
---
# `env` Stanza
Placement |
job -> group -> task -> **env**
|
The `env` stanza configures a list of environment variables to populate the
task's environment before starting.
```hcl
job "docs" {
group "example" {
task "server" {
env {
my-key = "my-value"
}
}
}
}
```
## `env` Parameters
The "parameters" for the `env` stanza can be any key-value. The keys and values
are both of type `string`, but they can be specified as other types. They will
automatically be converted to strings.
## `env` Examples
The following examples only show the `env` stanzas. Remember that the
`env` stanza is only valid in the placements listed above.
### Coercion
This example shows the different ways to specify key-value pairs. Internally,
these values will be stored as their string representation. No type information
is preserved.
```hcl
env {
key = "true"
key = true
"key" = true
key = 1.4
key = "1.4"
}
```
### Interpolation
This example shows using [Nomad interpolation][interpolation] to populate
environment variables.
```hcl
env {
NODE_CLASS = "${nomad.class}"
}
```
[interpolation]: /docs/runtime/interpolation.html "Nomad interpolation"