Deploy a Next.js App


You can find the step-by-step deployment guide here.

Build Environment Setup
Copy link

By default, the following commands are executed to build a Next.js project:

DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
  curl \
  {% if system_dependencies %}{{ system_dependencies | join(' ') }}{% endif %} \
  && rm -rf /var/lib/apt/lists/*

Here, system_dependencies refers to the system packages configured in the dashboard.

After that, project dependencies are installed using the package manager detected in the repository (yarn, pnpm, or npm):

yarn install
pnpm install
npm install

SSR Support
Copy link

When creating an application, you can enable SSR support. In this case, the application will run as a backend application:

  • You will need to select a server configuration. 
  • The dashboard interface after deployment will be identical to that of a backend application.
  • You will be able to define a start command. The default start command is:
npm start

SSR support cannot be disabled after deployment. To change the application mode, you will need to create a new application with the desired configuration.