Deploy a Next.js app from GitHub
Clone a Next.js repo from GitHub, build it with Node 20, and serve it in production behind Nginx — with a live progress stream and Git-token auth sealed in Vault.
What you'll build
- A Next.js app running in production mode on your node
- Nginx terminating HTTP/HTTPS in front of the Node server
- Git credentials stored in Vault, not in the deploy form
Before you begin
- A registered node (see “Provision your first node”)
- A GitHub repo with a Next.js app and a personal-access token for private repos
- A free TCP port on the node (3000 by default)
Point the wizard at your node
Open Development → Deploy → Next.js. Step 1 is server configuration: choose the deployment type (VM), the node IP, the SSH username, and the Vault key pair. If you set a default node earlier, these are pre-filled.
Deploy Next.js — Server configuration
Connect the GitHub repository
Step 2 is the application source. Paste the repo URL and branch. For a private repo, add a GitHub token — it’s written to Vault at workspaces/<org>/<workspace>/git/github_token and used only on the node during clone, never echoed back to the browser.
Deploy Next.js — Application source
Use a fine-scoped token
A read-onlycontents:read PAT is enough. VxCloud never needs write access to deploy.Configure the Next.js build
Step 3 sets build mode and runtime. Pick Production build mode and Node.js 20. The pipeline runs npm install && npm run build then npm run start in production mode.
Deploy Next.js — Next.js configuration
Set env vars, ports, and resources
Step 4 covers entry point, the package_file location, environment variables, and ports. Step 5 allocates CPU/RAM/disk. Defaults (app port 3000, HTTP 80, HTTPS 443) work for most apps — Nginx is configured automatically as the reverse proxy.
Deploy Next.js — Application settings
Prefer automation? The same payload can be posted directly:
$ {$ "config": { "host": "138.199.144.21", "ssh_user": "ubuntu", "key_pair_name": "default" },$ "repository_url": "https://github.com/acme/marketing-site",$ "branch": "main",$ "build_mode": "production",$ "node_version": "20",$ "app_name": "marketing-site",$ "app_port": 3000,$ "environment_vars": ["NEXT_PUBLIC_API=https://api.acme.com"]$ }Watch the live deployment stream
Hit Deploy. The wizard subscribes to /ws/api/v3/tenant/provision/status over WebSocket (with HTTP polling as a fallback) and streams each phase as it happens.
- Clone repository (Git token from Vault)20%
- npm install45%
- npm run build (Node 20)75%
- Start production server + Nginx proxy95%
- Health check passed100%
Live in production
Your app is reachable on the node’s domain. Push tomain and re-run the wizard (or wire CI — see the blue-green tutorial) to ship updates.Nice work — you're done!
You completed Deploy a Next.js app from GitHub. Keep the momentum going with the next walkthrough, or jump back to the full catalog.