Deploy guide

How to deploy Next.js

Next.js builds your site to a folder of plain files. Here's how to build it, which folder to publish, and the setup on each host.

npm run buildout

Pick a host

Where do you want it?

Before any host

Build it

Turn on the static export in next.config.js. next/image needs unoptimized images (or a custom loader) in an export, and API routes, middleware, rewrites and server-side rendering don't work in one.

next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'export',
  images: { unoptimized: true },
};

module.exports = nextConfig;

Run npm run build. The site comes out in out: that folder is what goes online, whichever host you pick.

Good to know

Worth knowing first

  • Need API routes or server rendering? Then it isn't a static site: Vercel or Netlify can run it as a Next.js app instead.

Or skip the setup

Drop it in. It's online in seconds.

A file, a folder or a whole site: 99helpers puts it online at its own address, with no git, no build settings and no DNS to start with. Add your own domain whenever you're ready.