Manage a Preview Server
Learn how to start and stop a Preview Server, customize a Preview Server for your framework, subscribe to notifications for different statuses, and more.
# Find a Preview Server
To find a Preview Server for a site:
- From your site dashboard, under Deploys in the left sidebar, go to to find a list of Preview Servers for that site.
# Start a Preview Server
When you start a Preview Server for a site’s specific branch, Netlify generates a URL for your Preview Server branch that you can share with logged in collaborators. You can stop or restart the Preview Server.
There can only be one live Preview Server for a site/app’s branch at once. The Preview Server URL for a site/app’s branch will always remain the same (unless you change the name of your site).
To start a live Preview Server for a site:
From your site dashboard, under Deploys in the left sidebar, go to
.Select Add new server.
Enter the branch you want to use for your Preview Server and confirm with Add Preview Server. Most use a different branch than their production branch, such as
staging
. Ensure this Git branch is available in your site repository locally and not just on your remote Git repository.
# Stop a Preview Server
When you stop a live Preview Server, the Preview Server URL will no longer serve your site/app and you can start or restart a different Preview Server without going over your plan’s Preview Server limit.
To stop a live Preview Server for a site:
- From your site dashboard, under Deploys in the left sidebar, go to .
- Select the Preview Server you want to stop and choose Stop on the Preview Server instance details page above your Preview Server log.
# Customize a Preview Server for your framework
Based on your site/app’s framework, you may want to customize the target port and the command used to run your site/app in the Preview Server’s virtual container.
To customize a Preview Server for a site, go to
and select Configure.To adjust the command or port that netlify dev
uses within the server, you can also change these values in the [dev]
section of the netlify.toml
file. Note that changing the values in the configuration file will impact local development as well but the Preview Server settings in the UI only impact the Preview Server.
If you want to use environment variables with our Secrets controller, we recommend keeping the environment variables in the Netlify UI for the Preview Server environment (also called the Preview Server deploy context).
To customize a Preview Server for your site/app:
- From your site dashboard, under Deploys in the left sidebar, go to .
- Select Settings, then Configure and make your customizations.
# Subscribe to notifications
Stay updated when your Preview Server changes its status by setting up notifications.
Netlify can trigger external webhooks for the following Preview Server events:
- Preview Server started
- Preview Server stopped
- Preview Server failed
- Preview Server live
To add a notification:
Go to
.Create a new HTTP Post request notification. Select the event and enter the target URL to notify about this event.
Netlify will then trigger your webhook on events, adding further information about the event context in the POST body.
# Understand Preview Server log
While the Preview Server is spinning up, you can review the logs to monitor the process. The Preview Server log shows you the current status of the Preview Server instance.
As the Preview Server starts up, you can review resource usage metrics (CPU, memory, and disk) that update in near real-time. If a server becomes slow, unresponsive, or crashes during startup or after running for a while, these metrics can help you understand the Preview Server’s patterns.
The server process is considered live once it starts responding successfully to HEAD
requests for the site’s main page (/
). At that point, the server status changes from Starting Up to Live.
# Preview Server statuses
A Preview Server instance can have different statuses. Once you start a Preview Server, you can restart or stop an actively running instance.
Note that your pricing plan may have a limit for live Preview Servers.
If you are limited to one Preview Server, you can stop a live Preview Server and start a new Preview Server without going over your limit.
Preview Server statuses include:
- Live: Preview Server instance is healthy and running, will refresh with updates
- Starting up
- Stopping
- Stopped
- Failed
Did you find this doc useful?
Your feedback helps us improve our docs.