Deploy · Next.js

Next.js hosting, server included.

Runex hosts Next.js apps as a long-running server: it builds your repo with next build and runs next start in an isolated container. Server rendering, API routes, and middleware all work, with HTTPS on your URL.

  • App Router and Pages Router
  • SSR, API routes, middleware
  • Previews per pull request
acme/web
framework
Next.js
build
next build
start
next start · $PORT
rendering
SSR + static
url
https://web.runex.cloud
illustrative namesrunex

Definition

What does Next.js hosting need?

A Node.js server that runs your production build, plus HTTPS and environment variables.

Next.js is a React framework that renders pages on the server as well as in the browser. Features like server components, API routes, and middleware need a running Node.js process.

On Runex, that process is next start, running in its own container. It serves static and server-rendered pages from the same app.

Because the server stays up, you can hold database connections, run background tasks, and keep in-memory caches without cold starts.

How to deploy

How do you deploy a Next.js app on Runex?

Push, connect, deploy. No config file required.

  1. You

    Push to GitHub

    App Router or Pages Router.

  2. You

    Connect the repo

    Install the Runex GitHub App and pick the branch.

  3. You

    Add env variables

    Server secrets plus any NEXT_PUBLIC_*.

  4. Runex

    Build and start

    next build, then next start.

Configuration

Which package.json scripts does Runex use?

The standard build and start scripts. next start reads PORT automatically.

package.json
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"     # reads $PORT, binds 0.0.0.0
  },
  "engines": { "node": ">=20" }
}
package.jsonrunex

Want a smaller container? Set output: "standalone" in next.config.js and deploy with a Dockerfile that runs node server.js.

Avoid

What breaks Next.js deploys most often?

Build-time variables and Node versions.

  • NEXT_PUBLIC_* variables added after the build: redeploy to bake them in
  • A Node.js version older than your Next.js release requires
  • Missing lockfile, so production installs different versions
  • Reading secrets in client components, which exposes them to browsers

FAQ

Next.js deploy questions

Short answers for your first deploy.

Does Runex support Next.js server-side rendering?

Yes. Runex runs next start as a long-lived server, so server components, SSR, API routes, and middleware work as they do locally.

Can I use the Next.js App Router on Runex?

Yes. Both the App Router and the Pages Router work, because Runex runs your app with the standard next build and next start commands.

Why don't my NEXT_PUBLIC_ variables show up?

They're inlined into the JavaScript at build time. Add them in the Runex dashboard, then redeploy so the next build includes them.

Do I need output: standalone to host Next.js on Runex?

No. It's optional. Use it with a Dockerfile when you want a smaller image that starts with node server.js.

Next step

Host Next.js the full way.

Connect your repo and get a live HTTPS URL on your first deploy. Free to start.