Skip to main content
This guide explains how to deploy a production Next.js application on an Aisbir Cloud Pterodactyl Node.js server.

1. Configure the start Script in package.json or Use server.js

To ensure Next.js binds to the dynamic port allocated by Pterodactyl, configure the start script in package.json using $SERVER_PORT:
package.json
Alternatively, you can use a custom server.js runner:
server.js

2. Build Your Application Locally

Run the build command on your computer before uploading:

3. Compress Project Files into a ZIP Archive

Select and compress the following files into a single .zip archive:
  • .next folder
  • public folder (if available)
  • package.json & package-lock.json
  • server.js (if using custom server)
  • .env (if containing environment variables)
DO NOT upload node_modules! Pterodactyl will execute npm install automatically on server startup.

4. Upload and Extract in Pterodactyl File Manager

  1. In your Pterodactyl server panel, open the Files menu.
  2. Upload your .zip archive.
  3. Click the three dots icon () on the .zip file and select Unarchive to unpack files to /home/container.

5. Configure Startup Tab & Start Server

  1. Open the Startup tab:
    • Main File / Startup File: Set to server.js (if using custom server) or index.js.
    • Node Version: Select your preferred Node.js version (e.g. Node 18, Node 20, or Node 22).
  2. Go to the Console tab and click Start.
  3. Pterodactyl will install dependencies and launch your Next.js application!

Linking a Custom Domain

To access your Next.js application via a standard domain without specifying port numbers, use our Reverse Proxy feature (see How to Add Reverse Proxy).
Last modified on August 30, 2026