In this tutorial, you will learn how to create a virtual private server with DigitalOcean and install WordPress, the most popular website app in the world for only $5 a month, in addition of subscribing to a domain name.
Subscribing to a cloud server
The few big names in cloud hosting are:
- Amazon Web Services (AWS)
- DigitalOcean
- Google Cloud Platform (GCP)
- Microsoft Azure
In this post, I will use DigitalOcean’s lowest $5 droplet to create and run a WordPress site. A DigitalOcean’s droplet is a virtual private server that you can subscribe to host a web app. DigitalOcean has many one-click ready droplets that you can use to create common apps such as WordPress, Joomla and other web apps.
If the app you want to install is not available as a one-click installer, you could still install them by creating a droplet running a standard Linux such as Ubuntu or CentOS, and then install the app manually. You may need more Linux command-line knowledge however.
In this tutorial, I will share with you how to start a droplet running CentOS 8, and then install the free LiteSpeed Web Server Enterprise. The two steps were to set up the required stack so as to install WordPress.
Steps to install a WordPress instance on a DigitalOcean droplet
The procedure assumes you have already subscribed to a domain.
- Create a droplet from the OpenLiteSpeed image in the Marketplace.
- Set the DNS to point to the IP of the new droplet.
- SSH to the droplet to set up the VPS.
- Install WordPress on a browser.
Create a droplet from the OpenLiteSpeed image in the Marketplace
- Sign up for a DigitalOcean account if you have not done so.
- In the dashboard, click Create and select Droplets.
There are multiple ways to install WordPress. In this tutorial, we are going to install WordPress on OpenLiteSpeed.
- Click See All Marketplace Apps and enter WordPress in the Search field. Select OpenLiteSpeed WordPress.
- Choose the Basic $5/month plan.
- Select the data centre that is nearest to your location or your target audience location.
- Select the Authentication method to access your droplet.
This step provide the authentication method for you to access your droplet via SSH. The user who gain access through this step gains root privilege of your server. Hence, SSH Keys is the preferred way. However, if you did not have a SSH key in your computer, then you should choose Password to authenticate the access. You must remember to use a strong password if you choose this method.
- Select Backup if you want DigitalOcean to automatically backup your server as an image. The backup is done weekly for up to 4 weeks, and it cost only $1 a month. I recommend that you subscribe to this service if you intend to create a serious permanent website.
- Click Create Droplet and wait for the process to complete.
Set the DNS to point to the IP of the new droplet.
After the droplet is created, you need to point your domain to the IP.
- Login to your domain registrar.
- Create an A record and set the domain to point to the IP.
- Create another A record and set the www subdomain to point to the IP.
After this is done, wait for TTL to expire. The TTL shows the time in seconds. Wait for the time to expire before you proceed to set up the server.
SSH to the droplet to set up the VPS
- In your terminal program, enter the command
ssh root@your-droplet-ip
where IP is the IP of your droplet. If you chose to use Password authentication earlier, you will need to enter your password here to access. - After you are logged in, answer the prompts accordingly to set up the server.
Complete the WordPress Install on a browser
After the setup completed, you can access the browser to install WordPress.
- Open up your browser and visit your site using your domain.
- Fill up the fields with the required information to complete the installation.
Once your WordPress installation completes successfully, you will be able to access its admin interface by appending wp-admin to your URL ie. https://your-domain.com/wp-admin .
Moving on
What you have completed is installing WordPress on a VPS. Although you could start developing your site, it is still important to secure your site well.
Securing your site would means you need to secure both the VPS and the WordPress. A few common procedures to ensure they are secure:
- Update WordPress to the latest version.
- Set up your VPS with a non-root user for daily operations of the VPS.
- Turn off remote root access by changing sshd_config.
- Allow VPS access only by public key.
Another important point to note is that the security certificate from Let’s Encrypt need to be renewed every three months. To renew it requires you to access the VPS server via SSH and run the certbot command.
A more convenient way would be to install a website control panel, such as CyberPanel. It will automatically run the security certificate renewal, as well as provide additional functions for you as a web host to run common operations. DigitalOcean also provide a One-Click installer for CyberPanel in the Marketplace.
Related Posts
In this tutorial, you will learn how to create a virtual private server with DigitalOcean and install WordPress, the most popular website app in the world for only $5 a month, in addition of subscribing to a domain name.
Subscribing to a cloud server
The few big names in cloud hosting are:
- Amazon Web Services (AWS)
- DigitalOcean
- Google Cloud Platform (GCP)
- Microsoft Azure
In this post, I will use DigitalOcean’s lowest $5 droplet to create and run a WordPress site. A DigitalOcean’s droplet is a virtual private server that you can subscribe to host a web app. DigitalOcean has many one-click ready droplets that you can use to create common apps such as WordPress, Joomla and other web apps.
If the app you want to install is not available as a one-click installer, you could still install them by creating a droplet running a standard Linux such as Ubuntu or CentOS, and then install the app manually. You may need more Linux command-line knowledge however.
In this tutorial, I will share with you how to start a droplet running CentOS 8, and then install the free LiteSpeed Web Server Enterprise. The two steps were to set up the required stack so as to install WordPress.
Steps to install a WordPress instance on a DigitalOcean droplet
The procedure assumes you have already subscribed to a domain.
- Create a droplet from the OpenLiteSpeed image in the Marketplace.
- Set the DNS to point to the IP of the new droplet.
- SSH to the droplet to set up the VPS.
- Install WordPress on a browser.
Create a droplet from the OpenLiteSpeed image in the Marketplace
- Sign up for a DigitalOcean account if you have not done so.
- In the dashboard, click Create and select Droplets.
There are multiple ways to install WordPress. In this tutorial, we are going to install WordPress on OpenLiteSpeed.
- Click See All Marketplace Apps and enter WordPress in the Search field. Select OpenLiteSpeed WordPress.
- Choose the Basic $5/month plan.
- Select the data centre that is nearest to your location or your target audience location.
- Select the Authentication method to access your droplet.
This step provide the authentication method for you to access your droplet via SSH. The user who gain access through this step gains root privilege of your server. Hence, SSH Keys is the preferred way. However, if you did not have a SSH key in your computer, then you should choose Password to authenticate the access. You must remember to use a strong password if you choose this method.
- Select Backup if you want DigitalOcean to automatically backup your server as an image. The backup is done weekly for up to 4 weeks, and it cost only $1 a month. I recommend that you subscribe to this service if you intend to create a serious permanent website.
- Click Create Droplet and wait for the process to complete.
Set the DNS to point to the IP of the new droplet.
After the droplet is created, you need to point your domain to the IP.
- Login to your domain registrar.
- Create an A record and set the domain to point to the IP.
- Create another A record and set the www subdomain to point to the IP.
After this is done, wait for TTL to expire. The TTL shows the time in seconds. Wait for the time to expire before you proceed to set up the server.
SSH to the droplet to set up the VPS
- In your terminal program, enter the command
ssh root@your-droplet-ip
where IP is the IP of your droplet. If you chose to use Password authentication earlier, you will need to enter your password here to access. - After you are logged in, answer the prompts accordingly to set up the server.
Complete the WordPress Install on a browser
After the setup completed, you can access the browser to install WordPress.
- Open up your browser and visit your site using your domain.
- Fill up the fields with the required information to complete the installation.
Once your WordPress installation completes successfully, you will be able to access its admin interface by appending wp-admin to your URL ie. https://your-domain.com/wp-admin .
Moving on
What you have completed is installing WordPress on a VPS. Although you could start developing your site, it is still important to secure your site well.
Securing your site would means you need to secure both the VPS and the WordPress. A few common procedures to ensure they are secure:
- Update WordPress to the latest version.
- Set up your VPS with a non-root user for daily operations of the VPS.
- Turn off remote root access by changing sshd_config.
- Allow VPS access only by public key.
Another important point to note is that the security certificate from Let’s Encrypt need to be renewed every three months. To renew it requires you to access the VPS server via SSH and run the certbot command.
A more convenient way would be to install a website control panel, such as CyberPanel. It will automatically run the security certificate renewal, as well as provide additional functions for you as a web host to run common operations. DigitalOcean also provide a One-Click installer for CyberPanel in the Marketplace.