Installing WHMCS on a dedicated server involves several steps, from preparing your server environment to configuring the software. Here’s a step-by-step guide to help you install WHMCS:
1. Prepare Your Server
- Operating System: Ensure your server has a compatible OS, typically CentOS, Ubuntu, or Debian.
- Web Server: Install a web server like Apache or Nginx.
- PHP: Install PHP (7.2 or higher) along with required extensions like
pdo
,json
,curl
,mbstring
, andgd
. - MySQL/MariaDB: Set up a MySQL or MariaDB database server.
2. Download WHMCS
- Purchase a License: Purchase a WHMCS license from whmcs.com or use a reseller.
- Download the WHMCS Files: Log in to your WHMCS account and download the latest version of WHMCS.
3. Upload WHMCS to Your Server
- Upload Files: Use an FTP client like FileZilla to upload the WHMCS files to your server. Place them in the web root directory, e.g.,
/var/www/html/whmcs
for Apache. - Extract Files: If you uploaded a compressed file, SSH into your server and extract it:
bash
cd /var/www/html/whmcs
unzip whmcs_vX.X.X.zip
- Set Permissions:
bash
chown -R www-data:www-data /var/www/html/whmcs
chmod 755 /var/www/html/whmcs
Replace
www-data
with your web server user if different.
4. Create a MySQL Database
- Log in to MySQL:
bash
mysql -u root -p
- Create Database and User:
sql
CREATE DATABASE whmcsdb;
CREATE USER 'whmcsuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON whmcsdb.* TO 'whmcsuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
5. Run the WHMCS Installer
- Access the Installer: Navigate to
http://yourdomain.com/whmcs/install
in your web browser. - License Agreement: Accept the license agreement to proceed.
- System Requirements Check: The installer will check if your server meets the requirements. Resolve any issues if needed.
- Database Configuration: Enter the database name, username, and password you created earlier.
- Admin Account Setup: Create an admin account by entering the required details.
- Finish Installation: Follow the on-screen instructions to complete the installation.
6. Post-Installation Tasks
- Remove Installation Directory:
bash
rm -rf /var/www/html/whmcs/install
- Set Up Cron Jobs: WHMCS requires cron jobs to perform automated tasks. Edit your crontab:
bash
crontab -e
Add the following line (adjust the path if needed):
bash
*/5 * * * * php -q /var/www/html/whmcs/crons/cron.php
7. Configure WHMCS
- Log in: Access the WHMCS admin panel at
http://yourdomain.com/whmcs/admin
. - Configure General Settings: Set up your company details, payment gateways, and other necessary configurations.
- Set Up Products and Services: Define your hosting packages, domain pricing, and other products.
- Email Configuration: Set up email templates and SMTP settings for sending notifications.
8. Secure Your Installation
- SSL Certificate: Ensure your WHMCS installation is secured with an SSL certificate.
- Change Admin Directory: For security reasons, rename the
admin
directory to something unique. - Enable Two-Factor Authentication (2FA): Enable 2FA for added security on admin accounts.
9. Test Your Installation
- Test Payments: Perform test transactions to ensure your payment gateways are working correctly.
- Test Automation: Test automation tasks like account creation, suspension, and termination.
After completing these steps, WHMCS should be fully functional on your dedicated server, allowing you to manage your web hosting business effectively.