Guys today I am going to tell you how to host a website on free Amazon AWS or Google cloud compute or digital ocean. All these three sites give free hosting with some limitation. In Amazon AWS you get 1 core vcpu 1gb ram and 30gb SSD. Google cloud gives free 300USD credit and if you use 2vcpu 2gb ram 15gb SSD it will take 9-10 months to consume the data. I have not tried Digital ocean, but I have heard that they give 100USD credit.
Now lets Start.
Creating an EC2/VM instance
Select 16.04 LTS image file 25Gb for amazon aws and 10-15 GB SSD in google cloud.Capture.JPG
Assigning Static IP
Search 'external ip and change the VM ip from dynamic to static. This is necessary otherwise ip may change after some time or restart.
Setting up Virtualmin
Virtualmin is a free cpanel alternative with similar features. We will use them as they are most preferred after cpanel.
Now go to ssh panel and type the following commands one by one, if prompted type y in all situation. Click on SSH in cloud compute vm instances, and a terminal will open.
sudo wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh
This will install Virtualmin. It will take 10 minutes approx. If there is any query on terminal use default or yes.
Creating a password for user "root"
sudo su
sudo passwd root
Now the terminal will ask for the password. Keep it ready and a strong one. Use control + V to paste the password. (Password will not show on the terminal, type CTRL +v twice to confirm the password
Now your site is active type https://externalip:10000. And your Virtualmin terminal will open. Use user root and its password to log in. (ignore self-signed security warning). A configuration wizard will open extra feature depend on your need. ( all the options are optional except mysql)
Pointing the domain
Visit ur domain registrar and add 'A' record in DNS management as follows
(Blank).Domain.com - IPV4 = external ip
Mail.domain.com - IPV4 = external ip
www.domain.com - IPV4 = external ip
(It will take 10-15 min to update A record)
alternatively, you can use DNS zone of google cloud
create aliases in DNS zone in google cloud compute
as mail, www. and point it to your external ip.
Now you can go to your site through the domain name.
Migration of your site
If you are starting a site, you can install WordPress and can go on blogging. If you are migrating then follow these steps.
Now you need to do everything through Virtualmin panel
Create a server - put in your domain name - put everything as such,
Generate ssl certificate through let's encrypt(already installed)
Configure php to upload bigger size DB(default is 2mb only)
Install phpmyadmin through script installer. Visit your domain/phpmyadmin and log in using DB name and password generated in the configuration wizard. Now import your DB. (if DB is single file and gives warning try to create a DB backup where all its tables are separate and upload one by one, most of the time wp_options are very big, unnecessary and corrupted)
Now upload your public HTML file using file manager and extract it in home/domain/public_html/.
Edit new DB name, DB username, and DB password in wp_config.php. Now your site is live as it was earlier.
Amazon Aws is also similar.
Now lets Start.
Creating an EC2/VM instance
Select 16.04 LTS image file 25Gb for amazon aws and 10-15 GB SSD in google cloud.Capture.JPG

Assigning Static IP
Search 'external ip and change the VM ip from dynamic to static. This is necessary otherwise ip may change after some time or restart.
Setting up Virtualmin
Virtualmin is a free cpanel alternative with similar features. We will use them as they are most preferred after cpanel.
Now go to ssh panel and type the following commands one by one, if prompted type y in all situation. Click on SSH in cloud compute vm instances, and a terminal will open.
sudo wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh
This will install Virtualmin. It will take 10 minutes approx. If there is any query on terminal use default or yes.
Creating a password for user "root"
sudo su
sudo passwd root
Now the terminal will ask for the password. Keep it ready and a strong one. Use control + V to paste the password. (Password will not show on the terminal, type CTRL +v twice to confirm the password
Now your site is active type https://externalip:10000. And your Virtualmin terminal will open. Use user root and its password to log in. (ignore self-signed security warning). A configuration wizard will open extra feature depend on your need. ( all the options are optional except mysql)
Pointing the domain
Visit ur domain registrar and add 'A' record in DNS management as follows
(Blank).Domain.com - IPV4 = external ip
Mail.domain.com - IPV4 = external ip
www.domain.com - IPV4 = external ip
(It will take 10-15 min to update A record)
alternatively, you can use DNS zone of google cloud
create aliases in DNS zone in google cloud compute
as mail, www. and point it to your external ip.
Now you can go to your site through the domain name.
Migration of your site
If you are starting a site, you can install WordPress and can go on blogging. If you are migrating then follow these steps.
Now you need to do everything through Virtualmin panel
Create a server - put in your domain name - put everything as such,
Generate ssl certificate through let's encrypt(already installed)
Configure php to upload bigger size DB(default is 2mb only)
Install phpmyadmin through script installer. Visit your domain/phpmyadmin and log in using DB name and password generated in the configuration wizard. Now import your DB. (if DB is single file and gives warning try to create a DB backup where all its tables are separate and upload one by one, most of the time wp_options are very big, unnecessary and corrupted)
Now upload your public HTML file using file manager and extract it in home/domain/public_html/.
Edit new DB name, DB username, and DB password in wp_config.php. Now your site is live as it was earlier.
Amazon Aws is also similar.
Last edited: