Skip to main content
Pterodactyl Panel can be deployed using Docker for simplified installation and management. This guide covers Docker configuration for the Panel.

Official Docker Image

Pterodactyl provides an official Docker image hosted on GitHub Container Registry:
Image Details:
  • Based on PHP 8.3 FPM Alpine
  • Includes Nginx web server
  • Node.js 22 for asset compilation
  • Built-in cron and supervisor
  • Multi-architecture support (AMD64, ARM)

Docker Compose Setup

Basic Configuration

Create a docker-compose.yml file:

Environment Variables

Application Settings

Database Configuration

MariaDB SSL/TLS (optional):

Cache Configuration

Redis SSL/TLS (optional):

Mail Configuration

Dockerfile Structure

The official Pterodactyl Dockerfile uses a multi-stage build:

Stage 0: Asset Compilation

This stage:
  • Uses Node.js 22 to compile frontend assets
  • Runs yarn install to get dependencies
  • Builds production assets with yarn run build:production

Stage 1: Application Container

This stage:
  • Uses PHP 8.3 FPM on Alpine Linux
  • Copies compiled assets from Stage 0
  • Installs required system packages
  • Includes certbot for Let’s Encrypt SSL

PHP Extensions

Installed extensions:
  • bcmath - Arbitrary precision mathematics
  • gd - Image processing
  • pdo_mysql - MySQL database driver
  • zip - Archive handling

Application Setup

Volume Mounts

Persistent Data

Mount these directories to persist data across container restarts:

Directory Permissions

Ensure proper permissions on mounted directories:

SSL/TLS Configuration

Let’s Encrypt (Automatic)

Set the LE_EMAIL environment variable:
The container will automatically:
  1. Request a certificate from Let’s Encrypt
  2. Configure Nginx to use HTTPS
  3. Set up auto-renewal via cron (runs at 11 PM daily)

Custom Certificates

Mount your certificates to /etc/letsencrypt/:
Certificate files needed:
  • fullchain.pem - Certificate chain
  • privkey.pem - Private key

Networking

Port Exposure

Custom Network

Reverse Proxy

When using a reverse proxy (Nginx, Traefik, Caddy):
  1. Don’t expose ports 80/443
  2. Set APP_URL to your domain
  3. Configure proxy to pass headers:

Cron Jobs

The container automatically sets up cron jobs:

Supervisor Configuration

The container uses Supervisor to manage processes:

Starting the Stack

Initial Setup

After starting the containers, run the setup:

Maintenance Commands

Clear Cache

Update Panel

Troubleshooting

Container Won’t Start

Check logs:
Common issues:
  • Database not ready (wait a few seconds)
  • Permission errors on volumes
  • Port conflicts

Database Connection Failed

Verify:
  • Database container is running
  • Credentials match in both services
  • Database has been created

Permission Errors

Best Practices

  1. Use environment files for sensitive data
  2. Enable HTTPS for production
  3. Regular backups of mounted volumes
  4. Monitor logs for errors
  5. Keep images updated for security
  6. Use Redis for cache and sessions
  7. Configure proper memory limits for PHP-FPM