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
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:
.nextfolderpublicfolder (if available)package.json&package-lock.jsonserver.js(if using custom server).env(if containing environment variables)
4. Upload and Extract in Pterodactyl File Manager
- In your Pterodactyl server panel, open the Files menu.
- Upload your
.ziparchive. - Click the three dots icon (⋮) on the
.zipfile and select Unarchive to unpack files to/home/container.
5. Configure Startup Tab & Start Server
- Open the Startup tab:
- Main File / Startup File: Set to
server.js(if using custom server) orindex.js. - Node Version: Select your preferred Node.js version (e.g. Node 18, Node 20, or Node 22).
- Main File / Startup File: Set to
- Go to the Console tab and click Start.
- Pterodactyl will install dependencies and launch your Next.js application!
