Environments
Vercel provides three default environments—Local, Preview, and Production:
- Local Development: developing and testing code changes on your local machine
- Preview: deploying for further testing, QA, or collaboration without impacting your live site
- Production: deploying the final changes to your user-facing site with the production domain
Pro and Enterprise teams can create Custom Environments for more specialized workflows (e.g., , ). Every environment can define it’s own unique environment variables, like database connection information or API keys.
This environment is where you develop new features and fix bugs on your local machine. When building with frameworks, use the Vercel CLI to pull the environment variables for your project.
- Install the Vercel CLI:
-
Link your Vercel project with your local directory:
-
Pull environment variables locally for use with application development:
This will populate the file in your application directory.
Preview environments allow you to deploy and test changes in a live setting, without affecting your production site. By default, Vercel creates a preview deployment when you:
- Push a commit to a branch that is not your production branch (commonly )
- Create a pull request (PR) on GitHub, GitLab, or Bitbucket
- Deploy using the CLI without the flag, for example just
Each deployment gets an automatically generated URL, and you'll typically see links appear in your Git provider’s PR comments or in the Vercel Dashboard.
There are two types of preview URLs:
- Branch-specific URL – Always points to the latest changes on that branch
- Commit-specific URL – Points to the exact deployment of that commit
Learn more about generated URLs.
The Production environment is the live, user-facing version of your site or application.
By default, pushing or merging changes into your production branch (commonly ) triggers a production deployment. You can also explicitly deploy to production via the CLI:
When a production deployment succeeds, Vercel updates your production domains to point to the new deployment, ensuring your users see the latest changes immediately. For advanced workflows, you can disable the auto-promotion of deployments and manually control promotion.
Custom environments are available on Enterprise and Pro plans
Custom environments are useful for longer-running pre-production environments like , , or any other specialized workflow you require.
Team owners and project admins can create, update, or remove custom environments.
- Go to your Project Settings in the Vercel Dashboard
- Under Environments, click Create Environment
- Provide a name (e.g., ), and optionally:
- Branch Tracking to automatically deploy whenever a matching branch is pushed
- Attach a Domain to give a persistent URL to your environment
- Import variables from another environment to seed this environment with existing environment variables
To create an Authorization Bearer token, see the access token section of the API documentation.
To create an Authorization Bearer token, see the access token section of the API documentation.
You can deploy, pull, and manage environment variables to your custom environment with the CLI:
Custom environments are available at no additional cost on the Pro and Enterprise plans. The number of custom environments you can create is based on your plan:
- Pro: 1 custom environment per project
- Enterprise: 12 custom environments per project
Was this helpful?