A complete Docker-based development environment for WHMCS with PHP 8.2, Apache, ionCube Loader, MariaDB, and MailHog. Perfect for developing addons, gateways, server modules, hooks, and templates.
- PHP 8.2 + Apache with all required extensions
- ionCube Loader (automatically installed)
- MariaDB 10.6 database
- MailHog for capturing outbound emails (no real emails sent)
- Live reload - edit code locally, refresh browser
- Works on Apple Silicon (M1/M2/M3) via emulation
- No host dependencies - everything runs in Docker
-
Clone this repository:
git clone https://github.com/Askedio/docker-whmcs.git cd docker-whmcs -
Update docker-compose.yml to use Docker Hub image:
Edit
docker-compose.ymland change thewhmcsservice:whmcs: platform: linux/amd64 # Use pre-built image from Docker Hub image: gcphost/whmcs:latest # Comment out the build section # build: # context: ./web # dockerfile: Dockerfile
-
Add your WHMCS files:
# Extract your WHMCS ZIP file into the whmcs/ directory # The whmcs/ directory should contain index.php, admin/, modules/, etc. mkdir -p whmcs # Then unzip your WHMCS download into ./whmcs
-
Start the stack:
docker compose up -d
-
Access WHMCS Installer:
Open http://localhost:8080/install in your browser to begin the WHMCS installation.
Database Connection Settings (use these during installation):
- Database Hostname:
db - Database Name:
whmcs - Database Username:
whmcs - Database Password:
whmcs
You'll also need your WHMCS license key during the installation process.
MailHog UI: http://localhost:8025 (view captured emails)
- Database Hostname:
If you prefer to build the image yourself:
-
Clone and prepare:
git clone https://github.com/Askedio/docker-whmcs.git cd docker-whmcs mkdir -p whmcs # Extract your WHMCS ZIP into ./whmcs
-
Build and start:
docker compose build docker compose up -d
-
Access WHMCS Installer:
Open http://localhost:8080/install in your browser.
Database Connection Settings:
- Database Hostname:
db - Database Name:
whmcs - Database Username:
whmcs - Database Password:
whmcs
You'll also need your WHMCS license key during installation.
- Database Hostname:
- Docker and Docker Compose
- A WHMCS license key (get a free dev license from your WHMCS account)
- WHMCS installation files (download from WHMCS client area)
You need a valid WHMCS license to use this environment.
WHMCS will not run without a license key. If you have an active WHMCS license, you can usually generate a free "development" license from your WHMCS account that works with local/non-public URLs.
This Docker setup works on:
- Apple Silicon Macs (M1/M2/M3) - via x86_64 emulation
- Intel Macs - native
- Linux (x86_64/AMD64) - native
- Windows (WSL2 or Docker Desktop) - native
The docker-compose.yml is configured with platform: linux/amd64 on all services, which:
- Enables ionCube compatibility (ionCube only supports x86_64)
- Works seamlessly on Apple Silicon via Docker's built-in emulation
- Works natively on Intel/AMD systems
No special configuration needed - run docker compose up on any platform.
You place your WHMCS files locally in the whmcs/ directory:
- Download WHMCS from your WHMCS client area
- Extract the ZIP file into the
whmcs/folder:cd docker-whmcs mkdir -p whmcs # Extract your WHMCS ZIP so that whmcs/index.php exists
- The files are bind-mounted into the container (see line 34 in
docker-compose.yml:./whmcs:/var/www/html) - Edit files locally and see changes immediately - no rebuild needed.
The whmcs/ directory is gitignored, so your WHMCS installation files stay private and aren't committed to the repository.
docker-whmcs/
├── docker-compose.yml # Main compose file
├── web/
│ ├── Dockerfile # PHP/Apache image with ionCube
│ └── php.ini # Development PHP settings
├── whmcs/ # YOUR WHMCS FILES GO HERE (not in repo)
│ ├── index.php
│ ├── admin/
│ ├── modules/
│ └── ...
└── README.md
This directory is where you place your WHMCS application files:
- Extract your WHMCS ZIP file into this directory
- After installation, WHMCS will generate
configuration.phphere - This folder is bind-mounted, so you can edit code locally and see changes immediately
Note: The whmcs/ directory is gitignored. You must provide your own WHMCS files.
Default database credentials (set in docker-compose.yml):
- Host:
db(use this inside WHMCS, notlocalhost) - Database:
whmcs - Username:
whmcs - Password:
whmcs - Root Password:
rootpass
You can change these in docker-compose.yml before starting.
MailHog automatically captures all outbound emails. Configure WHMCS SMTP settings:
- Host:
mailhog - Port:
1025 - No authentication
- No TLS
View captured emails at: http://localhost:8025
If your dev license requires a specific domain:
-
Add to
/etc/hosts:127.0.0.1 dev.whmcs.local -
Access WHMCS at
http://dev.whmcs.local:8080 -
Use
http://dev.whmcs.local:8080as the System URL during installation
After WHMCS is installed:
- Edit code locally in
./whmcs/modules/,./whmcs/templates/, etc. - Refresh browser - changes appear immediately (no rebuild needed)
- Check MailHog at http://localhost:8025 for test emails
- View logs:
docker compose logs -f whmcs
- Add an addon: Create
./whmcs/modules/addons/YourAddon/ - Add a gateway: Create
./whmcs/modules/gateways/yourgateway/ - Add hooks: Place files in
./whmcs/includes/hooks/ - Custom templates: Edit files in
./whmcs/templates/
All changes are live - refresh your browser to see updates.
The pre-built image is available on Docker Hub:
docker pull gcphost/whmcs:latestIf you're the maintainer and want to publish updates:
-
Build for multiple platforms:
docker buildx create --use --name multiarch docker buildx build --platform linux/amd64,linux/arm64 \ -t gcphost/whmcs:latest \ -t gcphost/whmcs:8.2 \ ./web \ --push
-
Or build and push manually:
docker build -t gcphost/whmcs:latest ./web docker push gcphost/whmcs:latest
If you see ionCube loader errors:
- Apple Silicon: Make sure
platform: linux/amd64is set indocker-compose.yml - Verify ionCube is loaded:
You should see "with the ionCube PHP Loader (enabled)"
docker compose exec whmcs php -v
- Use
dbas the hostname, notlocalhostor127.0.0.1 - Ensure the
dbservice is running:docker compose ps - Check database logs:
docker compose logs db
If you encounter file permission issues:
# Fix ownership (adjust user:group as needed)
sudo chown -R $(id -u):$(id -g) whmcs/- pdo_mysql
- gd (with JPEG support)
- mbstring
- intl
- xml
- curl
- zip
Development-friendly settings:
display_errors = Onerror_reporting = E_ALLmemory_limit = 256Mupload_max_filesize = 20Mmax_execution_time = 120
Contributions welcome. Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This Docker setup is licensed under the MIT License. See LICENSE for details.
Note: WHMCS itself is proprietary software and requires a valid license from WHMCS Ltd.
- Website: https://askedio.github.io/docker-whmcs (GitHub Pages)
- GitHub: https://github.com/Askedio/docker-whmcs
- Docker Hub: https://hub.docker.com/r/gcphost/whmcs
- WHMCS: https://www.whmcs.com/members/aff.php?aff=3256
For issues with this Docker setup, please open an issue on GitHub.
For WHMCS licensing and support, contact WHMCS directly.