Platform primitives /Preview Servers /

Preview Servers overview

The number of Preview Servers available to you is based on your Pricing plan.

Set up a Preview Server to share a customizable preview environment where you and key collaborators can preview content updates alongside code updates in real-time.

As a Developer or Owner, you can set up a Preview Server powered by the Netlify CLI to share a live preview environment of your site/app with other collaborators.

You can also configure your CMS for a Preview Server so that you can preview the latest code updates for an app/site alongside the latest content in a CMS.

By default, the Preview Server URL is formatted as https://devserver-YOURBRANCHNAME--YOURSITENAME.netlify.app and can be found in the Netlify UI.

The Preview Server URL always points to the instance of the Preview Server that is currently Live for that branch. You can only have one Live instance of a Preview Server for a branch.

For example, if the branch is staging, your default Preview Server URL would be https://devserver-staging--yoursitename.netlify.app.

# Collaborator access

For each Preview Server, Netlify provides a stable preview URL that can only be accessed by authenticated collaborators with certain Netlify roles.

To access a Preview Server URL, collaborators must have a Netlify account and log in with one of these roles:

Only Developers and Team Owners can manage a Preview Server by starting, stopping, or customizing the server.

Roles without access

The Netlify Reviewer role and Git Contributor role cannot access a Preview Server.

# Customize the Preview Server

Based on your app/site's framework and project needs, you can customize the port that the Preview Server proxies requests to and the dev server command that the Preview Server uses to run your site/app.

For example, if you have an app that starts its dev server on port 4141 and that uses the command npm run dev, then you tell the Preview Server to use this port and dev server command to run your site/app in the Preview Server's virtual environment.

In addition, you can customize the Preview Server in the following ways:

  • Choose the Git branch from your site/app repository that is used to launch the Preview Server
  • Configure a CMS platform to sync content to the Preview Server so you and your team can preview content and code live together
  • Configure Content refresh for your site/app framework to work with the Preview Server
  • Choose which notifications you want to receive for different Preview Server events

Learn more about your options to customize a Preview Server in Manage a Preview Server or set up Preview Server for content sites.

# How Preview Server works

The Preview Server works by using the Netlify CLI to run your site in development mode in a virtual container so you can share a live preview for other collaborators.

Many sites support a development mode, where updated and draft content is refreshed instantly without the need for a full rebuild. With Static Site Generators such as Gatsby, this mode is typically the only solution to quickly preview updated content. However, this capability is usually accessible to developers only.

Netlify Preview Servers allow you to share a live preview of different Git branches for a single site/app on Netlify. For each Preview Server, Netlify provides a stable preview URL that can only be accessed by authenticated collaborators.

The environment variable for Preview Servers is NETLIFY_PREVIEW_SERVER. You can use this environment variable to distinguish where your site or app is being run. Learn more in our read-only build metadata variables docs.

# Preview Server life cycle

At each point in time, there can only be one Preview Server instance with the Live status for a given Netlify site/app and code branch.

When you push new code to the branch that a running Preview Server is using, Netlify starts a new Preview Server instance in the background. Once that instance is up and healthy, the stable preview URL will automatically switch to proxy the new instance. In the background, the old instance is then automatically stopped.

Learn more about limits set on your Preview Server life cycle in our limits docs.

# Preview Server statuses

The Preview Server has the following statuses:

  • Live: Preview Server instance is healthy and running, will refresh with updates
  • Starting up
  • Stopping
  • Stopped
  • Failed

Learn more about Preview Server statuses. You can subscribe to notifications to be informed about such failures.

# Preview Server Limits

Keep these limits in mind as you work with Preview Servers.

# Preview Server count

Preview Servers may be limited for your team account's sites/apps based on your pricing plan.

Pricing plan Free Preview Servers Additional Preview Servers
Free 1 Live Preview Server at any time per team account Not available
Starter 1 Live Preview Server at any time per team account $15 a month per each new additional Live Preview Server
Pro 1 Live Preview Server at any time per team account $15 a month per each new additional Live Preview Server
Enterprise Custom Custom

For more plan information, check out Netlify pricing plans.

# Preview Server Live duration

Users on the free plan have an additional limitation where the Preview Server cannot be Live for more than the following limits:

  • 2 hours total in a day
  • 62 hours total in a month

# Preview Server auto-shutoff

All Preview Servers auto-shutdown after a certain amount of inactive time based on your pricing plan.

You can restart a stopped Preview Server as long as your team account hasn't hit a Preview Server count limit or you can start a new Preview Server instance with the same branch. The Preview Server URL will be the same. Learn more in Manage Preview Servers.

Pricing plan Auto-shutoff
Free After 15 mins of inactivity
Starter After 15 mins of inactivity
Pro After 15 mins of inactivity
Enterprise After 30 mins of inactivity