Today I will walk you through the steps to host a WordPress Website on Alibaba Cloud for free. I will show you everything you need to do to get a new WordPress website set up on Alibaba cloud.
The steps for hosting a WordPress website on Alibaba cloud are very easy, you just need a little bit of time and your website will be up and running.
Why Host WordPress on Alibaba Cloud?
Because it’s free and fast!! You get a slice of 1 core CPU, 1Gb memory that you can increase later, and 40Gb of storage for the website files, that’s more than enough for a new low traffic blog, or a moderate traffic blog.
Instead of paying hundreds of dollars on web hosting you can host your website for free for 1year on Alibaba cloud, and once your website becomes successful you can move to another host or just stick to Alibaba cloud. Cloud is very cheap compared to other types of web hosting, you only pay for what you use.
You can easily run a high-traffic blog that gets 2-3k visitors per day on Alibaba cloud for just 5$ a month.
Register in Alibaba Cloud
Okay, so now let’s get started, to begin we will need to first create a free trial account on Alibaba cloud, to sign up for the free trial of Alibaba cloud, click on this link – https://www.alibabacloud.com/free, you can also search on google for “Alibaba free trial” in case the link changes.
On the Alibaba free trial page click on the “Get started for Free” button, this will redirect you to the sign-in page, in the sign-in page click on the “Register Now” link at the bottom right.
On the signup page, you will need to select “individual account” and click on next, after that you will need to enter your email address and create a very secure password that contains a capital letter, symbol, and number. Confirm the password and click on sign up.
On the next page, you will need to select your country and verify your phone number, you can verify using your phone number or your email address, whatever you feel comfortable with. I recommend you to verify using your phone number.
Click on “Send Message” which will send you a verification code on your phone number or email, enter it in the signup page, agree to the agreement and click on Sign Up once again to create an Alibaba Cloud Account.
After this your Alibaba cloud account will be created, now you will need to Enter some basic information about you, like name, address, postal code, and phone number. Select Individual Account at the top.
Enter your phone number and click on verify, you will get a verification code at the phone number provided, enter it and verify your phone number again, after that click on submit.
Now in the Payment Information tab, you will need to provide your payment info, the payment method will be different for different countries, if it asks for a credit card then provide it there, don’t worry you won’t be charged a cent for it, payment info is asked to prevent spam accounts.
After providing your payment info, you will automatically get redirected to the confirmation page of Alibaba cloud, click on “Free Trial” to start the activation process of the free trial of Alibaba Cloud.
Create ECS Instance in Alibaba Cloud
After clicking on Free Trial you will be redirected to the free trial page of Alibaba cloud, here scroll down a little and select the products that you want to use.
If you just want to host a simple WordPress blog with low to medium traffic then just select the Burstable t5, 1 core CPU, 1Gb memory, 40Gb SSD storage which will give you a trial period of 12months, meaning that you host your low to medium traffic website free for 12 months.
You can also use the Burstable t6/t5, 2 core CPU, 2Gb memory which is more powerful and can handle high traffic, but the problem with this is that the trial period will only be 3months for this, so better choose the 1 core CPU one with 12 months.
Just select it and click on “Try Now”, after which you will now need to set up the server aka ECS, you will need to first select the Data server region, select the server which is closest to your customers, in “operating system” select “WordPress on LAMP Ubuntu 16”.
If you want you can also select a different operating system like Ubuntu 18.04, but remember that you will set up WordPress manually using the terminal if you do that, I recommend you to just use the WordPress LAMP which automatically does everything for us.
After selecting your data center and operating system, accept the Terms and conditions and click on Try now. This will automatically set up a WordPress ECS instance for you.
If you get any error like “Sorry you have already tried the instance” or something then don’t worry and go to your Alibaba Cloud Console from the top-right menu, then go to Elastic Compute Service (ECS) from the top left corner menu, then go to “Instances”.
There you will see your WordPress instance.
Change Disk Image
Now after creating an ECS instance you will need to change the disk image of your instance. To do that first go to your console>Elastic compute service>Instances. Here select your instance and click on STOP at the bottom.
Select Force stop, and also check the “Proceed to forcibly stop” option and click on OK, this will stop the instance, this might take a few minutes, keep refreshing the page until the status says “Stopped”.
Once the instance stops, select the instance once again, and below click on the More button, after that select Disk & Image > Replace System Disk. Click on OK on the popup.
After that, you will be in the operating system settings where to change the disk image of your instance you will need to click on MarketPlace Image then “Select from Image Market”.
That will open up the Marketplace, In the search bar you will need to search for “WordPress”, which will bring up a lot of different options, the WordPress image that you will need to select is the “WordPress on LEMP CentOS7.2 64 bits powered by IGS”. Click on USE to continue.
After that scroll down and in Security settings, click on Password and enter a secure password, confirm it, and accept the Terms of service below. Click on Create Order to continue the payment, it’s free so no need to pay anything, just finish the purchase and once the purchase completes, go back to your console.
Configure Security Groups
Now the last thing to do before we can access our WordPress website is to configure security groups. To configure Security groups go to your console and then go to “Network & Security” by clicking on the top left menu, after that in Network & Security go to “Security groups”.
Here click on “Add rules” on the right side of your Instance, Click on “Quick rule Creation” to add a new rule.
In Common Port (TCP) check “http”, in Custom Port range enter “21/22”, in Authorization Object enter “0.0.0.0/0” and click on OK to add that rule.
Again click on Quick rule creation and add another rule, this time in Common Port check “https” in Custom Port enter “31/32” and in Authorization Object enter “0.0.0.0/0”, click on OK to add that rule, once done go back to Instances.
Now here in Instances check if the status of your WordPress Instance is Running or not, if it’s not running then select the instance and click on start to start it.
Doesn’t matter if the instance was running or not, you will have to restart the instance to proceed, select the instance and click on restart. Once done you can now proceed to set up the WordPress website.
Setup WordPress
To set up your WordPress site hosted on Alibaba cloud free tier you will need to copy the Internet IP address of the Instance. Copy it and paste it into a web browser.
You will need to configure your WordPress installation, select your language, and click on continue. Give your website name, username, a secure password, your email, make sure to remember the password and username because you will need it to log in to your WordPress website.
Once done click on Install WordPress, after the installation finishes click on Log In and log in to your WordPress website using the provided username and password.
Add a Custom Domain
Okay so, now let’s see how we can connect a custom domain like yourdomain.com instead of the IP Address of the Server. Because an IP address is not easy to remember and also not professional for a WordPress blog.
You can add a custom domain to your WordPress website hosted on Alibaba cloud using two methods, the first is directly from your domain registrar and the second one is by using Cloudflare (which is recommended).
By using your domain registrar
To add a custom domain to your Alibaba cloud-hosted website you will need to first log in to your domain registrar dashboard from where you bought your domain name. Hereafter logging in, select your domain name and go to its DNS settings.
In DNS settings you will need to add a new “A” record, the name field will be “@” and the value will be the IP Address of your Alibaba cloud instance. After that add another record which will be a CNAME.
The name field will be “www” and the value will be your domain name. After adding both these values you will need to wait a few minutes to a few hours depending upon how fast the DNS propagates, once it does then you can access your website through the domain name instead of its IP address.
By Using Cloudflare
If you have Cloudflare connected to your domain then you can use Cloudflare to add a custom domain to your WordPress website hosted on Alibaba Cloud. If you don’t have Cloudflare connected to your domain then here are the steps to add Cloudflare –
- Create an account at https://dash.cloudflare.com/sign-up, add your domain name and complete the rest of the steps.
- Add Cloudflare nameservers to your DNS Settings by going to your domain provider, select your domain name and go to its Nameservers settings, remove the default nameservers and add the ones given by Cloudflare.
- Wait for the DNS Propagation to finish.
Okay so once Cloudflare is connected to your domain, go to the DNS settings in your Cloudflare dashboard, here add an A record with the name “@” and value the IP address of your Alibaba cloud instance.
After that add a CNAME with the name “www” and value your domain name, that’s it your website will be now connected to a custom domain.
The plus point of using Cloudflare is that it gives you free CDN and DDOS protection and also hides the real IP address of your website.
Add SSL to Alibaba Cloud Hosted Website
To add an SSL certificate to your Alibaba cloud-hosted WordPress website you can use Cloudflare that provides you with free SSL. To enable the SSL certificate login to your Cloudflare dashboard.
In the dashboard of Cloudflare go to SSL/TLS tab and make the SSL setting to “Flexible” this will serve your website with HTTPS to the users, after that you will need to redirect all the users using HTTP to HTTPS.
To redirect everyone using HTTP to HTTPS you will need to go to SSL/TLS tab and then go to the Edge Certificates tab, here scroll down and find Always Use HTTPS, enable it and all your users using HTTP will now get redirected to HTTPS.
Fix WordPress Asking for FTP details Alibaba Cloud
After installing WordPress on Alibaba cloud if you are trying to install a plugin or a theme and WordPress asks for your FTP username and password then here’s how you can fix it.
Using Plugin –
First, log in to your WordPress admin and go plugins, click on Add New and search for “File Manager” click on install, this will ask you for your FTP details, you can get it by logging in to your Alibaba Cloud Console.
Go to your instances and copy your IP address, go back to your WordPress dashboard, and in the FTP hostname enter “sftp://your_ip_address” or “your_ip_address”, in username enter “root” and in the password enter the password that you gave when changing disk image.
After that click on proceed and install the plugin, once the plugin is installed open it, in the file manager look for “wp-config.php”, right-click on it, and select edit. After that enter the PHP codes from below in the wp-config file below “define (‘DB COLLATE’)”.
define(“FTP_HOST”, 'ftp.yourhost.com');
define(“FTP_USER”, 'root');
define(“FTP_PASS”, 'password');
define('FS_METHOD', 'direct');
define('FTP_BASE', '/data/wwwroot/default/');
define('FTP_CONTENT_DIR', '/data/wwwroot/default/wp-content/');
define('FTP_PLUGIN_DIR ', '/data/wwwroot/default/wp-content/plugins/');
Here, ftp.yourhost.com will be “sftp://your_instance_ip_address”, username and password would be the one from the disk image change step. Add all these to the wp-config file and save it.
Go back to your Alibaba Cloud instance and restart it to see changes, also refresh your website.
Using FileZilla –
To fix the problem using FileZilla you will need to first connect to your FTP server using Filezilla, in hostname enter the IP address of your Alibaba cloud instance, in username enter root, and in password enter the password set during disk image change. Click Connect.
After connecting to the server, go to the file path at – /data/wwwroot/default
Inside this file path, you will need to find wp-config, download it, and using note editor add the codes given above in the article. Save it and upload it back to the server.
Restart the Alibaba Cloud instance to save the changes.
Change WordPress URL & Site Address
One final thing left to do is to change the WordPress Address and Site Address, as the default URL will be the IP address instead of your domain name.
To change your url go to your wordpress admin and then go to settings > General. Here remove the IP Address and enter your domain name.
PHP version Not Supported
Okay so this is something that you might face if you install WordPress on Alibaba cloud, you will be unable to install some plugins due to an unsupported version of PHP. To fix this problem you will need to update the PHP of your server.
You can see this tutorial on how you can update PHP – https://www.digitalocean.com/community/questions/how-to-update-nginx-php.
You can connect to your Alibaba cloud instance by ssh or by using putty.
That’s it, that is how you can host a WordPress website on Alibaba cloud for free, the free trial of Alibaba cloud will last for 12 months, so enjoy your free WordPress hosting for one year. Thank you for reading.
FAQ –
How much traffic does a WordPress Website hosted on Alibaba Cloud Free tier Handle?
A WordPress website that is hosted on Alibaba Cloud free trial can handle at least 1500 to 3000 users per day with proper caching and optimization. If you use a CDN for both images and static resources then the website can easily handle more than 3000+ visitors per day.