Automatic Docker Installation

Guide to installing PteroCA using the Docker Automated Installer, which sets up the entire containerized environment — including web server, database, and panel - in one command.

To provide a fully containerized setup experience, we’ve developed a dedicated Docker installer that automatically prepares your server, installs Docker & Compose, clones the PteroCA repository, configures the environment, and launches containers for you — all with minimal input.

Unlike the standard system installer, this method runs PteroCA inside Docker containers, making it ideal for both production and development environments.


1. Execute the Installer

The Docker installer can deploy PteroCA with a single command, handling all dependencies, Docker configuration, and initial startup automatically.

bash -c "$(wget -qO- https://pteroca.com/scripts/docker_installer.sh)"
Requirements & Supported OS

Operating System: Ensure your server is running a supported OS:

  • Ubuntu 22.04 (Jammy)

  • Ubuntu 24.04 (Noble)

  • Debian 11 (Bullseye)

  • Debian 12 (Bookworm)

  • Rocky Linux 8

  • Rocky Linux 9

  • AlmaLinux 8

  • AlmaLinux 9

  • CentOS Stream 9

Root Access: The installation must be executed with root privileges.


1.1 Using Installer with Custom Parameters

If you prefer to automate Docker deployments — e.g. via CI/CD pipelines, Ansible, or VPS provisioning scripts — the installer supports advanced flags that give full control over the installation process.

CLI Parameters Reference
Parameter
Description
Example

--yes, -y

Runs in non-interactive mode (skips confirmations). Requires --environment.

--yes

-e, --environment

Sets the target environment: dev or prod.

--environment prod

--install-path

Custom installation directory (default: /opt/pteroca).

--install-path /var/www/pteroca

Usage Examples

Example (non-interactive installation)

bash -c "$(wget -qO- https://pteroca.com/scripts/docker_installer.sh)" --yes --environment prod --install-path /opt/pteroca

This command:

  • Installs Docker and Docker Compose if missing

  • Clones the PteroCA repository

  • Starts the container stack in production mode (port 80)

  • Completes the setup automatically without prompts


2. Automatic Installation Process

Once the script starts, it will:

🧩 Step 1 – Detect Operating System

Automatically identify your OS (Ubuntu, Debian, Rocky, etc.) and verify version compatibility.

🧰 Step 2 – Install Dependencies

If not already present, the installer will automatically:

  • Install Git

  • Install Docker Engine and Docker Compose Plugin (v2)

  • Enable and start the Docker service

📦 Step 3 – Clone the Repository

The script downloads the latest PteroCA source code from https://github.com/pteroca-com/panel

If the repository already exists, it pulls the latest updates instead.

⚙️ Step 4 – Configure Environment

You’ll be prompted (or auto-configured in non-interactive mode) to select:

  • Environment type: Development (dev) or Production (prod)

  • Installation directory

  • Whether to reuse or replace existing .env configuration

🐳 Step 5 – Run Docker Initialization

The script will automatically execute the bundled docker-init.sh, which:

  • Builds all Docker containers (web, database, phpMyAdmin for dev)

  • Configures environment variables and credentials

  • Runs Doctrine migrations and sets up file permissions

  • Starts all services automatically

🌐 Step 6 – Final Summary

At the end, the script displays:

  • Access URLs

  • Database connection info

  • Useful Docker management commands

  • Next steps to finalize installation

Example output:

Web:        http://localhost:8000 or http://<SERVER_IP>:8000
phpMyAdmin: http://localhost:8080
Database:   localhost:3306

3. Post-Installation Configuration

After containers are started, complete setup using one of the following methods:

🧭 Web Wizard

Visit:

http://<your-server-ip>:8000/first-configuration

or for production:

http://<your-server-ip>/first-configuration

💻 CLI Wizard

Run inside the container:

docker compose exec web php bin/console app:configure-system

Both methods allow you to set:

  • PteroCA admin account

  • Pterodactyl API credentials

  • Basic panel settings and domain configuration


4. Managing Containers

Action
Command

Stop all containers

docker compose down

View logs

docker compose logs -f

Restart services

docker compose restart

Rebuild stack

docker compose build --no-cache && docker compose up -d

For production:

docker compose -f docker-compose.prod.yml restart

5. Accessing PteroCA

Environment
URL
Description

Development

http://localhost:8000

PteroCA web interface

Production

http://localhost

PteroCA production instance

phpMyAdmin (dev only)

http://localhost:8080

Database management

📌 Note: phpMyAdmin is disabled in production for security reasons.


6. PteroCA Plugin for Pterodactyl

Read more about Pterodactyl Configuration and PteroCA Plugin for Pterodactyl here.

Installing the Pterodactyl plugin is required, and without it, some PteroCA features will not be available. The PteroCA Plugin for Pterodactyl provides functionalities such as access to the server console, editing server variables directly from the server management panel, SSO Login, and more.


7. Cloudflare & CSRF Configuration

If your instance runs behind Cloudflare or any proxy, additional configuration may be required to avoid CSRF and host validation issues.

Follow the instructions here: 👉 CSRF & Cloudflare Configuration


8. Troubleshooting

Issue
Cause
Solution

Docker daemon not running

Docker service inactive

systemctl start docker

Port conflict on 80/8000

Another web server is active

Stop Apache/Nginx or change ports

phpMyAdmin inaccessible

Production mode

Use dev mode (--environment dev)

Permission denied in uploads

Host volume ownership

Run docker compose exec web chown -R www-data:www-data /app/public/uploads

Cloudflare redirect errors

Missing trusted hosts

Adjust TRUSTED_PROXIES and TRUSTED_HOSTS in .env

Last updated