WHMCS - Dokploy
📚 About
This is a ready to use docker compose for Dokploy compose service demployment. You only need to follow instructions below for installation and deployment of WHMCS in Dokploy.
🧰 Getting Started
Dokploy docker compose uses the same docker images as the regular install. You are required to complete essentialy the same steps with difference being Dokploy. If you are confused about any of non Dokploy related steps, check out the main README for more detailed explanations.
Requirements
- Domain
- Valid WHMCS license
- Working instance of Dokploy
🏗️ Installation
- Navigate to
Create service > Composefill out name, select server, etc. - Navigate to tab
Rawand copy / paste the contents ofwhmcs-dokploy/docker-compose.yml, clickSave - Navigate to
Environmenttab and copy / paste the contents ofwhmcs-dokploy/.env. Fill out all of the variables. You can changeTRAEFIK_SUBNETlater on. ClickSave - Navigate to
Domainstab, clickAdd Domain(your domain has to be pointing at the IP of server you selected earlier when creating service). Select these values:
| Field | Value |
|---|---|
| Service name | nginx |
| Container port | mysql |
| HTTPS | Let's Encrypt |
- Navigate to
Advancedtab, scroll down toEnable Isolated Deployment. Toggle this option on and clickSave Deploythe service- Navigate to domain you selected in your browser and do the initial installation
| Field | Default value |
|---|---|
| License Key | Found in whmcs.com |
| Database Host | mysql |
| Database Username | whmcs |
| Database Password | Found in Environment tab |
| Database Name | whmcs |
- Once you reach screen asking you to delete
installdirectory. Navigate toTerminalin Dokploy (make sure nginx is selected), select/bin/shand run this command:
sh -lc '/usr/local/bin/whmcs-post-install-config.sh'
- Go back to your browser and refresh the page, now you should be able to login
- Complete the rest of post-installation steps below
Post-installation steps
Setting correct TRAEFIK_SUBNET
Navigate to System Logs > Admin Log and you'll see your IP Address. It should look something like 172.18.0.2 or similar. We're interested in the second number. So if the IP shown was 172.18.0.2 the subnet that should be set as: 172.18.0.0/16. Restart and check the logs again, this time your real IP should be displayed.
Setting update folder
Official source: help.whmcs.com
Setting update folder will allow you to automatically update WHMCS in the future. Similar to file storage the update folder will be located above the web root inside whmcs_storage directory.
Navigate to Automation Status (gear icon) > Update WHMCS > Configure Update Settings and set the directory to /var/www/whmcs_storage/whmcs_updater_tmp_dir
Moving Files Above Web Root
Moving files above web root is a recommended practice by official WHMCS documentation. This is fairly easy to do using docker volumes.
The volume whmcs_storage is used for this exact purpose, directories have been already created so all you need to do is change them in the admin panel.
File Storage
Official source: docs.whmcs.com
Navigate to System Setting > Storage Settings under Configurations add listed local storage:
| Path |
|---|
| /var/www/whmcs_storage/downloads |
| /var/www/whmcs_storage/attachments |
| /var/www/whmcs_storage/attachments/projects |
Navigate to Settings tab and replace the old paths with the newly added ones.