Deploy a Next.js Site to Vercel from Your Terminal

Install the Vercel CLI, link your project and push it live with one command.

Vercel is made by the team behind Next.js, so deploying a Next.js site there takes very little setup. You can do everything from your terminal.

These steps work on Windows (PowerShell), macOS and Linux.

Install the Vercel CLI

You need Node.js installed. Then run:

npm install -g vercel

Check that it worked:

vercel --version

Log in

vercel login

Choose how you want to sign in (GitHub, email and so on) and finish in the browser window that opens.

Deploy a preview

Open a terminal in your project folder and run:

vercel

The first time, Vercel asks a few questions: which account to use, whether to link to an existing project, and the project name. The defaults are fine for a normal Next.js app.

When it finishes, you get a preview URL. Open it and check the site works.

Deploy to production

When you're happy with the preview:

vercel --prod

This updates your main your-project.vercel.app address and any custom domain connected to the project.

Environment variables

If your site uses secret keys (API keys, database URLs), add them in Project → Settings → Environment Variables on Vercel. Never put secrets in files you commit to GitHub.

Next step

Connect your own domain so visitors don't see vercel.app. See how to connect a .com.np domain to Vercel.