Skip to main content
Run Next.js on a server you own, without the glue scripts Build with the Next.js preset or your own Dockerfile, get HTTPS, preview environments per pull request, a managed database and one-click rollback, deployed on every push to your git host. Get started | Vercel migration runbook

What you get for a Next.js app

Build and deploy

Connect GitHub, GitLab, Bitbucket or Gitea. Pushes build a Dockerfile with BuildKit and cut traffic over only when the readiness probe passes.

Environment and build-time vars

Env vars are encrypted per app. NEXT_PUBLIC_* values are inlined at build time, so set them before the build, which the migration runbook covers.

Database next to the app

Create Postgres or Redis as a managed resource with scheduled, verified backups and link it to the app.

What Levelrail covers, and what it does not

Each row says what Levelrail does today. Rows marked “not yet verified on a real host” are documented behavior that has no recorded live run.

Deploy a Next.js app in about 10 minutes

The time depends mostly on your first build. Plan for the install and build of your own project, then a few minutes for the rest.
1

Detect and create the app

Connect the repository. When next is in package.json, the Next.js preset is picked: port 3000, a Railpack build and a start command based on your output setting. Check the proposed start command before you create the app. Details are in Next.js. Use your own Dockerfile if you want a smaller image or run a monorepo.
2

Set build-time variables, then deploy

NEXT_PUBLIC_* values are inlined at build time, so set them before the first build. Push to your branch. The new release takes traffic only after the readiness probe passes.
3

Add your domain

levelrail-cli apps domains add web app.example.com. Point DNS at the server, or connect Cloudflare as the DNS provider and Levelrail creates the record. See Domains and ingress.
4

Put Cloudflare in front

Run levelrail-cli cdn setup web --dry-run first. It checks the provider, the zone SSL mode, DNS-01, the client address preset and the DNS plan, and prints the fix command for anything that is off. It never changes zone settings. Then run levelrail-cli cdn setup web to apply the DNS plan, turn on the proxy and verify it. Deploys and rollbacks purge the Cloudflare cache for the app’s hostnames. A build started by a git push does not purge yet, and purge history resets when the control plane restarts. See Cloudflare in front. This was not yet verified on a live proxied record.
5

Open a pull request

levelrail-cli apps previews enable web. Each pull request gets a preview that is torn down when it closes. See Preview environments.
6

Practice a rollback

levelrail-cli apps deploys rollback-to web <deploy-id> puts the exact image of an earlier deploy back without a rebuild. The dashboard has a Rollback button per deploy.

What to expect for build time and cache

  • The first build is the slowest. Later builds reuse BuildKit cache steps, and the Deploys page shows median build time and cache hit rate. See Build performance.
  • Next.js writes its page and image cache under .next/cache. Without a volume, each deploy starts cold. The Next.js preset mounts a volume for it, and image_cache: persistent keeps optimized images. See Next.js and image cache.
  • With more than one replica, each keeps its own ISR cache unless you use the Redis shared cache.
  • Turning on the ingress cache is optional and starts with the “Cache static assets” preset in CDN and caching. The ingress never caches requests that carry cookies or an Authorization header unless a rule allows it.
  • A single small VPS is the best tested path. Build memory counts, so check Build performance.

Troubleshooting

Frequently asked questions

It runs your container, so anything that runs in a Node container works. Levelrail does not run a separate Next.js-specific runtime.
A pull request opened or updated deploys a preview. Closing the pull request tears it down, whether or not it merged.
Yes. A single node is the best tested path.
Yes, a runbook for moving a Vercel-hosted Next.js app, with an inventory, a cutover plan and the gaps.

Deploy your Next.js app to your own server

Start with a side project and move the rest when you trust it. Get started | Vercel migration runbook
Last modified on November 8, 2026