DirectAdmin Manual

Helping you get the most out of DirectAdmin and your web!

Deploy a Next.js project

First determine whether the project requires a continuously running Node.js server. The answer depends on the Next.js version, router, server features and project configuration.

Option A: static export

When the site does not use SSR, API routes, Server Actions or other server features, a static export is simplest. Configure export mode according to the project's Next.js version and run:

npm ci
npm run build

Upload the resulting static directory, commonly out, to public_html. It then needs neither Node.js Selector nor NGINX Unit.

Option B: SSR or server features

  1. Verify the required Node.js version in package.json and project documentation.
  2. Upload the project outside public_html and install cleanly on the server.
  3. Set production environment variables before building.
  4. Run npm run build and fix every error.
  5. Select the runtime actually offered by the account: CloudLinux Selector or NGINX Unit.
  6. Configure the startup file for the project output and runtime. Do not invent a generic app.js without verifying compatibility.
  7. Start or restart the app and test HTML, static assets, images, APIs and authentication.

Domain or subpath

A dedicated domain or subdomain with the root path / is recommended. For /app/, configure basePath and, when required, assetPrefix; otherwise scripts, CSS and images can fail.

Update procedure

  1. Back up the project and database.
  2. Upload changes and run npm ci in the correct environment.
  3. Create a new production build.
  4. Restart the application through the panel.
  5. Verify key functions and review the log.
Back to chapter overviewContact Euroserver support