This is a comprehensive guide for installing WHMCS on Linux servers using the Plesk control panel. Even though we have tried to keep it simple, it covers system preparation, installation, security hardening, and integration with Plesk for automated hosting management. Before moving to your production environment, please test this in a dev environment.
Critical Installation Notes
- Never install WHMCS on the same Plesk server that it will manage. Resellers on our platform can have a reseller account in a specific region, but create accounts in other regions.
- You can use a dedicated server/VPS for WHMCS installation. See pricing for Amazon Lightsail VPS or normal Cloud VPS.
- Our Linux server are configured to meet all system requirements before proceeding. If outside of the WebHostingM platform, ensure that yours does too.
System Requirements
Component | Required |
---|---|
Operating System | Linux (CentOS 7/8, Ubuntu 20.04/22.04) |
Web Server | Apache 2.4+ with mod_rewrite |
PHP Version | PHP 8.1 or 8.2 |
MySQL Version | MySQL 8.0+ |
PHP Extensions | curl, gd, imap, json, mysqli, xml, intl |
1. Preparation Steps
Domain Setup in Plesk
- Log into the Plesk control panel
- Navigate to Domains > Add Domain
- Create a new subscription (e.g., billing.yourdomain.com)
- Enable SSL using Let's Encrypt via SSL It! extension
PHP Configuration
# In Plesk panel: 1. Go to Domains > billing.yourdomain.com > PHP Settings 2. Set PHP version to 8.2 3. Enable required extensions: - curl - gd - imap - json - mysqli - xml - intl - soap - mbstring
Database Creation
# Via Plesk CLI plesk bin database --create whmcs_db -domain billing.yourdomain.com -type mysql
Or via Plesk Panel:
- Domains > billing.yourdomain.com > Databases
- Add Database
- Name: whmcs_db
- Click OK
2. WHMCS Installation
Download and Extract WHMCS
# Connect via SSH cd /var/www/vhosts/billing.yourdomain.com/httpdocs/ wget https://releases.whmcs.com/v2/pkgs/whmcs-8.10.1-release.1.zip unzip whmcs-8.10.1-release.1.zip rm whmcs-8.10.1-release.1.zip
Set File Permissions
# Set base permissions find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; # Set specific permissions chmod 777 templates_c attachments downloads chmod 400 configuration.php (update this permission when installing or activating your WHMCS license)
3. Security Configuration
Move Sensitive Directories
# Move directories outside web root mv /var/www/vhosts/billing.yourdomain.com/httpdocs/templates_c/* /var/www/vhosts/billing.yourdomain.com/whmcs/templates_c/ mv /var/www/vhosts/billing.yourdomain.com/httpdocs/attachments/* /var/www/vhosts/billing.yourdomain.com/whmcs/attachments/ mv /var/www/vhosts/billing.yourdomain.com/httpdocs/downloads/* /var/www/vhosts/billing.yourdomain.com/whmcs/downloads/ mv /var/www/vhosts/billing.yourdomain.com/httpdocs/crons /var/www/vhosts/billing.yourdomain.com/whmcs/
Update Configuration
# Edit configuration.php vim /var/www/vhosts/billing.yourdomain.com/httpdocs/configuration.php # Add these lines: $templates_compiledir = '/var/www/vhosts/billing.yourdomain.com/whmcs/templates_c'; $attachments_dir = '/var/www/vhosts/billing.yourdomain.com/whmcs/attachments'; $downloads_dir = '/var/www/vhosts/billing.yourdomain.com/whmcs/downloads'; $crons_dir = '/var/www/vhosts/billing.yourdomain.com/whmcs/crons';
4. Cron Job Configuration
via Plesk Panel:
- Tools & Settings > Scheduled Tasks
- Add Task
- Run:
/usr/bin/php -q /var/www/vhosts/billing.yourdomain.com/whmcs/crons/cron.php/pre>
- Schedule: */5 * * * *
crontab -e */5 * * * * /usr/bin/php -q /var/www/vhosts/billing.yourdomain.com/whmcs/crons/cron.php
5. Plesk Integration
- Log into WHMCS admin panel (https://billing.yourdomain.com/admin)
- Navigate to Setup → Products/Services → Servers
- Add New Server:
- Name: Plesk Main Server
- Hostname: server.yourdomain.com
- Type: Plesk
- Username: Admin username
- Password: Admin password
- Secure: Yes (use SSL)
6. Final Configuration Steps
PHP Settings in Plesk
# In PHP Settings: session.save_path = /var/www/vhosts/billing.yourdomain.com/whmcs/sessions date.timezone = UTC memory_limit = 256M max_execution_time = 300
Cleanup
# Remove installation files rm -rf /var/www/vhosts/billing.yourdomain.com/httpdocs/install/ # Verify permissions chmod 400 /var/www/vhosts/billing.yourdomain.com/httpdocs/configuration.php find /var/www/vhosts/billing.yourdomain.com/whmcs/ -type d -exec chmod 755 {} \;
Common Issues and Solutions
Permission Errors
# Reset permissions if needed chown -R psaserv:psaserv /var/www/vhosts/billing.yourdomain.com/ find /var/www/vhosts/billing.yourdomain.com/httpdocs -type f -exec chmod 644 {} \; find /var/www/vhosts/billing.yourdomain.com/httpdocs -type d -exec chmod 755 {} \;
Database Connection Issues
# Verify MySQL service systemctl status mysql # Check database permissions plesk bin database --list-user-privileges -domain billing.yourdomain.com
Maintenance Best Practices
- Configure daily backups through Plesk Backup Manager
- Monitor error logs in /var/www/vhosts/billing.yourdomain.com/logs/
- Regularly update WHMCS through the admin panel
- Keep Plesk and all PHP extensions updated