In this guide, I'll show you how to deploy WordPress on Oracle Cloud Infrastructure (OCI) using the Always Free Tier resources, allowing you to host your WordPress site at no cost.
Oracle Cloud offers an attractive package allowing you to create up to 6 VMs (Virtual Machines) under its Always Free plan. Specifically, you have access to 2 VM.Standard.E2.1.Micro instances (each with 1 CPU and 1GB RAM) and up to 4 VM.Standard.A1.Flex instances (with the flexibility to allocate up to 24 GB RAM and 4 CPUs).
However, it's important to note that the Always Free Tier provides only 200GB of free block storage, with a minimum requirement of 46.6GB per VM. This storage limitation means that, in reality, you can create a maximum of 4 VMs without incurring any costs.
Sometimes, free A1 machines may not be available in your region. In this case, Oracle Cloud allows users to switch to the Pay-As-You-Go plan, which can still be free within the free usage limits but requires account approval — which may take a few days.
Getting Started
1. Start by signing up for an Oracle Cloud account to access the Always Free Tier resources. Visit https://www.oracle.com/cloud/free/ to register.
2. Immediately after your first login, you will see an option to create a WordPress website automatically. Do not click it; while it is a good option, it is not eligible for the Free Tier.
3. Look for a box labeled 'Create a new VM'. Alternatively, you can click the logo in the top left corner, then choose Compute -> Instances.
3. Click "Create instance".
4. Enter the name in English, scroll down, and choose the VM.Standard.A1.Flex shape first, then select Ubuntu 22.04 Minimal aarch64 as the operating system, and set the configuration to 1 CPU and 6GB RAM. You can add more resources if needed, but if your website does not have many active users, this configuration will be more than enough, allowing you to save resources for other projects. You can always scale up later if needed.
Note: Sometimes A1 may not be available. In this case, go to your billing, add a payment method, and upgrade to a Pay-As-You-Go account. It takes about 24 hours for approval, but it remains free as long as you stay within the free tier limit. This also lessens the chance of your account being blocked. I usually suggest keeping a small charge for backup or similar reasons, to not rely solely on free resources. However, I've never encountered issues; the choice is yours. If you're in a hurry, opt for VM.Standard.E2.1.Micro, found under the far-right tab after clicking "Select shape". It will work fine for small blogs, but it may not be a good choice if you have significant traffic or many plugins installed. Think of it as a free, cheap hosting replacement.
5. Set up a new Virtual Network and create an SSH Key Pair, or feel free to upload an existing public key if you have one. Make sure to add this key to your system, so you can use it to log in securely.
6. Leave all other settings as is and click "Create". In a few minutes, your VM will be created.
Configuring the Server
1. Copy your VM's public IP address and run the following command in your terminal:
ssh ubuntu@<server public IP>
If you encounter an error, you might need to specify the path to your private key by using:
ssh -i /path/to/your/private/key ubuntu@<server public IP>
Windows users might need to install an SSH client like PuTTY to connect to the server using SSH.
On the first login, you may see the following message:
Simply type 'yes' and press Enter.
2. Now, you have several ways to run WordPress, from deploying a Docker container to manual setup. For this tutorial, we'll use CyberPanel. Other available options include HestiaCP, which is built on the once-famous Vesta, among many others.
3. Run:
sudo apt-get update && sudo apt-get upgrade
4. Switch to the root user:
sudo su -
And run this command from the CyberPanel GitHub page:
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
When prompted during the setup process, make sure to choose OpenLiteSpeed.
5. After you've answered all the questions, it'll take around 15 minutes to finish the installation. At the end, you'll get the URL, login, and password. Make sure to save them somewhere safe and then open the link in your browser (it will not load yet).
6. At the end of the installation, the script will ask you to open some ports.
To do this, navigate to Networking -> Virtual Cloud Networks in Oracle Cloud, then select your VCN (at this stage, you should have only one, the first two are free).
Next, go to Security List -> Default Security List for ***. Here, you'll need to add Ingress Rules as specified by the script:
At the end, this page should look like:
5. Now, you should be able to access the login page. You might need to allow an insecure connection first.
Use your saved credentials to log in.
6. (optional) Take a moment to explore the menu and familiarize yourself with the interface. You can make adjustments such as changing the admin name and email.
7. In the left panel, you'll notice WordPress. While it appears to be a great plugin, it does require payment. However, we have the option to configure it ourselves.
Go to Websites -> Create Website. Enter your domain, email, and enable SSL.
Click "Create Website".
8. Navigate to Databases -> Create Database. Choose your domain, enter a name and password, then click "Create Database".
9. Similarly, create an FTP account.
10. To link your domain to the server, update its DNS settings to match the server's IP address. You can complete this process on your domain registrar's website.
Additionally, configure the mail server by adjusting DNS records and settings within the server panel under the "Email" section.
11. Now, you can install WordPress just like on any other hosting by connecting using FTP, uploading files, and following the prompts.
However, I would recommend uploading files using SSH (SCP/SFTP), as it is much more secure. Ideally, you should block the FTP port (21) in Oracle Cloud settings, along with any other unused ports, since there are many bots on the internet crawling and attempting to access different poorly protected servers. We don't want to attract their attention, even though they won't be able to authorize.
Alternatively, you can go to Websites -> List Websites. Choose your website from the list, then click on 'Manage' in the top right corner. Scroll down to the 'Application Installer' section and click on 'WP + LSCache'. This option will automatically create the necessary database and configure WordPress for you.
12. (optional) Remove the 1000MB limit for your website by going to Packages -> List Packages -> Default and changing the limit.