Skip to main content

Install WHMCS

This guide explains how to install WHMCS on your VPS.

Prerequisites​

  • Linux VPS with minimum 2 GB RAM
  • Valid WHMCS license
  • PHP 8.1+
  • MySQL/MariaDB
  • Web server (Nginx or Apache)

Installation​

1. Prepare the environment​

sudo apt update
sudo apt install nginx php8.1-fpm php8.1-{mysql,curl,gd,mbstring,xml,zip,intl,bcmath,imap} mariadb-server unzip -y

2. Create the database​

sudo mysql -u root -p
CREATE DATABASE whmcs;
CREATE USER 'whmcs_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON whmcs.* TO 'whmcs_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

3. Download WHMCS​

Download WHMCS from your WHMCS customer area and upload to your server.

sudo mkdir -p /var/www/whmcs
cd /var/www/whmcs
sudo unzip whmcs_*.zip
sudo chown -R www-data:www-data /var/www/whmcs
sudo chmod -R 755 /var/www/whmcs

4. Nginx configuration​

server {
listen 80;
server_name yourdomain.com;
root /var/www/whmcs;
index index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

5. Web installation​

Access http://yourdomain.com/install and follow the wizard.

warning

Delete the /install folder after installation.