Before you begin
Make sure you have already imported the egg and created a server. If not, complete the Installation guide first. Your Next.js project must meet these requirements:- A valid
package.jsonwithnextlisted as a dependency. - Your
next.config.jsmust not hardcode a port. The egg passes the panel-allocated port via the-pflag at runtime.
Configure and start your server
1
Import the egg and create a server
If you have not done so yet, follow the Installation guide to import
next-js-egg.json and create a server. Return here once your server exists in the panel.2
Set your Git repository URL
On the server’s Startup tab, set The egg clones this URL on first start. On subsequent starts it either pulls new commits (if
GIT_URL to the full HTTPS URL of your repository:AUTO_UPDATE=1) or skips the pull.If you prefer to upload your project files manually instead of using Git, leave
GIT_URL empty and upload your files via the panel File Manager. The egg will skip cloning and use whatever files are already in the server volume, as long as a package.json is present.3
Set the branch
Set
GIT_BRANCH to the branch you want to deploy. The default is main. Leave it empty to let Git use the repository’s default branch.4
Choose a run environment
Set In
NODE_RUN_ENV to control how Next.js starts:production mode the egg runs next build followed by next start. This produces an optimised build suitable for real traffic.In development mode the egg skips the build step and runs next dev, giving you hot-reload. Use this only for active development — it is slower and not optimised for production traffic.5
Choose a package manager
Set
PACKAGE_MANAGER to control how dependencies are installed:auto is the safest choice — it uses whichever lockfile you committed to your repo.6
Start the server
Click Start in the panel. The egg will:
- Clone your repository (first start) or pull latest changes (if
AUTO_UPDATE=1). - Copy
.env.pterodactylto.envif the file exists in the server volume. - Install dependencies using your chosen package manager.
- Run
next build(production mode only). - Start Next.js on the panel-allocated port.
Working with private repositories
If your repository is private, set two additional variables on the Startup tab before starting the server:
The egg injects these into the clone URL automatically. Do not embed them in
GIT_URL itself.
To create a GitHub personal access token, go to Settings → Developer settings → Personal access tokens → Tokens (classic) and generate a token with the
repo scope.Injecting environment variables
If your app requires a.env file (API keys, database URLs, etc.), do not put secrets directly into panel variables. Instead:
- Create your
.envfile locally with all required keys and values. - Rename it to
.env.pterodactyl. - Upload it to the server’s root directory (
/home/container/) via the panel File Manager. - Start (or restart) the server — the egg copies it to
.envbefore your app starts.
Auto-update behaviour
TheAUTO_UPDATE variable controls what happens on every server start after the first clone:
Set
AUTO_UPDATE=0 if you want full control over which commit is deployed — for example, if you pin a specific commit or tag manually.