New bloggers are always looking to make their site load faster on shared hosting, and they know the limitations. Eventually, they want to move to a shared hosting or a managed WP hosting.
Managed WP hostings can be great, but usually they tend to be more expensive than cloud hosting (for smaller blogs), and they still come with some limitations (file size, restricted plugins, etc.)
DigitalOcean can be a great cloud hosting platform. It is cheaper and more user-friendly than Google Cloud Platform and Amazon Web Services. DO is fast and scalable and they also offer all the features you need.
Before getting started, DO is not a domain registrar. Which means you can’t purchase a domain from them. I suggest using Namecheap to purchase a domain.
There are multiple ways to set up WordPress, but one of the easiest and fastest ways I’ve found is by using EasyEngine.
DO has many data centers in multiple cities globally. It is important to choose a location closer to your audience as this can reduce the load time.
- Login/sign up for an account
- Create a new droplet and choose Ubuntu as OS
- Choose a droplet plan based on the requirement, but if you are starting by then 2GB or 3GB RAM should be just fine
- Choose monitoring as an additional option
- I recommend enabling backups
- Finally, choose a hostname and click on create
Unless you used SSH keys, DO will email the login credentials to your registered email. If you’re logging in by password for the first time, it will prompt you to change the password. Please try to change it to a complex password.
Installing EasyEngine
Once the server is ready, its time to get EasyEngine (EE) installed. EE allows you to create a WP install with a single line of command. It will also set up the required individual components like Nginx, Redis, PHP, SSL, etc. Everything is done by EE and its completely free!
Let’s update the server by using this command
sudo apt-get update
Install EE with the following command
wget -qO ee rt.cx/ee4 && sudo bash ee
After a few minutes, it will install the necessary software in the background and once that is done, it will print the following
Status: Downloaded newer image for easyengine/redis:v4.0.0
+-------------------+----------------------------------------------------------------------------+
| OS | Linux 4.15.0-45-generic #48-Ubuntu SMP Mon Nov 25 14:22:17 UTC 2019 x86_64 |
| Shell | /bin/bash |
| PHP binary | /usr/bin/php7.2 |
| PHP version | 7.2.15-1+ubuntu18.04.1+deb.sury.org+1 |
| php.ini used | /etc/php/7.2/cli/php.ini |
| EE root dir | phar://ee.phar |
| EE vendor dir | phar://ee.phar/vendor |
| EE phar path | /root |
| EE packages dir | |
| EE global config | |
| EE project config | |
| EE version | 4.0.10 |
+-------------------+----------------------------------------------------------------------------+
-----> Run "ee help site" for more information on how to create a site.
[email protected]:~#
Great! EasyEngine is installed and ready to use.
Creating a WordPress Site
EE has an option to use Redis cache which performs better. I use Redis on my personal blog, so I’d recommend trying it.
Let’s create a WP install on a domain with Redis cache
ee site create alirezaameri.ca --type=wp --cache
replace alirezaameri.ca with your domain name and remove –cache if you don’t like to use Redis
After a minute or two, you should see a successful message like the following
Configuring project.
Creating WordPress site alirezaameri.ca
Copying configuration files.
Starting site's services.
Downloading and configuring WordPress.
Moved /var/www/htdocs/wp-config.php to /var/www/wp-config.php successfully
Success: Host entry successfully added.
Checking and verifying site-up status. This may take some time.
Installing WordPress site.
Success: http://alirezaameri.ca has been created successfully!
Site entry created.
Creating cron entry
Success: Cron created successfully
+--------------------+----------------------------------------+
| Site | http://alirezaameri.ca |
+--------------------+----------------------------------------+
| Site Root | /opt/easyengine/sites/alirezaameri.ca |
+--------------------+----------------------------------------+
| Site Title | alirezaameri.ca |
+--------------------+----------------------------------------+
| WordPress Username | just-because |
+--------------------+----------------------------------------+
| WordPress Password | xxxxxxxxxxxx |
+--------------------+----------------------------------------+
| DB Host | global-db |
+--------------------+----------------------------------------+
| DB Name | alirezaameri_ca |
+--------------------+----------------------------------------+
| DB User | alirezaameri.ca-AEf1gC |
+--------------------+----------------------------------------+
| DB Password | xxxxxxxxxxxx |
+--------------------+----------------------------------------+
| E-Mail | [email protected] |
+--------------------+----------------------------------------+
| SSL | Not Enabled |
+--------------------+----------------------------------------+
| Cache | Enabled |
+--------------------+----------------------------------------+
[email protected]:~#
Perfect! Your WordPress install is ready. There is only one thing left to do. You need to update an A record of a domain to point to DO’s server IP.
Implementing SSL
It is mandatory to have your site over HTTPS, and you can get it for free. If you don’t want to get into lengthy technical details, then I’d recommend trying Cloudflare. They offer free SSL along with other performance and security advantages.
Alternatively, EE offers free SSL. Just use the following command to update your WordPress install with SSL
ee site update alirezaameri.ca --letsencrypt
Again, you do have to replace alirezaameri.ca with your domain name.
Congratulations, you’re all set! Let me know if you have any questions