﻿---
title: Env provider
description: Provides access to the environment variables as key-value pairs. For example, set the variable foo: The environment variable can be referenced as ${env.foo}...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4067/reference/fleet/env-provider
products:
  - Elastic Agent
  - Fleet
---

# Env provider
Provides access to the environment variables as key-value pairs.
For example, set the variable `foo`:
```shell
foo=bar elastic-agent run
```

The environment variable can be referenced as `${env.foo}`.
<note>
  If you run the agent as a Linux or Windows service, you can also define the environment variables in the service manifest. Refer to the example in [Proxy Server connectivity using default host variables](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4067/reference/fleet/host-proxy-env-vars).
</note>