Global Environment Variables
Global environment variables can be used across all collections and requests within a workspace. Think of them as a global store accessible throughout the app, eliminating the repetitive task of defining the same variables in every collection.
environments/ folder, making them version-controllable and workspace-scoped.
Bruno 2.x and earlier: Global environments are stored in the application's data folder. You can access them by visiting the About section from Preferences and navigating to the AppData path location.
Storage Location
Bruno 3.0.0+ (Workspace-based)
In Bruno 3.0.0 and later, global environments are stored as .yml files in the environments/ directory within your workspace:
my-workspace/
├── workspace.yml
├── collections/
└── environments/
├── development.yml
├── staging.yml
└── production.yml
Each environment file contains the environment name and variables:
```yaml filename="development.yml" name: development variables: - name: api_url value: http://localhost:3000 enabled: true secret: false type: text description: Base URL for the local development server
This structure provides several benefits:
- **Version Control** - Global environments can be committed to Git alongside your workspace
- **Team Collaboration** - Share environments with team members through your repository
- **Workspace Isolation** - Each workspace maintains its own set of global environments
### Bruno 2.x and Earlier (Application-based)
In earlier versions, global environments are stored in Bruno's application data folder and are shared across all collections in the application.
## Create a Global Environment Variable
1. Go to the **Environments** section (top right corner).
2. Navigate to the **Global** tab and click on **Create**.

3. (Optional) If you need to import an existing environment, you can use the **Import Environment** option.
4. Enter a name for your environment and click **Create**.

5. Add a variable by specifying the **Name**, **Value**, and an optional **Description** for what the variable represents.

6. Click **Save**.
Your global environment variable is now created and can be accessed across your workspace.
<Warning>
Starting from v4.0.0, all secret variable will be displayed in a separate tab to avoid confusion between normal and secret vars. Secret values are stored securely and are not saved to the environment file.
</Warning>
## Using Global Environment Variables
To use a global environment variable, reference it using the format `{{var_name}}` in any request or collection. These variables can be combined with other variables and used throughout your workspace, making them ideal for consistent value sharing.

### Using process.env in global environments
You can reference process environment variables ((variables from a `.env` file)) inside global environment variable values using the `{{process.env.VAR_NAME}}` syntax. Bruno resolves these references from the workspace-level `.env` file, so your secrets remain out of version control while still being usable in global environments.
For example, you can set a global environment variable value to:
```text
{{process.env.API_KEY}}
When the global environment is active, Bruno will resolve the value from the workspace .env file. See Process Environment Variables and DotEnv File for more details on managing .env files.
Inherit from a parent environment
extends key is written only in 4.2.0 and later. Opening the same environment in an earlier version drops extends, so the parent link and inherited values disappear.
Global environments can inherit from one other global environment in the same workspace, the same way collection environments inherit. Pick a parent with Inherits from in the environment header.
The child's variables and secrets override the parent. Chains such as Prod → Oauth2 → base resolve transitively. You cannot select more than one parent, inherit from yourself, or pick a parent that would cycle.
Inherited rows are read-only and show their source. A missing parent shows a warning and does not block the environment. The flattened merge is computed at runtime and is not saved to disk. The extends field on the environment file is the only persistence. Its value is the parent environment name.
```bru local.bru
extends: dev
vars {
url: https://echo.usebruno.com
}
vars:secret [
apikey
]
See Inherit from a parent environment for merge order and interpolation.
Selecting a Global Environment
To activate a global environment:
- Click on the Environments dropdown in the top right corner
- Navigate to the Global tab
- Select the environment you want to activate
The active global environment selection is stored per-workspace in the application's internal settings. This means your environment selection persists across app restarts and is maintained independently for each workspace.
Upgrading from Bruno 2.x to 3.0.0
If you have existing global environments in Bruno 2.x:
- Default Workspace - Bruno will migrate your existing global environments to the Default Workspace's
environments/folder - Custom Workspaces - You will need to manually recreate or import global environments for any new custom workspaces you create
- Export/Import - You can export environments from one workspace and import them into another