> 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

React framework with SSR, static export, API routes, and full-stack capability. Hostinger supports both static export and SSR modes.

**`app_type`:** `next`

## `package.json`

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

## Static export

Choose this when your site has no server code — no `getServerSideProps`, no API routes that need runtime execution, no Server Actions.

Set `output: 'export'` in your Next config:

```js
// next.config.js
module.exports = { output: 'export' };
```

**hPanel settings:**

| Field            | Value   |
| ---------------- | ------- |
| Application type | `next`  |
| Build script     | `build` |
| Output directory | `out`   |
| Entry file       | —       |

The build produces fully pre-rendered HTML/CSS/JS in `out/`. Hostinger serves it as static files.

## SSR / full-stack

Default Next.js mode. The server renders pages on each request and API routes execute at runtime. Use this when you have dynamic data, API routes, Server Actions, or middleware.

**hPanel settings:**

| Field            | Value                                         |
| ---------------- | --------------------------------------------- |
| Application type | `next`                                        |
| Build script     | `build`                                       |
| Output directory | `.next`                                       |
| Entry file       | — (Hostinger runs `next start` automatically) |

## Standalone output (recommended for SSR)

For smaller deployments, add `output: 'standalone'` to `next.config.js`:

```js
module.exports = { output: 'standalone' };
```

This bundles a minimal copy of `node_modules` into `.next/standalone/` so the server starts faster and the archive is smaller.

## Notes

* Node 20 or newer required.
* For ISR (Incremental Static Regeneration) and on-demand revalidation, use SSR mode.
* Image optimization in SSR mode works out of the box; static export requires a custom image loader.

***

*Last updated: July 21, 2026*
