Deploy a Next.js app on Nept
This guide walks you through deploying a Next.js app to Nept, using either a GitHub repository or the Nept CLI. Nept builds Next.js apps as they ship — App Router and Pages Router, Server Components, Server Actions, Route Handlers, and middleware are all supported.
Prerequisites
- A Nept account.
- A Next.js 13+ project (App Router recommended).
- Either a GitHub repository connected to Nept, or the Nept CLI installed.
Option A: Deploy from GitHub
- Connect your GitHub account to Nept.
- In the dashboard, click New project and choose your Next.js repository.
- Nept detects Next.js automatically and configures the build command (
next build) and output directory. - Add any environment variables your app needs.
- Click Deploy. Nept builds and deploys on every push to the tracked branch.
For a full walkthrough of GitHub-driven deployments, see Deploy from GitHub.
Option B: Deploy with the Nept CLI
Install the CLI and log in:
npm install -g nept-cli
nept login
From your Next.js project directory:
nept deploy --prod
Nept uploads your project, runs next build, and deploys the result. You'll get a unique .nept.cloud URL and, once configured, your custom domain.
See the full CLI reference for advanced options.
Configuration
Nept auto-detects most Next.js projects. If you need to customize:
- Build command: defaults to
next build. - Output directory: defaults to
.next. - Node version: set with an
enginesfield inpackage.json, or via the dashboard.
Environment variables
Configure secrets and runtime configuration per environment:
nept env add DATABASE_URL postgres://... --target production
See Environment Variables for the full API.
Custom domains
Attach your own domain from the dashboard or CLI. Nept handles TLS automatically. See Custom Domains.
Managed database
Provision a Postgres database in the same region as your Next.js app so queries stay on the local network:
nept db create --type postgres
Nept exposes DATABASE_URL as an environment variable to your Next.js runtime. See Databases.
Logs
Watch build and runtime logs live:
nept logs --follow
See Deployment Logs.