Server stays at 'Starting...' forever
Server stays at 'Starting...' forever
Cause: The panel marks a server as online only after it detects one of the following strings in the process stdout:
ready onstarted server onLocal: http://Compiled successfullylistening on▲ Next.js
- You are wrapping
next startornext devin a custom script that redirects or discards stdout. Remove any output suppression and let Next.js write directly to stdout. - Your app has a build error that prevents Next.js from reaching the ready state. Look for a
next buildfailure earlier in the log output. - If you are using a custom server (e.g.
server.js), make sure it still starts Next.js and that the ready message reaches stdout unchanged.
next start through tools like quiet or redirect stdout to /dev/null. The panel’s startup detection depends on reading that output directly.Build fails in production mode
Build fails in production mode
Cause:
next build failed because one or more environment variables required at build time are missing. Next.js bakes certain env vars (those prefixed with NEXT_PUBLIC_, and any others your code accesses at build time) into the compiled output. If they are absent during the build, the build will fail or produce a broken app.Fix:- Create a
.envfile locally with all required build-time variables and their correct values. - Rename the file to
.env.pterodactyl. - Upload it to
/home/container/using the panel’s File Manager. - Restart your server. The egg copies
.env.pterodactylto.envbefore runningnext build, so all variables will be available during the build.
next build error output — it usually identifies which variable or module caused the failure.Private repo cloning fails
Private repo cloning fails
Cause: One of the following:
- Your personal access token has expired or was revoked.
- The token does not have the required scope:
repofor GitHub orread_repositoryfor GitLab. - Credentials are embedded directly in
GIT_URL(e.g.https://user:token@github.com/...), which conflicts with the egg’s own credential injection.
- Generate a new personal access token:
- GitHub: Go to Settings → Developer settings → Personal access tokens (classic) and create a token with the
reposcope. - GitLab: Go to User Settings → Access Tokens and create a token with the
read_repositoryscope.
- GitHub: Go to Settings → Developer settings → Personal access tokens (classic) and create a token with the
- Set
GIT_URLto the plain HTTPS URL of your repository — no username or token embedded: - Set
USERNAMEto your GitHub or GitLab username. - Set
ACCESS_TOKENto the token you just created.
GIT_URL will cause the URL to be malformed after the egg applies its own injection.npm ci fails
npm ci fails
Cause: On the next server start (with
npm ci requires package-lock.json to be in exact sync with package.json. If you have added, removed, or updated packages in package.json without regenerating the lockfile, npm ci will fail with a dependency mismatch error.Fix — option 1 (recommended): Regenerate your lockfile locally:AUTO_UPDATE=1), the egg will pull the updated lockfile and npm ci will succeed.Fix — option 2: Delete package-lock.json from the container via the File Manager. Without a lockfile, the egg falls back to npm install, which resolves dependencies fresh and generates a new lockfile.Fix — option 3: Set PACKAGE_MANAGER to pnpm or yarn and commit the corresponding lockfile instead. Both pnpm and yarn also fall back gracefully from --frozen-lockfile to a regular install if the lockfile is absent.Server fails to start with 'No package.json found'
Server fails to start with 'No package.json found'
Cause: Fix — option 1: Set
GIT_URL is empty and no project files exist in the container. The egg has no repository to clone and cannot find a package.json to work with, so it exits immediately with:GIT_URL to your repository’s HTTPS URL in the server’s Startup tab and restart. The egg will clone the repository automatically.Fix — option 2: Upload your project files manually:- Build or prepare your Next.js project locally.
- Open the panel File Manager for your server.
- Upload your project files to
/home/container/, making surepackage.jsonis present at the root. - Restart the server. With
GIT_URLempty andpackage.jsonpresent, the egg will skip the git step and proceed with install, build, and start.
Port conflict or app not accessible
Port conflict or app not accessible
Cause: Your Next.js app or a custom server file is hardcoding a port number instead of using the one the egg provides. The egg always passes the panel-assigned port as
$SERVER_PORT to next start -p $SERVER_PORT or next dev -p $SERVER_PORT. If your app also binds to a different port inside next.config.js or a custom server.js, the two will conflict or the panel-assigned port will be left unbound and unreachable.Fix:- Do not hardcode a port in
next.config.js,server.js, or any other file. - If you use a custom server, make sure it reads the port from the
PORTenvironment variable or another mechanism — but note the egg usesSERVER_PORT, notPORT. The simplest approach is to let the egg callnext startdirectly (the default behavior) rather than using a custom server. - Do not override the
SERVER_PORTvariable in the panel — it is injected automatically by the panel based on the port allocation for your server.
pnpm or yarn not found
pnpm or yarn not found
Cause: The Docker image used by the egg ships with npm only. pnpm and yarn are not pre-installed. When the egg detects that pnpm or yarn is needed (either by lockfile detection or because you set
PACKAGE_MANAGER explicitly), it installs the package manager globally via npm before proceeding. This install happens at startup, not during the image build.Fix: This is expected behavior — no action is required. On the first start where pnpm or yarn is needed, there will be a brief delay (usually 10–30 seconds) while the package manager is downloaded and installed. On subsequent starts it will already be present and the delay will not occur.If the install fails, check that your server has outbound internet access and that npm’s registry is reachable from within the container. You can also try switching PACKAGE_MANAGER back to npm if you do not have a pnpm or yarn lockfile committed.