Provisioning a VPS for WordPress with DigitalOcean
In this lesson I'm going to walk you through provisioning a VPS server with DigitalOcean, one of the leading cloud infrastructure providers, with plenty of sizing options, starting from as low as $4/mo.
Note: This course requires either a dedicated server or a VPS. If you're looking to provision a dedicated server, see Provisioning a dedicated server instead.
DigitalOcean is a great platform for testing things out and doing it quickly. I wouldn't recommend running anything in production with their $4 options as you will very quickly run out of usable memory and get throttled on CPU, disk and network resources.
For a production-worthy WordPress site, I recommend budgeting at least $18-24 monthly for their 2 GB VMs with access to 2 cores. This gives you some breathing room for one or a couple of sites.
Create a DigitalOcean account
If you're new to DigitalOcean, you can use this link to create an account.
Note that it is a referral link that grants you $200 in credits for 60 days,
and gives me a small commission after you spend $25 on the platform. If you'd
rather sign up without using my referral link, go to www.digitalocean.com
.
After signing up, confirming your email address, and going through a short questionnaire, select the Create a Virtual Machine option from the welcome screen, or navigate to the Droplets section in the dashboard menu.
You might be a bit overwhelmed with all the different options available on DigitalOcean, including databases, spaces, container registries, and more. There's probably a new product being added as I write this. However, the only thing you should be focused on at this stage is Droplets.
Droplets are just virtual machines. You can create them, move them, resize them, destroy them, and everything else you would expect from a virtual machine. While some of the more complex products might seem interesting, self-hosting WordPress sites with DigitalOcean doesn't require anything more than a virtual machine.
Note that even with free credits, you will still need to add a working payment method to actually launch a Droplet.
Create a Droplet
The first option you're presented with when creating a new Droplet, is the Region. At the time of writing, DigitalOcean has 10 regions available, with some of them having up to three datacenters.
For testing things out, I usually select the region closest to me, giving me better connectivity and lower latency while I work. However, for live websites it's important to consider the target audience location, especially for highly dynamic websites, such as WooCommerce stores or LMS projects.
Image
Next, you will be asked to select a Droplet Image with six distributions to choose from. This is also the place where you can select to deploy a custom image or a snapshot.
I'm going to select the Ubuntu distribution, version 24.04 (LTS), but you can choose another flavor or version if you have a different preference.
Size
The VM Size option comes next. This is where you will mostly determine how much money you're going to spend on your new virtual machine.
As mentioned earlier, the best value can be found around the $18-24 monthly range. That's shared access to 2 CPU cores with 2 GB of memory. You may pay a bit extra for slightly faster CPUs and NVMe drives.
I'm going to select the Premium AMD 2G / 2CPU option for my Droplet, currently priced at $21 per month.
Dedicated CPU
You might be tempted to go for the "Dedicated CPU" Droplet Type, and you're more than welcome to give it a try. Dedicated CPU instances will certainly outperform Shared CPU instances on DigitalOcean, simply because they essentially have VIP access to the underlying physical CPU cores.
However, even at the cheapest $63/mo option, it's worth looking at a dedicated server instead. You can easily find an E3-1240V5 or equivalent for that price, with 4 physical cores (8 logical cores), plenty of RAM and local storage.
I'll show you how to run actual benchmarks in Module 7 and compare some of these options.
Authentication
In this section you'll have to select how you want to access your new server. Using an SSH Key is always the preferred option. If you're new to SSH keys, I highly recommend GitHub's guide on generating keys and managing the SSH agent.
Select an existing SSH key if you've added one to your DigitalOcean account before, or hit the New SSH Key button to add a newly generated one. We're going to add two-factor authentication to our server in another lesson, but for now SSH key access will suffice.
Feel free to ignore things like Droplet backups, monitoring, various other product upsells and settings. You can give it a descriptive hostname and make sure you're provisioning only one instance.
Hit the Create Droplet button to launch your new VM. It may take a few minutes to provision.
IP address
Once the virtual machine is provisioned, it'll be assigned a public IP address.
You can find this IPv4 address on the top-left side of the Droplet details
page, or in its Networking tab. The IP address assigned to my Droplet is
138.197.11.227
(yours will be different).
When the server is up and running, you should be able to ping
it by its
IP address:
ping 138.197.11.227
Make note of this IP address as we'll use it in a future lesson, when configuring DNS for our domain to point to this virtual machine so we can access SSH, HTTP and other services.
Note that you will be charged for this server, even if it's powered off. This is because the underlying resources are still being used (disk) or reserved (CPU and memory). If you do not intend to use this server, don't forget to destroy it to avoid charges.