How to Create an Always Free Website on the Oracle Cloud

How to Create an Always Free Website on the Oracle Cloud

Oracle Always Free tier website tutorial

In this tutorial, you will learn how to create a website on the Oracle Cloud free tier. Aside from a domain name, this is 100% free website hosting.

What is the Oracle Cloud Always Free Tier?

The Always Free tier on the Oracle Cloud has numerous unlimited benefits including the following:

  • Two Oracle Autonomous Databases
  • Two AMD Compute VMs
  • Up to 4 instances of Arm Ampere A1 Compute

This tutorial will show you how to create an AMD compute virtual machine (VM) that is free forever. The specs of the VM are as follows:

  • CPU: 2.0 GHz AMD EPYC 7551 (Naples)
  • RAM: 1 GB
  • Bandwidth: 0.48 Gbps
  • Storage: 50 GB

What Kind of Website Can You Make?

You can make pretty much any type of website on the Oracle Cloud free tier.

In this tutorial, you will learn how to make a WordPress website that runs on a LEMP server which is an acronym for Linux, Nginx, MariaDB, and PHP (note that Nginx is is pronounced like engine x, so that’s where the E comes from). Specifically, we will be working with Ubuntu 20.04 as our Linux operating system.

What About a Domain Name?

Unfortunately, Oracle doesn’t give out free domain names, so you will have to buy one. I get most of my domain names from Google Domains, but you can purchase a domain name from a number of different registrars. I’ll assume that you already have a domain name.

1. Sign Up for Oracle Cloud

Step one is to sign up for a free Oracle Cloud account.

Please note that in addition to an email and mailing address, you will need to provide a valid credit card. As it states on the Oracle website:

You won’t be charged unless you elect to upgrade the account.

After successfully signing up for your Oracle Cloud account and verifying your email address, continue onto your Oracle Cloud dashboard.

2. Create an Always Free VM

From your dashboard, click on “Create a VM instance” or alternatively, open the menu in the upper left corner and go to Compute > Instances > Create Instance.

After giving your instance a name (I called mine tonysvm), click on the “Edit” button in the “Image and shape” box.

  • Click on “Change Image” and change your operating system to Canonical Ubuntu with OS version of 20.04
  • Click on “Change Shape” and make sure you have the VM.Standard.E2.1.Micro Always Free Elegible Shape selected which is located under the “Speciality and Previous Generation” shape series.

Next, with the “Generate a key pair for me” option selected, click on the “Save Public Key” and “Save Private Key” buttons in the “Add SSH keys” box. This will download the public and private keys that we will use to access your VM via SSH.

Optionally, you can change your boot volume to a size up to 200 GB and still be elegible for the free tier. By default, the boot volume is set to 46.6 GB.

Finally, click on “Create” at the bottom to spin up your free VM. This process can take up to a few minutes to complete.

3. Configure the VM’s Network

By default, the firewall on your VM is locked down. You will need to explicitly allow external connections over the HTTP port of 80 (and alternatively over the HTTPS port of 443 if you choose to install an SSL certificate).

To do this, open the menu in the upper left corner of your Oracle Cloud dashboard and go to Networking > Virtual Cloud Networks > vcn-* > subnet-* > Default Security List for vcn-* and then click on the “Add Ingress Rules” button.

Fill out the form with the following information. Leave all other fields blank or unchecked.

When you are done, click on the “Add Ingress Rule” button at the bottom.

4. Login to Your VM via SSH

In order to access your VM via SSH, you will need to use Putty on Windows, or the built-in Terminal application on Mac. You can find your SSH credentials back on your compute instance’s detail page under the “Instance Access” section.

Oracle Cloud VM login credentials

If on Mac or Linux, in your terminal window, you can issue the following command to connect via SSH while specifying your instance’s public IP address, public key file location, and username.

After successfully authenticating, you should arrive at a screen that looks similar to this.

SSH session after login

5. Update System and Install LEMP Packages

First, update and upgrade your system to the latest version with the following commands.

Next, install the web server (Nginx), the database (MariaDB), and the necessary PHP packages.

6. Allow HTTP Connections

To allow HTTP connections over port 80 on the server, execute the following commands.

If you are planning on installing an SSL certificate, you will also need to do this for port 443 as well.

7. Setup the Database

Create a database and a database user for WordPress with the following commands. You can access the database command prompt by typing sudo mysql . Please change the username, password, and database name to something appropriate for your system.

8. Install WordPress

To download and install WordPress, execute the following commands.

9. Configure the Nginx Web Server

We need to tell the Nginx web server about WordPress. Edit the configuration file at /etc/nginx/sites-available/default to look similar to this while adding your own domain name to the server_name field and ensuring that the socket file at /var/run/php/php7.4-fpm.sock actually exists. If a different version of PHP is installed, use that version instead.

After testing your configuration changes with sudo nginx -t , apply your changes by restarting the Nginx server.

10. Point Your Domain Name to Your VM’s IP Address

In order to allow users to navigate to your domain name to access your website, you need to add a DNS A record that essentially points your domain name to your IP address. This is typically done at your domain registrar (i.e. the place where you bought your domain name).

In case you are not familiar with this process, here is a video to walk you through it.

YouTube video

11. Finish the WordPress Installation

In a web browser, navigate to your domain name. A page similar to this welcoming your to WordPress should show up.

WordPress install page

Follow the installation, providing the database credentials that you chose earlier. On the following page, you can choose a name for your website as well as a username and password to login to your WordPress administrator dashboard.

Complete the installation by clicking on the “Install WordPress” button. Login to your new website and get to work! In case you’re not familiar with WordPress, here are 15 important things to do after installing WordPress.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *