---
title: "Quickly manage environment variables across your sites and team | Netlify"
description: "Realize the speed, agility and performance of a scalable, composable web architecture with Netlify. Explore the composable web platform now!"
source: "https://www.netlify.com/blog/quickly-manage-env-vars/"
last_updated: "2026-07-09T04:52:12.000Z"
---
Environment variables are handy for storing project configuration details to reference in your code. Variables can help protect sensitive values — like API tokens — that are not appropriate to check into your Git repository.

As your project grows, so do the number of variables you’ll need to manage. With Netlify, you can move your environment variables in bulk between all your team’s critical platforms, as well as between sites hosted on our platform. This means you can focus on what really matters, instead of wasting time on tedious config tasks like copying and pasting sensitive information from one platform to another or updating the same values across multiple sites.

## Export and import variables as `.env`

### Netlify UI

We recently added new functions for importing/exporting variables in `.env` format from the Netlify UI. These make it easier to move environment variables around in bulk, even if you need them to honor [contextual variable values](https://www.netlify.com/blog/scopes-and-contextual-values-for-environment-variables-ga/).

#### Export variables as .env

![A Site's environment variables filtered to the builds scope and production context](https://cdn.sanity.io/images/o0o2tn5x/production/83c580c29cf052b3f288b6bb837c89c0a6936b32-1380x718.png)

To get a list of environment variables in `.env` format, go to **Site Settings > Environment Variables **or** Teams Settings > Environment Variables** and:

1.  Use the **“Scope”** and **“Deploy Context”** filters to refine your variables to a specific deploy context and/or scope.
2.  Press the **clipboard button** to copy these variables in `.env` format. This includes some code comments, so you know what you exported. Here’s an example:

```
# Site environment variables for your-site# Context: production# Scope: builds# Date: 12/16/2022, 12:00:00 AM
```

You can now paste the list on your clipboard into any `.env` file.

#### Import variables as .env

You can then import this or another `.env` file to a Netlify site. Choose **“Import from a .env file”** on **Site Settings > Environment Variables** or **Team Settings > Environment Variables**:

!['Add a variable' dropdown with 'Import from an .env file' highlighted](https://cdn.sanity.io/images/o0o2tn5x/production/1991e2c13fa99ef5a761c282e103bbb83a0644dc-1380x404.png)

Paste in your `.env` contents (`KEY=value` format), and choose which scopes and deploy contexts you’d like these values available to:

![Form with an .env contents textarea and scope and deploy context options](https://cdn.sanity.io/images/o0o2tn5x/production/2ea61f70e9135581dbde7b85908447be66ac00d6-1314x1000.png)

If you included `# Scope:` and `# Context`: comments in **“Contents of .env file”** (these are included automatically on export!), we will automatically set the imported variables to the matching scope and deploy context.

You can then choose how to handle any conflicts:

![Options to skip or update conflicting environment variables](https://cdn.sanity.io/images/o0o2tn5x/production/7e91331737d2175aaa1c8c599a63c8198d601acc-1380x440.png)

### Alternatively, you can use the Netlify CLI

If the command line is your jam, you can bulk manage variables using [`netlify env` commands](https://cli.netlify.com/commands/env) on [the Netlify CLI](https://docs.netlify.com/cli/get-started/). In any directory linked to a Netlify site, you can:

-   Run `netlify env:list --plain` to export a list of that site’s env vars. You can then copy the formatted list into an `.env` file. [Use the —context flag](https://docs.netlify.com/environment-variables/get-started/) to output values from a specific context. By default, the local development values are returned.
-   Run `netlify env:import` with the name of your `.env` file. The `--replace-existing` flag should be used with caution, as any existing variables on the site will be removed.

## Copy variables between sites

Another neat trick on the Netlify CLI is the `netlify env:clone` command. You can copy all variables from one site on your team to another using:

```
netlify env:clone --to <to-site-id> --from <from-site-id>
```

## Shared variables across all your sites

There may be some variables you’ll want to use across all sites in your Netlify team. Owners on Pro accounts and above can set [shared environment variables](https://docs.netlify.com/environment-variables/get-started/#shared-environment-variables) at **Team Settings > Environment Variables:**

![Variables set on the team level, with all the usual scope and deploy context options available](https://cdn.sanity.io/images/o0o2tn5x/production/6c7f05065e9b2cb55efff8bad5031fc47fa5d903-2068x1378.png)

Any variables set here will be available on all sites within the team. Note: today these keys and values are only visible in the Netlify UI/CLI to Owners.

If you need to override the value on a particular site, you can set the same key with a different value at **Site Settings > Environment Variables.** This will override the team-level value(s).

## Your own flow using the Netlify API

Have a more complex use case, or want to make bulk management a little more programmatic? You can use [Environment variables endpoints](https://open-api.netlify.com/#tag/environmentVariables) on the [Netlify API](https://docs.netlify.com/api/get-started/) to work with environment variables according to your unique workflow.

## Try it out

Try importing/exporting bulk environment variables on Netlify and let us know what you think. You can share feedback on these and other features in [the Netlify forums](https://answers.netlify.com/c/features/50). We always appreciate hearing your thoughts!

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=Quickly manage environment variables across your sites and team&url=https://www.netlify.com/blog/quickly-manage-env-vars/)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2Fquickly-manage-env-vars%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/quickly-manage-env-vars/)
-   [Bluesky](https://bsky.app/intent/compose?text=Quickly manage environment variables across your sites and team+https://www.netlify.com/blog/quickly-manage-env-vars/)

* * *

### Tags

-   [environment variables](/blog/tags/environment-variables/)
-   [Netlify CLI](/blog/tags/netlify-cli/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

News & Announcements November 2, 2022

[

### Now generally available: Scopes and contextual values for environment variables

](/blog/scopes-and-contextual-values-for-environment-variables-ga)

-   ![Profile picture of Melanie Richards](/_astro/d92b724b71fa2bff0982537002856fa4b0614316-512x512_ZCJjrO.webp)
    
    Melanie Richards
    

![](/_astro/3f45eb6eda4ea8814be310e3df4a7883a5bd9ba0-1200x675_ZcBDUS.webp)

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)