How to host a Next.js app outside Vercel
Last updated
Run a Next.js app on a real Node.js server with server rendering and API routes, deployed from Git, a zip or your AI tool.
1. What Next.js needs to run
A Next.js app with server rendering, route handlers or server components needs a Node.js server running next start. Cloudzyro runs exactly that: a long-lived server, not cut-down functions, so your app behaves as it does on your computer.
If your app is fully static (output: "export" in next.config), you can upload the out folder instead and it's served as files.
2. Check your build and start scripts
Your package.json needs a build script and a start script. Most Next.js projects already have both:
{
"scripts": {
"build": "next build",
"start": "next start"
}
}We use Node 24 unless you ask for another version with engines.node in package.json or an .nvmrc file. Your app should listen on the PORT it's given, which next start does by itself.
3. Deploy from GitHub
- In the console, on Home, under Import from a repository, choose GitHub. GitLab, Bitbucket and any other Git host work the same way.
- Choose your site's address and select Continue.
- Sign in with GitHub and install Cloudzyro on the account or organization that owns the repository.
- Pick the repository, branch and folder, then select Deploy site.
From then on, every push to that branch puts a new version online. You can also deploy by uploading a zip, or by asking your AI tool.
4. Environment variables
Add your settings and secrets, such as database keys, on your site's Environment variables tab. Tick Sensitive for secrets you never need to see again.
Next.js puts NEXT_PUBLIC_ variables into the app when it's built, so deploy again after you change one.
5. Images, caching and middleware
Because your app runs as a full Node.js server, middleware and image optimization work as they do with next start on your computer.
Cloudflare caches your static files, such as images, CSS and JavaScript, close to your visitors. Pages and anything sent with Cache-Control: private aren't cached, and we clear the cache each time a new version goes online.
6. Custom domain
Add your own domain on the site's Domains tab, free on every plan. See How to point your domain at your site for the records to add.