Install on the Command Line

In addition to our other methods, you can install and upgrade WHMCS on the command line. This is useful when you provision WHMCS for multiple installations. To use this method of installation, you must first download the .zip file for the desired version of WHMCS and unzip it.

  • We only recommend this method for advanced users who are familiar with WHMCS, database management, and the command line.
  • Configuration and database issues can prevent you from using this method. Always create file and database backups before you use this method.

Install WHMCS on the Command Line

1. Purchase a license and download WHMCS.

To use WHMCS, you will need to purchase a license, either directly from WHMCS or from a reseller. Then, you will need to download the software.

If you purchased your license key directly from WHMCS:

  1. Go to WHMCS Downloads.
  2. Click Download under Full Release to download the latest release version.

Downloading the latest Full Release version for WHMCS

If you obtained your license key from a reseller and you don’t have a login for our Members Area, your reseller can provide the latest WHMCS files.

For more information about how we distribute WHMCS, see WHMCS Distributions.

2. Verify the system requirements.

You must ensure that your setup meets the system requirements for your chosen version of WHMCS.

Make certain to check:

  • The operating system and web server configuration.
  • The PHP version, configuration, and extensions.
  • The MySQL® version.
  • The ionCube Loader® version.

3. Upload the files to your server.

You will need to unzip the downloaded release file and upload it to the server that will host WHMCS. You can do this manually or using your hosting control panel’s file management tools.

Using cPanel

To upload and unzip files using cPanel:

  1. Log in to the cPanel account that will host your WHMCS installation.
  2. Go to the File Manager interface (Files » File Manager).
  3. Double-click on the public_html directory.
  4. Click Upload.
  5. Select the downloaded ZIP file and click Select File.
  6. When the upload finishes, click Go Back. You will see the newly-uploaded .zip file in the public_html directory.
  7. Right-click the .zip file and select Extract.
  8. Choose a destination, and then click Extract File(s).

Manual Upload

To do this using another upload method:

  1. Unzip the downloaded WHMCS ZIP file on your local computer.
  2. Upload the entire unzipped whmcs folder to your website. If you experience problems, try uploading the folder in binary mode.

Optionally, you can rename the folder (for example, billing).

Because the Admin Area uses an admin folder by default, you cannot use admin as the installation folder name.

4. Create a configuration file.

You can choose to either manually create your configuration.php file or you can use the -c or --config options to create a configuration file during the installation process.

If you want to use the -c or --config options, skip this step and provide the desired configuration data when you run the installation command.

To manually create your configuration file, create the configuration.php file in the main WHMCS directory and add the desired variables.

Your file should resemble the example below:

<?php
$license = "";
$db_host = "localhost";
$db_username = "";
$db_password = "";
$db_name = "";
$cc_encryption_hash = "";
$templates_compiledir = "templates_c/";
  • For help to determine the values you need, contact your hosting provider or system administrator.
  • For more information on the configuration.php file’s contents, see The configuration.php File.

WHMCS 8.7 and Earlier

We stopped including a configuration.php.new file for new WHMCS installations in WHMCS 8.8.

For WHMCS 8.7 and earlier only, in the unzipped files, find the configuration.php.new file and change the name to configuration.php.

4. Run the installation command.

The installation script uses the following syntax:

php -f bin/installer.php –- [options]

The script enables non-interactive mode (-n or --non-interactive) and performs an upgrade (-u or --upgrade) by default.

You can use these options with the installation script:

OptionDescription
-c or --configProvide configuration data in the JSON format (see Supplying Configuration Data below). Use this with the -n or --non-interactive option.
-h or --helpView help information.
-i or --installPerform a new installation.
-n or --non-interactiveDon’t require user input while the script runs.
-s or --statusProvide status information about the installation’s files and databases.
-u or --upgradeUpgrade an existing installation.
-v or --verboseRun the script with verbose output.

Supplying Configuration Data

If you use the -c or --config option, you must supply configuration data to STDIN as a single line of JSON input.

You can supply data in the following arrays:

ArrayDescription
adminAn array of account information for the initial admin account.
  • Use the username and password parameters to set a custom username and password combination.
  • If you do not supply the desired username and password, the system will generate them and display them at the end of installation.
configurationSpecify the desired configuration file variables to create a new configuration file like the example below.
  • The system creates a configuration.php file when your input contains the configuration element.
  • If you supply the configuration element and a configuration.php file already exists, an error will occur.
  • If your input doesn’t contain the configuration element, the installation process requires that a valid configuration.php file is present.
Exercise caution when you supply sensitive information on the command line.

Example

When you use the configuration element, your JSON data could resemble the following example:

#!/bin/env bash
# The following assumes the respective environment variables are
populated
CONF='{
 "admin":{
  "username":"name",
  "password":"'$ADMIN_PASS'"
 },
 "configuration":{
  "license": "'$LICENSE_KEY'",
  "db_host": "'$DB_HOST'",
  "db_username": "'$DB_USER'",
  "db_password": "'$DB_PASS'",
  "db_name": "'$DB_NAME'",
  "cc_encryption_hash": "'$ENCRYPT_HASH'",
  "mysql_charset": "utf8"
 }
}'

You would then supply this data using the following command:

echo $(echo $CONF | tr -d "\n") | php -f bin/installer.php -- -i -n -c

The encryption hash value must be 64 characters long and contain only az, AZ, and 09 ASCII values. Generate this value with a high-entropy random data source or a cryptographic password generation tool. For example:

# Example hash value generation with the OpenSSL utility
ENCRYPT_HASH=$(openssl rand -base64 128|tr -d "\n\/+="|cut -c 1-64)

Next Steps

After you complete installation, we recommend that you configure WHMCS in the following order:

  1. Review our recommended additional steps to enhance your installation’s security.
  2. Log in to the WHMCS Admin Area and complete the Setup Wizard.
  3. Configure your installation’s general settings.
  4. Set up your payment gateways.
  5. Set up your products to sell.
  6. Configure your domain pricing.
  7. Set up your support ticket departments.
  8. Set up email piping or email importing to manage email replies to support tickets.
  9. Create and configure the WHMCS cron job and its automated task settings.
  10. Place some test orders on your website.

Last modified: January 7, 2025