> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/overview-1/next.md).

# Next.js

Deploy Next.js on Hostinger in server mode, covering hPanel build settings, the standalone output Hostinger applies for you, next.config requirements, and ISR support.

React framework with SSR, static export, API routes, and full-stack capability. Hostinger runs Next.js apps in server mode: every deployment is built with Next's standalone output, and Hostinger starts the bundled server for you.

**`app_type`:** `next`

## Server mode

Pages render on each request, and API routes, Server Actions, and middleware execute at runtime.

### `package.json`

```json
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  }
}
```

### hPanel settings

| Field            | Value                  |
| ---------------- | ---------------------- |
| Application type | `next`                 |
| Build script     | `build`                |
| Output directory | `.next`                |
| Entry file       | — (ignored for `next`) |

Keep the output directory as `.next` — that's where Next writes the standalone server Hostinger starts.

### Standalone output

Hostinger applies `output: "standalone"` to your project before the build, so you don't need to set it yourself:

* With a `next.config.js`, `next.config.mjs`, `next.config.ts`, or `next.config.mts` in your project, your file is preserved and imported by a generated config that adds the standalone output. If more than one exists, the first match in that order is used.
* With no Next config at all, Hostinger creates a `next.config.mjs`.
* Any `output` value you set is replaced, including `output: 'export'`.

Standalone builds bundle a minimal copy of `node_modules` into `.next/standalone/`, so the server starts faster and the deployment is smaller.

> **Export a config object, not a function.** `export default { ... }` and `module.exports = { ... }` are merged correctly. A function config (`export default (phase) => ({ ... })`) is not — your settings and the standalone output are both lost, and the deployment fails with *Next.js build produced no standalone server or static output*.

**TypeScript configs are fully supported** — `next.config.ts` is not skipped or converted. The generated config that wraps yours is itself a TypeScript file, and Next.js loads both with its built-in TypeScript config support. Because that support arrived in Next.js 15, a TypeScript config on Next.js 14 or older is ignored by the framework: the standalone setting is lost and the deployment fails with *Next.js build produced no standalone server or static output*. On older Next.js versions, use `next.config.js` or `next.config.mjs` instead. `next.config.mts` is stricter still: it only works on Next.js 16 running on a Node.js version with built-in TypeScript support.

**Unsupported config filenames are silently ignored.** If your config uses any other filename — most commonly `next.config.cjs` — the deployment does not fail. Hostinger creates a default `next.config.mjs` and the build continues with default settings, so everything in your file is ignored without any warning in the build logs. (`next.config.cjs` is never read by Next.js itself either.) Rename the file to one of the four supported names before deploying.

## Static mode

Not applicable. Because Hostinger always builds `next` apps with standalone output, `output: 'export'` in your Next config has no effect and no `out/` directory is produced.

To host a Next.js site as static files, build the export on your machine and upload the generated `out/` directory to `public_html` with [File Manager](/websites/file-manager.md) instead of deploying it as a Node.js app.

## Notes

* Node 20 or newer required.
* ISR (Incremental Static Regeneration) and on-demand revalidation work out of the box.
* Image optimization works out of the box — no custom loader needed.

***

*Last updated: September 11, 2026*
