nextshipnextship

Deploy Next.js to your own server

No Dockerfile. No next.config edits. No Terraform, and no cloud account to hand over. One command prepares any Ubuntu or Debian server over SSH; the next builds your app, prunes it to what it actually needs, and puts it live behind automatic HTTPS.

$npm install -g nextship-cli

From your machine to your server, over SSH

$nextship server add root@203.0.113.10

$nextship server add root@203.0.113.10 --yes

$nextship deploy --yes

No cloud token involved. Prefer a managed platform? The same deploy goes to DigitalOcean App Platform.

The container runs the Next.js server itself, so all of this keeps working

StreamingSuspenseTime-based ISROn-demand ISRServer ActionsImage optimizationafter()

100%

of Next.js's own deploy-mode suites pass

1,123 of 1,123, 9 Vercel-only tests skipped

591MB

runtime image, from a 1.13 GB tree

pruned to the files the build traced

27ms

to first byte while a page streams

against a 2.02 s total, on a real container

How it works

From your machine to your own server

Four steps, each a command you can run on its own. Nothing goes through a service of ours: nextship reaches your server with your own SSH.

  1. Step 01 of 04

    Prepare the server

    The plan shows the server’s host key fingerprint and every setup step, and changes nothing until --yes. Then it installs Docker if it is missing, runs Caddy on 80 and 443 for automatic HTTPS, turns on security updates and the ufw firewall where the server has it, and turns off password logins last. Run it again and nothing changes.

    $nextship server add root@203.0.113.10

    $nextship server add root@203.0.113.10 --yes

  2. Step 02 of 04

    Build, with no Dockerfile

    Builds inside Docker with Next.js’s own Deployment Adapter injected, on the server over SSH or on your machine with --build local, then keeps only the files the build traced. A 1.13 GB tree becomes a 591 MB image.

    $nextship deploy --yes

  3. Step 03 of 04

    Release without downtime

    The new container starts with no public port. Caddy switches to it only once Docker reports it healthy, then the previous one stops, with 30 seconds for requests still in flight. A deployment that cannot start is refused, and the old one keeps serving.

    579 of 579 requests succeeded across a deployment on a DigitalOcean Droplet

  4. Step 04 of 04

    Keep it running

    Every app on the server, and what needs attention, in one command. Logs keep their history, rollback reuses an image that already ran, a watchdog restarts an app that hangs, and one server can host several apps.

    $nextship server status

    $nextship rollback --yes

Guarantees

What is in nextship

The guarantees the tool is built around, rather than a list of features.

Every Next.js feature keeps working

The container runs the Next.js server itself, not a reimplementation. Streaming, ISR, Server Actions, image optimization and after() all behave as they do in development.

A plan before anything changes

server add, deploy, rollback and env rm each print what they will do and stop. Nothing is created, changed or charged until you pass --yes.

A rollback cannot add a fault

Rollback reuses an image that already ran, with no build. On a server it refuses a deployment that never served, and a failed start leaves the current one serving.

Secrets stay out of the image

Env files are mounted as BuildKit secrets, excluded from layers and from the cache key. On a server, the runtime variables and the Server Actions key live in a directory only the nextship user can read.

Your server is the one it talks to

The host key is pinned once you have seen its fingerprint, and a changed key is refused rather than prompted about. SSH runs with no passwords and no prompts, and anything secret travels on stdin, never in a command line.

No lock-in, by construction

The output is a standard OCI image. If nextship disappears tomorrow, the image still runs anywhere that runs containers.

Leaving Vercel

What changes when you leave Vercel

Stated plainly, including the parts that do not survive the move. Run nextship doctor to get this for your own project.

  • Streaming and Suspense

    Works. 27 ms to first byte against a 2.02 s total, measured on a real container.

  • ISR, time based and on demand

    Works. On your own server nothing caches in front of it; on App Platform, give an on-demand page a revalidate time, or its CDN keeps it.

  • Server Actions

    Works. One encryption key is pinned across builds so actions stay decryptable.

  • Image optimization

    Works, producing WebP. sharp is installed for the container platform, not yours.

  • Edge runtime

    Works, in your region rather than at the edge. Next.js runs it inside its own server.

  • Analytics and Speed Insights

    Not available. Those are Vercel products, not Next.js features.

Deploy your first app

You need Node 22, a running Docker, and a server you can SSH into, or a DigitalOcean token. The local commands need nothing but the first two.