Docker cPanel COMPLETED

Technical summary

Infrastructure project to run a full cPanel/WHM instance inside Docker on AlmaLinux 8. The implementation targets development and integration scenarios and focuses on three practical failure points: reliable systemd behavior in containers, persistent cPanel core state, and lower bootstrap failure rate during installer execution.

Executed scope

  • Built a Docker Compose runtime using privileged container mode for cPanel internal service compatibility.
  • Applied required Linux capabilities (NET_ADMIN, SYS_ADMIN, SYS_RAWIO) to avoid low-level service failures.
  • Implemented named-volume persistence to preserve installation state across container recreation.
  • Added bootstrap strategy to inject required dependencies (wget, perl, network-scripts) before installer flow.
  • Parameterized runtime through .env for hostname, ports, credentials, CPU, and memory limits.
  • Enabled /usr/local/cpanel host-side mirroring for real-time plugin/core editing without docker cp loops.

Operational architecture

  • Container base image: AlmaLinux 8.
  • Orchestration layer: Docker Compose.
  • Persistence:
  • - cpanel_core volume for /usr/local/cpanel; - auxiliary volumes for durable config/data.

  • Access model:
  • - mapped cPanel/WHM ports; - dedicated SSH port for technical administration.

Initial configuration (.env)


CONTAINER_NAME=cpanel-server
HOSTNAME=srv.domain.com
ROOT_PASSWORD=YourStrongPasswordHere

SSH_PORT_HOST=22028
SSH_PORT_CONTAINER=22028
CPANEL_SSL_PORT=2083
CPANEL_NON_SSL_PORT=2082
WHM_SSL_PORT=2087
WHM_NON_SSL_PORT=2086
HTTP_PORT_HOST=8080
HTTPS_PORT_HOST=8443
HTTP_PORT_CONTAINER=80
HTTPS_PORT_CONTAINER=443

CPU_LIMIT=2.0
MEM_LIMIT=4G
MEM_RESERVATION=2G

TIMEZONE=America/Sao_Paulo
LANG=C.utf8

Practical execution


# start environment
docker-compose up -d

# manual cPanel reinstall when needed
docker exec -it cpanel-server bash -c "cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest"

Real-time development workflow


# local development workspace
mkdir -p /home/cpanel/dev

# symlink to cPanel core Docker volume
ln -s /var/lib/docker/volumes/NOME_DO_DIRETORIO_cpanel_core/_data /home/cpanel/dev/core

This setup reflects host-side edits directly inside the running container and shortens plugin integration cycles.

Security and hardening limits

  • Runtime uses privileged: true; recommended scope is dev/lab/testing only.
  • External exposure requires reverse proxy and additional host-level hardening.
  • Immediate root password rotation after first WHM access is mandatory.

Stack and tooling

  • Docker Compose
  • AlmaLinux 8
  • cPanel/WHM
  • Containerized systemd
  • Docker named volumes

Operational tags

  • Docker
  • cPanel
  • AlmaLinux
  • Systemd
  • Dev Environment

Operational outcome

  • Reproducible lab for cPanel plugin validation without dedicated physical server dependency.
  • Reduced setup time for integration tests and installer troubleshooting.
  • Higher change predictability with persistent core volume and real-time editing workflow.

GitHub progress (issues)

Real-time panel with latest repository issues.

abertas (amostra): -- fechadas (amostra): -- base: -- ultimas issues

carregando andamento...

Real results

cPanel/WHM development lab on AlmaLinux 8 containers with Docker Compose, built for plugin testing, persistent data, and reproducible systemd-compatible operations.

Architecture and organization

Execution and operations

The project follows reproducible execution flow with technical validation in production-like environments.

Screenshots

Talk about this project

Apply this implementation pattern in your environment and accelerate delivery with technical consistency.