Skip to content

Go live

Publish your website

Put your website online with Vercel, Netlify or your own server.

Before you publish

Run through this list. Each item links to the page that explains it.

Then check that the website builds without errors. In the terminal, run:

Terminal
$npm run build

If it finishes with a list of pages and no red errors, you are ready. If not, the message names the file and line to fix.

Choose where to host it

Your website needs hosting that supports Node.js. The easiest options handle everything for you:

OptionBest for
Vercel (recommended)Easiest. Made by the creators of Next.js. Free plan available.
NetlifyAlso very easy, with a free plan.
Your own server (VPS)If you or your developer already manage a server.

Publish with Vercel

  1. Put your project on GitHub

    Create a free account at github.com. The simplest way to upload is GitHub Desktop: choose File → Add Local Repository, select your template folder, create the repository and click Publish repository. Keep it private.

    The node_modules folder is skipped automatically. It is rebuilt on the server.

  2. Import it into Vercel

    Sign up at vercel.com with your GitHub account. Click Add New → Project and import your repository. Vercel detects Next.js on its own; you do not need to change any build settings.

  3. Add your settings

    Before deploying, open Environment Variables and add NEXT_PUBLIC_SITE_URL plus any form addresses from your .env.local file.

  4. Deploy

    Click Deploy. After a minute or two you get a live address like your-project.vercel.app.

  5. Connect your domain

    In your project, open Settings → Domains, add your domain and follow the instructions to update its DNS settings with your domain provider. Changes can take up to a day to take effect.

Publish with Netlify

The steps are almost the same: put your project on GitHub, sign up at netlify.com, choose Add new site → Import an existing project, pick your repository, add your environment variables and deploy. Netlify detects Next.js automatically.

Publish on your own server

For developers. The server needs Node.js 20.9 or newer. Upload the project (without node_modules), then run:

Terminal
$npm install$npm run build$npm run start

The site runs on port 3000. Set environment variables before building. In production, keep it running with a process manager such as PM2 and put a web server such as Nginx in front of it for your domain and HTTPS.