---
title: "global_env in devlanes.yaml"
url: https://devlanes.run/docs/reference/config/project/global_env/
description: "Reference for the global_env key in devlanes.yaml."
---

# global_env in devlanes.yaml

A top-level key of [`devlanes.yaml`](/docs/reference/config/project/).

## `global_env`

Type: mapping of names to strings, booleans, numbers or [expressions](/docs/reference/expressions/).

Variables for every service and task of the lane, above devlanes' own variables (`PORT`, `DEVLANES_*`) and below each unit's `env` and the profile's `env`. Use it for values many units share, such as a database URL built from `${{ infra.postgres.port }}`. An entry without a value, such as one that reads a container a profile with `infra: false` left stopped, fails every service and task of the lane, so a value only some services need belongs in their `env`. `devlanes exec` leaves such an entry out and names it. Never set `PORT` here: it would replace every service's own port.

```yaml devlanes
global_env:
  API_URL: ${{ services.api.url }}
```
