Building a Shared Web Hosting Business on Alibaba Cloud

Architecture Diagram

We need three Elastic Compute Service (ECS) instances, one ApsaraDB for RDS MySQL instance, and two domain names for this project. I will be using the domain as my primary domain and as my secondary domain.


  • Two ECS instances running on Ubuntu 18.04 and one ECS instance running on CentOS 7 with at least 20 GB disk space & 1 GB of RAM
  • An ApsaraDB for RDS instance running the latest version of MySQL with two databases and two user accounts
  • Two domain names

Step 1: Configure DNS

DNS configuration for our primary domain

Step 2: WHMCS Server Setup

First of all, you need to download WHMCS from their official website

scp -i path-to-ssh-key.pem root@instance-ip:/root
ssh -i path-to-ssh-key.pem root@ecs-instance-ip
ls /root
apt update
apt full-upgrade -y
apt auoremove -y
apt install unzip sendmail software-properties-common wget -y
apt install apache2 -y
systemctl enable apache2
apt install php-fpm -y
apt install php-curl php-gd php-json php-mbstring php-imap php-iconv php-dev php-mysql -y
cd /root
tar -xf ioncube*
cp ioncube/ /use/lib/php/20170718/
nano /etc/php/7.2/apache2/conf.d/10-custom.ini
max_execution_time = 60
max_input_time =60
memory_limit = 512M
max_input_vars = 6000
upload_max_filesize = 512M
post_max_size = 512M
systemctl restart php7.2-fpm
systemctl restart apache2
rm -rf /var/www/htm/index.html
vim /etc/apache2/sites-available/000-default.conf
ServerName your-primary-domain.tld
systemctl restart apache2
cd /root
mv whmcs/* /var/www/html
cd /var/www/html
mv configuration.php
chown -R www-data:www-data /var/www/html

Step 3: Deploying HTTPS for WHMCS

HTTPS protocol provides a secured encrypted connection between our servers and clients. We will install an SSL certificate from Let’s Encrypt Certificate Authority. We will use a program called certbot for automating the process of issuing SSL certificates

apt-add-repository ppa:certbot/certbot
apt update
apt install python-certbot-apache -y
certbot --apache -d portal.your-primary-domaindomain.tld
certbot renew

Step 4: Installing WHMCS

So far, we have completed all the necessary steps to install WHMCS. Now its time to start the installation process

crontab -e
*/5 * * * * /usr/bin/php -q /var/www/html/crons/cron.php
rm -rf /var/www/html/install

Step 5: Installing WordPress

Login to the another ECS instance which is running on Ubuntu 18.04 via SSH

ssh -i path-to-public-key.pem root@ecs-instance-ip
wget -qO ee && bash ee
ee site create YOUR-PRIMARY-DOMAIN.TLD \
--cache \
--type=wp \
--admin-email=YOUR WORDPRESS EMAIL \
--dbname=YOUR DB NAME \

Step 6: Installing WHM

Login to the ECS which is running on CentOS 7 via SSH

ssh -i path-to-public-key.pem root@ecs-instance-ip
yum update
echo "server.your-primary-domain.tld" > /etc/hostname
hostname -F /etc/hostname > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
cd /home
curl -o latest -L
sh latest

Step 6: Integrating WordPress and WHMCS

Login to WordPress

Step 7: Integrating WHM and WHMCS

Login to WHMCS

  • Server Type: CPanel
  • Username: root
  • API Token: Paste the token that you have copied from WHM

Step 8: Integrating PayPal with WHMCS

We will use PayPal to receive payments from our customers.


We have successfully installed and configured WHMCS, WHM & WordPress for our web hosting company. Now it is time to create your own hosting packages and start selling. If you have any questions, feel free to ask in the comment section



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website: