Vercel preview vs production is a difference of configuration, not of code. Production is the deployment your domains serve; a preview is every other deployment, one per branch push or pull request, each with its own URL and Preview-scoped environment variables. A preview whose variables name the live database can still write to real customer data.
Vercel preview vs production: what a preview deployment is, and what production is
A Vercel preview deployment is any deployment that is not serving your production domains: Vercel builds one for each push to a non-production branch and each pull request, gives it a unique URL, and loads the variables scoped to Preview. Production is the deployment assigned to your domains, built from the production branch or promoted.
There is one exception to those rules. The first deployment of a new project is always a production deployment, even when it comes from another branch or from a CLI deploy without --prod; only after it exists does a CLI deploy with no flag make a preview. Previews on other hosts, and setting them up per pull request, are a separate subject, covered under how preview deployments work on any host.
So the difference between a Vercel production and preview deployment is mostly which domains the deployment answers on and which variable list it loads, and the code inside can be identical. Vercel’s environments docs name a third default environment, Local, for work on your own machine, and Pro and Enterprise teams can add custom environments such as staging, which the staging section further down returns to.
Preview and production on Vercel, side by side
Preview and production on Vercel differ in what triggers the build, the URL, the environment variables loaded, who can open the deployment and whether search engines index it. They share everything the variables do not separate: the database, the payment account, the email sender and any webhook pointed at one address.
The table sets the two Vercel environments next to each other, the differences in the first six rows and the shared services in the last four.
| What | Production | Preview | What to check |
|---|---|---|---|
| What creates it | A push or merge to the production branch, vercel --prod, or a promotion | A push to any other branch, a pull request, or a CLI deploy without --prod | The branch the deployment was built from |
| URL | Your production domains, plus generated URLs | A generated URL for each commit and one per branch that follows its latest push | Whether the address is your own domain or a generated vercel.app one |
| Environment variables | The values saved for Production | The values saved for Preview; a branch-specific value overrides them | Which environments each service variable is saved for |
| Who can open it | Anyone, on production domains under Standard Protection | Only Vercel users with access, under Standard Protection with Vercel Authentication (available on all plans); anyone with the URL when protection is off | The project’s Deployment Protection setting |
| Search engines | The current production deployment stays indexed | Vercel adds an X-Robots-Tag: noindex header, except on a custom domain assigned to a branch | The response headers of the URL you share |
| Scheduled cron jobs | Vercel sends each cron request to the production deployment URL | Not run: Vercel invokes cron jobs only for production deployments | The cron paths in vercel.json |
| Database | Whatever the Production variables name | Whatever the Preview variables name: the live database when no Preview value differs | The database host each variable list names |
| Payment keys | Whatever keys the Production variables hold | The same live keys unless Preview has test-mode keys | Whether the Preview keys are test-mode keys |
| Email sender | Whatever sending key the Production variables hold | The live sender unless Preview has its own key | Which sending key and domain the Preview list holds |
| Webhooks | Events arrive at the address the provider stored, usually this one (our reading) | Events arrive only if a provider was given the preview’s address (our reading) | The endpoint URL saved in each provider’s dashboard |
Checked against Vercel’s docs on October 20, 2026.
The search-engine row has one trap. A custom domain such as a staging address, assigned to a branch, loses the noindex header Vercel adds to other previews, so that domain can be indexed unless you add the header yourself.
What a preview shares with production unless you separate it
A Vercel preview shares production’s database, payment keys, email sender and webhooks unless each has its own Preview value. The Preview scope is a separate list of variables, and a variable added to all environments at once gives the preview the live value.
The database matters most. Vercel lets you pick one or more environments for every variable, so a connection string saved with Production, Preview and Development all selected hands every preview the live connection. A database added through a Marketplace integration follows the environments chosen on that connection, which is a second place to look.
Payment keys follow the same rule. A preview that loads live secret keys can take real payments from anyone who reaches its checkout, so the Preview scope gets test-mode keys from Stripe or whichever provider you use, and testing uses test cards only, never a real card or live keys.
The email sender is the easiest to miss. With the live sending key and the live database behind it, one test click on a preview can send a password reset, a receipt or an invite to a real customer.
Webhooks and sign-in redirects point the other way. A payment or auth provider stores one address, so as we read it a preview either receives no events at all or sends the user back to production after sign-in, and a test that looked finished may have run against the live app.
In one of the 21 third-party apps we audited in June and July 2026, an AI coding workspace, a single database project served everything: the host built a preview per branch, yet no preview was pointed at a database of its own, so every preview would share the live one and a schema change had no safe place to fail first. We chose those apps to audit rather than sampling them at random, so the case shows the gap exists, not how common it is; the full account is part of the release path a small team can trust.
Vercel’s own docs give the same warning about one of their staging workflows: “Staged production deployments use production environment variables, so testing can access production services and data.”
When a launch or a client handover is close and nobody has checked what the previews point at, start with a free audit: a video call, no code access needed, where we go over with you which services your previews share with production. In the Production Hardening Sprint, our engineers provide development, staging and production with separate databases, credentials and configuration, and browser-accessible preview deployments for pull requests with isolated test configuration.
How to tell which Vercel environment you are looking at
A Vercel deployment shows which environment it is in three places: the Deployments tab, which lists every deployment and filters them by environment, the URL (your own domain, or a generated vercel.app address, which carries the branch name when it is a branch URL), and the VERCEL_ENV system variable the code can read on the server.
The URL and the Deployments tab
The Deployments tab filters by branch, status and environment, and the production deployment serving your domains right now is the one marked Current. Vercel preview URLs come in two kinds: a branch URL that always shows the latest push to that branch, and a commit URL that stays on one exact deployment, both described in Vercel’s generated URLs page.
On GitHub, a Vercel preview deployment shows up on the pull request: the Visit Preview button in Vercel’s comment opens the branch URL, and the View deployment button opens the commit URL. From the Vercel CLI, vercel deploy with no flag makes a preview and prints its deployment URL to standard output, while vercel --prod makes a production deployment.
A custom domain can also follow a branch. In the domain settings, connect it to Preview and enter the Git branch, and that domain then serves the branch’s previews, which is how an address like staging.example.com can be a preview.
VERCEL_ENV in the code
VERCEL_ENV is a system environment variable Vercel sets at build time and at runtime, and its value can be production, preview or development; a custom environment’s name shows up in a second variable, VERCEL_TARGET_ENV. The full list is on Vercel’s system environment variables page.
An internal status page or a startup log line can print it, which answers the question at a glance. Print the environment name only, never a secret or a full connection string. Code that branches on VERCEL_ENV is a second line of defense, not the separation itself: if the Preview variables still name the live database, an if in the code does not change where the writes land.
No Production Deployment: when the domain has nothing to serve
The dashboard overview can show “No Production Deployment” under the project name, and the practical question behind it is why your production domain is not serving traffic from the build you expected. Vercel’s docs do not define that message, but they document two settings that keep a new build off your production domains, and both are quick to rule out.
The first is promotion. With Auto-assign Custom Production Domains turned off (Settings, Environments, Production, Branch Tracking), production builds wait as Staged until someone promotes one from the Deployments tab menu, as promoting a deployment describes. The second is the domain itself: a domain connected to Preview and a Git branch in Settings, Domains serves that branch, not the production branch, and the domain’s Edit option in that list is where its environment is changed.
A production build that never started is a different fault, and why a production build waits in the queue covers it. If the build ran and broke the live app, rolling back a Vercel deployment puts the last good one back.
How to give previews their own data and keys
Previews get their own data when every variable that names a service has a Preview value pointing at a test service: a separate database, test payment keys, a test email sender. Vercel applies changed variables only to new deployments, so redeploy after the change.
Setting Vercel preview environment variables properly comes down to five steps in the project’s settings, with Vercel’s environment variables docs as the reference for each screen:
- 01 List every variable that names a service: database, payments, email, file storage, AI provider and webhook secrets
- 02 For each one, add a Preview value that points at a test service, and never save a live secret to all environments at once
- 03 Give previews a database of their own, either a second project or a database branch
- 04 Put the payment provider's test-mode keys in the Preview scope
- 05 Redeploy, because changed variables apply only to new deployments
A Preview value can apply to every non-production branch or to one branch, and a branch-specific value overrides the general one with the same name, so a long-lived test branch only needs the values that differ. The same steps carry over to a custom staging environment on Pro and Enterprise, which keeps a variable list of its own. Why a value set in one place goes missing in another is the subject of how environment variables reach each environment.
How to make a Vercel preview public, and who can open it today
A Vercel preview is public when the project’s Deployment Protection is off for previews; new projects start protected, and Standard Protection is available on every plan. To make one Vercel preview public, share it with Vercel’s sharing options or turn protection off for previews in the project settings.
Vercel turned Deployment Protection on by default for new projects in a changelog entry dated November 2, 2023, with Vercel Authentication as the method. Teams also set a default for new projects in team settings, picking All Deployments, Standard Protection or None, and each project can override it, so an older project, or one created under a None default, can still be open to anyone with the URL. The setting itself is under Settings, Deployment Protection; Vercel Deployment Protection lists the methods and scopes.
To see whether a Vercel preview deployment is public, open its URL in a private browser window: a request to log in to Vercel means it is protected, and the page itself means anyone with the link can see it.
To show one preview to a client or tester outside the team, invite them from the Share button, or, with protection on, choose Anyone with the link, which creates a sharable link that bypasses protection; Hobby users can have one invited collaborator at a time. That stays narrower than switching protection off for every deployment, and the same Share dialog revokes access later. The steps are in sharing a preview deployment.
The noindex header from the table keeps previews out of search results, but it is no access control: a forwarded link still opens an unprotected preview. Vercel’s security beyond previews is the subject of what Vercel secures and what stays yours.
Preview vs staging
A preview belongs to one change; staging is one long-lived place that mirrors production with its own data. Vercel documents three ways to get a staging step: a custom staging environment (Pro and Enterprise), a preview branch for staging with its own domain and branch-specific variables (all plans, including Hobby), and a staged production deployment (all plans), which uses production environment variables and so is not separate from live data.
Only the first two give staging its own services; Vercel points to a custom environment or a preview branch with staging credentials when you need separate resources. Whether a small app needs a staging step at all is the question behind what a staging environment is for, and the database half on Supabase, a second project or a branch, is set out in a staging project on Supabase.
How to check a preview cannot touch production
A preview is proven separate by trying to reach production from it and failing. Read the database host it uses, create a test record and confirm it is absent from production, run a test payment and see it only in test mode, and open the URL signed out.
Each check below names the evidence to keep, so the result can be shown to someone else later:
- 01 Compare the Preview and Production values of the database connection variable and confirm the hosts differ; keep a screenshot with the credentials hidden, and rely on the signup check where the value is saved as a Secret and cannot be read back
- 02 Sign up on the preview with a new test email address and confirm the account is absent from production's users table; keep the query and its empty result
- 03 Pay on the preview with the provider's test card in test mode and confirm the payment appears only in the test-mode dashboard; keep its ID
- 04 Trigger an email from the preview, such as a password reset, and confirm it reaches only the test inbox
- 05 Open the preview URL in a private window and record whether Vercel asks for a login
The first check has a limit: Secret values are write-only after saving, so the dashboard cannot always show the host, and the signup is the test that settles it. In the sprint, we verify deliverable 7.7 by opening a preview from a test pull request and verifying its environment isolation, and deliverable 7.1 by verifying service isolation and performing a staging action without a production side effect.
Common questions about previews and production on Vercel
How to get Vercel preview URL?
Push a commit to any branch other than your production branch, or open a pull request, and Vercel builds a preview with its own URL. The link appears in the comment Vercel posts on the pull request and in the Deployments tab, and a vercel deploy from the terminal without --prod prints the deployment URL to standard output.
How to use Vercel Preview?
Use a Vercel preview to try a change at its own address before your users see it: open it, click through the change, send it to a reviewer, then merge the branch or promote the deployment once it is right. Before testing anything that writes data, confirm the Preview variables point at test services rather than live ones.
How do I remove a Vercel deployment?
Open the deployment from the Deployments tab and choose Delete from its menu, or run vercel remove with the deployment URL (vercel rm is the short form). Passing a project name instead removes all of that project’s deployments, and Vercel’s CLI reference says the entire project is removed from the current scope unless you add --safe, which skips any deployment with an active preview URL or production domain.
How to view env in Vercel?
Open the project in the Vercel dashboard and select Environment Variables in the settings sidebar to see each variable and the environments it was saved for; values saved as Secret cannot be read back. In the terminal, vercel env ls lists the project’s variables, vercel env ls preview narrows the list to one environment, and vercel env pull writes the Development values to a local file.
When should I get help keeping previews away from production data?
Get help before the first real customers or a client handover, or as soon as a preview has written anything to the live database. AxonBuild can go over with you what your previews point at on a free audit, a video call where we talk through which services to separate first.
Is your preview quietly using live data?
A preview build can reach the same database, payment account or email service as production, so a test click can touch real customers. In an audit, we go over how your environments are set up with you, then point out where they share things they should not. You leave knowing what to separate first.
Book a free audit →
Free · 30 minutes · No code access needed