Deployment

Vercel Is Default — Many Others Work

Deployment

Vercel offers first-class Next deployment, but Cloudflare, Netlify, AWS, and self-hosted Docker all work — pick by features you need.

5 min read Level 2/5 #nextjs#deployment#vercel
What you'll learn
  • Deploy to Vercel with one command or a git push
  • Self-host with a multi-stage Docker image
  • Pick a host based on edge and runtime needs

Next can deploy almost anywhere that runs Node or a V8 isolate. Vercel is the smoothest path because they build Next, but plenty of teams ship on Cloudflare, Netlify, AWS, or their own boxes.

Vercel

npm i -g vercel
vercel

That, or git push to a connected repo. Vercel detects Next, runs the build, and deploys: static pages go to the CDN, server routes to Functions, and middleware to the Edge.

Cloudflare

@cloudflare/next-on-pages compiles your Next app to run on Cloudflare Pages with Workers handling the dynamic parts. Great for teams that already live on Cloudflare.

Docker (Self-Hosting)

Add output: 'standalone' to next.config.ts so the build produces a minimal, self-contained server bundle.

# Dockerfile
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci

FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]

output: 'standalone' is what makes the third stage tiny — the final image only carries the bits the server actually needs.

How to Pick

  • Need the easiest path and free preview deploys? Vercel.
  • Already on Cloudflare? next-on-pages.
  • Want full control or air-gapped hosting? Docker behind nginx or an LB.
  • Edge-heavy workloads with tight latency budgets? Vercel or Cloudflare — both deploy middleware and Edge routes to global PoPs.

That is the end of the track. Build something with it.