Installing WordPress on cloud hosting is no simple task. Before you install WordPress you need to install several software packages like apache or Nginx, database, PHP, etc. Unless you are experienced it’s very easy to get lost on the command-line interface. And that’s not all, if any issue pops up ever, you might have to spend countless hours to fix that.
Luckily, we have a great solution to this problem. Easyengine team has made the installation of WordPress super easy. All you need is to just execute few lines of command and all the necessary package needed will get installed.
Requirements for WordPress Installation
- A domain name from Namecheap or Namesilo
- A cloud hosting from any of the service provider. You must install Ubuntu 18.04 on the server.
I will be using Contabo, Google Cloud, Oracle Cloud, and DigitalOcean for the installation.
Adding DNS Records
After the above step go to your domain registrar and create these two DNS records.
Initial Setup of Cloud
First of all, you need to install Ubuntu 18.04 on your Linux server. Then connect to your server. If you are on Windows you will need a special SSH client called Putty, but Mac and Linux users can connect to the server from the terminal.
Switch to root user
Next, update the server with the following command
apt update && apt upgrade -y
Setting up hostname (optional)
hostnamectl set-hostname node.example.com
Installing WordPress on Cloud
After you have completed the above steps execute the following command to install necessary packages and dependencies on your server.
wget -qO ee https://rt.cx/ee4 && sudo bash ee
Before you execute the next line of command which will install WordPress, check if DNS records propagated or not, otherwise, you will get an SSL error.
The output of the above command must show the IP address of your server.
Now, it’s time to install WordPress.
ee site create example.com --type=wp --cache --ssl=le
The above command will install WordPress on your cloud with cache and let’s encrypt SSL, all in one command. But just in case if you don’t want to install Let’s Encrypt SSL or Cache then just get rid of that part in the command.
ee site create example.com --type=wp
You can also create multisite WordPress in a subdirectory using the following command.
ee site create example.com --type=wp --mu=wpsubdir --cache
Once WordPress installation finishes you will receive all the credentials to login and manage WordPress. Also, if you like to explore more feel free to check easyengine. There you will find different commands for a different purposes.
Now, log in to WordPress and start working on your dream.
If you want to migrate your WordPress from shared hosting to Cloud hosting, then you can make use of plugins like UpdraftPlus.
Fix for EasyEngine 523 error after restarting Cloud
When you restart your cloud or VPS, the WordPress website won’t come live itself. You can say it’s an inherent shortcoming of docker rather than easyengine.
Therefore, you need to start services to enable WordPress.
Run the following command as per your requirements.
cd /opt/easyengine/services/ && sudo docker-compose down && sudo docker-compose up -d
The above command will restart docker and enable all your websites.
If you want to enable only certain websites then execute the following commands
cd /opt/easyengine/sites/example.com/ && sudo docker-compose down && sudo docker-compose up -d
There are other commands as well that can help you to restart a website like below
ee site disable example.com
ee site enable example.com
Installing and Managing WordPress on cloud hosting is super easy with Easyengine.