A custom, optimized Pterodactyl Egg for hosting Next.js applications.
This version resolves the common connectivity issue where Next.js servers show as "Ready" in the console but remain inaccessible via the browser/IP address due to incorrect network binding.
By default, Next.js applications often bind to localhost (127.0.0.1). Inside a Docker container (which Pterodactyl uses), this prevents the application from being accessible from the outside world.
This Egg fixes that by automatically forcing the start command to listen on all interfaces (0.0.0.0), ensuring your site is immediately accessible after deployment.
It also improves startup reliability by using smarter dependency install behavior with package manager detection:
automode detects lockfiles and pickspnpm,yarn, ornpmautomatically.- In
startmode, it installs production dependencies and builds before launch. - In
devmode, it installs full dependencies so local development tools still work.
This Egg comes pre-configured with all modern Node.js versions, selectable during installation:
- Node.js 25 (Latest)
- Node.js 24 (LTS)
- Node.js 23
- Node.js 22 (LTS)
- Node.js 21
- Node.js 20 (LTS)
- Node.js 19
- Node.js 18 (LTS)
β Next.js Compatibility: Supports all modern Next.js versions (13, 14, 15, 16+) that run on these Node environments.
- π Instant Connectivity: Pre-configured to listen on
0.0.0.0, solving connection timeouts. - π¦ Auto-Install: Automatically runs
npm installon startup if packages are missing. - βοΈ Smart Build: Runs
npm run buildautomatically in production mode (NODE_RUN_ENV=start). - π§ Package Manager Auto-Detect: Supports
npm,pnpm, andyarnwith optional manual override. - π Secure: Based on the official Pterodactyl Docker images (Parkervcp/Yolks).
- β
Better Validation: Restricts runtime mode to
startordevto prevent invalid command values.
NODE_RUN_ENV:startfor production,devfor development.PACKAGE_MANAGER:auto(default),npm,pnpm, oryarn.
- Download: Get the
nextjs-egg.jsonfile from this repository (or copy the RAW link). - Import: Go to your Pterodactyl Admin Panel -> Nests -> Import Egg.
- Select Nest: Choose the appropriate Nest (usually "NodeJS" or "Generic").
- Upload: Upload
nextjs-egg.jsonand complete the import wizard. - Deploy: You can now create new servers using this Egg!
- Install fails with package manager errors: Set
PACKAGE_MANAGERmanually tonpm,pnpm, oryarninstead ofauto. pnpmoryarncommand not found: KeepPACKAGE_MANAGER=npmor ensure Corepack is available in your selected Node image.- Unexpected dependency behavior: Verify lockfiles in your project root (
package-lock.json,pnpm-lock.yaml, oryarn.lock). - Server builds on every boot in production: This is expected when
NODE_RUN_ENV=start; usedevwhile iterating quickly. - Server not reachable from outside: Confirm your panel allocation/port is correct; this Egg already binds Next.js to
0.0.0.0.
If this Egg saved you time or fixed your server headaches, consider supporting my work! It helps me keep creating tools and fixes.
- PayPal: paypal.me/JoopDev
- Website: JoopDev.com
Author: JoopDev (AKA. Vdbergjohannes)