Deploying a Next.js app
Push to Git; we handle build, scale, TLS, and caching.
4 min read
Managed Cloud is opinionated about Next.js. The dashboard creates the right NGINX, Node, and CDN configuration for you; you push code, we ship it.
Create the app from the dashboard: Managed Cloud → New app → Next.js. Enter the Git repository URL (GitHub, GitLab, or Bitbucket; SSH or HTTPS), the branch to track, and any build-time environment variables.
On every push to the tracked branch we fetch, build with `npm run build` (or `pnpm` / `yarn` if we detect their lockfiles), and atomically swap the running container. Deploy time for a typical Next.js app is 40–90 seconds.
Zero-downtime rollback is built in: every previous build is kept for 14 days and one-click revertable. We hold the previous container warm for the first 60 seconds of a new build so the actual user-facing switch is instant.
Common gotchas: environment variables exposed to the browser must be prefixed `NEXT_PUBLIC_`; build-time-only variables (database URLs, API secrets) are read at build time and baked into the server bundle. Don't put secrets in `NEXT_PUBLIC_` variables — they'll be visible in the client JS.