Vercel Environment Variables: Dashboard, CLI & Edge
How to configure environment variables on Vercel. Covers the dashboard, CLI (vercel env pull), system variables, per-environment settings, and Edge function access.
Last updated:
Frequently Asked Questions
How do I set environment variables on Vercel?
Go to Project Settings > Environment Variables in the Vercel dashboard. Add each variable with its value and select which environments it applies to: Production, Preview, Development, or all three.
Why are my environment variables not working in Vercel preview deployments?
Check that the variable is enabled for the Preview environment in your Vercel project settings. Also ensure you are using the correct branch scope if you have branch-specific overrides configured.
What is VERCEL_URL?
VERCEL_URL is a system environment variable that contains the deployment URL (without the protocol). It changes for every deployment. Use it to construct absolute URLs in your application, but prefer NEXT_PUBLIC_VERCEL_URL for client-side access in Next.js.
Stay up to date
Get notified about new guides, tools, and cheatsheets.
Related Cheatsheets
Related Guides
Next.js Environment Variables: Complete Guide
How Next.js handles environment variables: .env files, NEXT_PUBLIC_ prefix, server vs client access, load order, and common production errors.
AWS Lambda Environment Variables: Console, CLI, SAM & CDK
How to set and manage environment variables in AWS Lambda. Covers the console, CLI, SAM templates, CDK, Terraform, KMS encryption, and Secrets Manager integration.
GitHub Actions: Secrets vs Environment Variables
When to use repository secrets, environment secrets, and configuration variables in GitHub Actions. Includes workflow examples for Node.js, Python, and Docker.