> ## Documentation Index
> Fetch the complete documentation index at: https://nextjs-egg.nyxel.my.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> An overview of the Next.js Pterodactyl Egg — what it does and whether it fits your setup.

## What is the Next.js Egg?

The Next.js Egg is a production-ready Pterodactyl/Pelican egg that lets you host any Next.js application directly from a Git repository. Instead of manually uploading build artifacts or SSHing into a server, you point the egg at your repo, set a handful of variables in the panel, and it handles the rest: cloning, dependency installation, building, and starting your app.

It is designed for Pterodactyl Panel v1.x and Pelican Panel users who want a repeatable, panel-managed workflow for Next.js hosting.

## Key capabilities

<CardGroup cols={2}>
  <Card title="Git-based deployment" icon="code-branch">
    The egg clones your repository on first start and optionally pulls the latest commits on every subsequent start with `AUTO_UPDATE=1`.
  </Card>

  <Card title="Production & development modes" icon="toggle-on">
    Set `NODE_RUN_ENV` to `production` to run `next build` + `next start`, or `development` to run `next dev` with hot-reload.
  </Card>

  <Card title="Private repository support" icon="lock">
    Authenticate with a GitHub or GitLab personal access token. The egg injects credentials into the clone URL automatically — you never embed secrets in the URL itself.
  </Card>

  <Card title=".env injection" icon="file-lines">
    Upload a `.env.pterodactyl` file via the panel File Manager and the egg copies it to `.env` before your app starts. No secrets in panel variables.
  </Card>

  <Card title="Package manager auto-detection" icon="magnifying-glass">
    Set `PACKAGE_MANAGER` to `auto` and the egg inspects your lockfile: `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, otherwise npm. You can also pin a specific manager.
  </Card>

  <Card title="Cloudflare Tunnel" icon="cloud">
    Optionally provide a `CLOUDFLARE_TOKEN` and the egg starts a Cloudflare Tunnel alongside your app, exposing it through your Zero Trust dashboard without opening a port.
  </Card>
</CardGroup>

## Requirements

Before you create a server with this egg, make sure the following are true:

* You are running **Pterodactyl Panel v1.x** or **Pelican Panel**.
* Your project has a valid `package.json` with `next` listed as a dependency.
* Your `next.config.js` (or `next.config.ts`) does **not** hardcode a port number. The egg injects `SERVER_PORT` at runtime and passes it to `next start`/`next dev` via the `-p` flag.

<Note>
  The egg sets the `SERVER_PORT` environment variable to the port allocated by the panel. Your Next.js config should read the port dynamically (or omit it entirely, since the egg passes `-p` on the command line).
</Note>

## Supported Docker images

The egg ships with Node.js images ranging from 18 LTS to 25 (latest). Node.js 24 LTS is the recommended choice for production workloads.

| Image                          | Tag                                 |
| ------------------------------ | ----------------------------------- |
| Node.js 25 (Latest)            | `ghcr.io/parkervcp/yolks:nodejs_25` |
| Node.js 24 (LTS) — recommended | `ghcr.io/parkervcp/yolks:nodejs_24` |
| Node.js 23                     | `ghcr.io/parkervcp/yolks:nodejs_23` |
| Node.js 22 (LTS)               | `ghcr.io/parkervcp/yolks:nodejs_22` |
| Node.js 21                     | `ghcr.io/parkervcp/yolks:nodejs_21` |
| Node.js 20 (LTS)               | `ghcr.io/parkervcp/yolks:nodejs_20` |
| Node.js 19                     | `ghcr.io/parkervcp/yolks:nodejs_19` |
| Node.js 18 (LTS)               | `ghcr.io/parkervcp/yolks:nodejs_18` |

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Import the egg JSON into your panel and create your first server.
  </Card>

  <Card title="Quick Start" icon="bolt" href="/quickstart">
    Get your Next.js app running in minutes with the minimum required configuration.
  </Card>
</CardGroup>
