Skip to main content
Run Next.js on a server you own, without the glue scripts Build from your Dockerfile, get HTTPS, preview environments per pull request, a managed database and one-click rollback, all from a git push. 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.

Self-hosting Next.js, honestly

What changes when you leave a managed platform.

From repo to HTTPS

1

Add a Dockerfile

A standard multi-stage Next.js Dockerfile with output set to standalone keeps the image small.
2

Connect the repo and set env vars

Set build-time variables first, then runtime secrets.
3

Add your domain

Point DNS at the server and Caddy issues and renews the certificate.
4

Open a pull request

A preview environment deploys and is torn down when the pull request closes.

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 October 12, 2026