For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

{
  "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.

  • 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.

Two filenames to avoid: next.config.cjs is never read, because Next.js rejects it outright, and next.config.mts only works on Next.js 16 running on a Node.js version with built-in TypeScript support.

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 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: August 17, 2026

Last updated

Was this helpful?