Deploying a Next.js application on Vercel

By

Learn how to deploy a Next.js app on Vercel with the Vercel CLI, from vercel login to your first production deployment on a vercel.app URL.

~~~

How do we deploy a Next.js app to a real web server, so other people can access it?

One of the simplest ways to deploy a Next application is through Vercel, the platform built by the same company that created Next.js. You can use Vercel to deploy Node.js apps, static websites, and much more.

I wrote this post in 2019, when the company was called Zeit and the platform was called Now. In 2020 the company renamed itself Vercel, the now CLI became vercel, and the now.sh domain became vercel.app. The commands below are the current ones, checked against Vercel CLI 62 in October 2026.

Vercel makes the deployment and distribution step of an app very, very simple and fast. In addition to Node.js apps, it also supports Go, Python and other languages.

You can think of it as the “cloud”, as you don’t really know where your app will be deployed, but you know that you will have a URL where you can reach it.

Vercel is free to start using. The free Hobby plan is for personal, non-commercial projects, and as of September 2026 it includes 100 GB of data transfer and 1 million function invocations per month, with up to 100 deployments a day. The pricing page lists the paid plans if you need more.

Installation

The best way to start using Vercel from the terminal is the official CLI. The npm package is called vercel:

npm install -g vercel

Once the command is available, run

vercel login

The CLI prints a code and a vercel.com/device URL. Open the URL in your browser, enter the code, and approve the login. (Back in 2019 the CLI asked for your email instead.)

If you haven’t registered already, create an account on https://vercel.com/signup before continuing.

Once this is done, from the Next.js project root folder run

vercel

and the app will be instantly deployed to Vercel, and you’ll be given the unique app URL.

The first deployment of a new project is always a production deployment. After that, running vercel with no options creates a preview deployment. When you are happy with it, run vercel --prod to deploy to production.

When I first deployed this project in 2019 the CLI printed three now.sh URLs. Today they end in vercel.app, but the idea is the same:

Why so many?

The first is the URL identifying the deploy. Every time we deploy the app, this URL will change.

You can test immediately by changing something in the project code, and running vercel again: the CLI prints a new deployment URL.

The other 2 URLs will not change. The first is a random one, the second is your project name (which defaults to the current project folder), then your account name, then the platform domain. Today the CLI gives you that stable URL in the form firstproject-flaviocopes.vercel.app, plus a unique URL for every single deployment.

If you visit the URL, you will see the app deployed to production.

You can configure Vercel to serve the site to your own custom domain or subdomain, but I will not dive into that right now. The generated subdomain is enough for our testing purposes.

For a wider look at production deploys, see Deploying a Next.js application to production.

Tagged: Next.js · All topics

Want me to talk about your product? You can sponsor this site.

~~~

Related posts about next: