Skip to content

Next.js hosting

Next.js hosting.

Push your Next.js app to GitHub or GitLab. Lahyer detects it, builds it with your package manager and runs it as a Node.js server, with HTTPS, preview deployments and live logs.

Deploy your project
Node.jsServer rendering on Next.js's own server
PreviewsA URL for every pull request
Postgres1 GB included on Free

What Lahyer does with it

How Next.js builds and runs.

Lahyer fills these in from your repository. Change anything that does not fit in the project's build settings.

How Lahyer builds and runs Next.js
Detected fromnext in your package.json dependencies
Installnpm, pnpm, Yarn or Bun, chosen from your packageManager field or lockfile
BuildYour build script, or next build when there is none
Runs asA Node.js server with standalone output. With output: "export" in next.config, static files from out/
Node.js20 or 22, read from .nvmrc, .node-version or engines.node (22 by default)

Next.js documentation

Your first deploy

Three steps
to a live URL.

Connect the repository.

Import it from GitHub or GitLab and choose the production branch. In a monorepo, set the root directory to the Next.js app.

Add your environment variables.

They are encrypted, kept separate for production and preview, and available during the build, so NEXT_PUBLIC_ values reach the browser bundle.

Push and ship.

Every push to the production branch deploys. Pull requests get their own preview URL, and you can roll back without rebuilding.

A few useful answers

Before you begin.

Do I need to change my Next.js config?

No. Lahyer asks Next.js for standalone output during the build, so most apps deploy as they are. If your config sets output itself, or the app sits in a monorepo, wrap it with withLahyer from the @lahyer/next package.

Does the App Router work?

Yes. Lahyer runs the output of next build on Next.js's own Node.js server, so the App Router, the Pages Router and route handlers work as they do with next start.

Will my app sleep on the free plan?

Server apps on Free sleep when idle and start again on the next request, which can take a moment. Pro keeps one production app always on.

Can my app use a database?

Yes. Add Postgres from the project's Database tab and Lahyer puts the connection string in DATABASE_URL for production and preview. Free includes one 1 GB database.