/docs/getting-started/vps-quickstart

VPS Quickstart

Before you start

You need: a Linux VPS (Ubuntu 22.04+ recommended), SSH access as root or a sudo user, a domain pointed at the server IP, and the NextDeploy CLI installed locally.

npm install -g @nextdeploy/cli
nextdeploy --version  # should print 1.x.x

Step 1 โ€” Provision the server

Run the provisioner from your local machine. It SSHes into the server, installs Caddy, Node.js LTS, and the nextdeployd daemon.

nextdeploy provision ssh://root@203.0.113.42

# Output:
# โœ“ Connected to 203.0.113.42
# โœ“ Installed Caddy 2.8.4
# โœ“ Installed Node.js 22.3.0
# โœ“ Installed nextdeployd 1.2.0
# โœ“ Opened ports 80, 443
# Server ready. Add your secrets and run nextdeploy ship.

Step 2 โ€” Add secrets

Secrets are encrypted at rest on the server and injected as environment variables at runtime.

nextdeploy secrets set DATABASE_URL="postgresql://..."
nextdeploy secrets set BETTER_AUTH_SECRET="..."
nextdeploy secrets set BETTER_AUTH_URL="https://yourdomain.com"

Step 3 โ€” Ship

nextdeploy ship

# Output:
# โœ“ Building Next.js app...
# โœ“ Bundle size: 4.2 MB
# โœ“ Uploaded to server
# โœ“ Started new release on :3002
# โœ“ Health check passed (latency: 12ms)
# โœ“ Traffic flipped: :3000 โ†’ :3002
# โœ“ Deployed v1 (commit a1b2c3d)
#   https://yourdomain.com

Step 4 โ€” Configure DNS

Point your domain's A record at the server IP. Caddy fetches a TLS certificate automatically on the first HTTPS request.

# DNS A record
yourdomain.com.    300  IN  A  203.0.113.42
www.yourdomain.com 300  IN  A  203.0.113.42

Step 5 โ€” Enable the Go Sidecar (optional)

Add the gosidecar block to your nextdeploy.yml and re-ship. See the Go Sidecar docs for the full config reference.