How to set up a FREE Oracle Cloud VPS server with Cleavr
Tags: hosting, devops, tutorial
Published: 2021-12-18 18:15:47

{% youtube 8UFDVwR0rXU %}


Are you looking for a free test server to host some smaller projects on or to use as a playground environment?

There aren't too many free VPS options out there unfortunately... And, often, if they are free, they may not even be worth the effort to set up.

Oracle provides a pretty decent cloud VPS server that I've been using as a test server for a couple of months now. I recommend you give it a try!

This guide walks you through how to set up an Oracle Cloud free server in their GUI and then how to connect to it with Cleavr as a 'Custom Server'.

## Step 1: Create an Oracle Cloud account

Head over to [Oracle Cloud](https://www.oracle.com/cloud/) and create a new account.

Expect to have to provide a Credit Card in order to create an account. As long as you stick to the free options they provide, you shouldn't need to worry
about your card getting charged. They do a good job at tagging which resources are free eligible.

One more thing to mention, expect to get contacted via email and phone by an Oracle rep. Believe me, they'll do their best to try to get in contact with you...

## Step 2: Add a new VPS instance

Once signed up, on the getting started page, launch a new VM instance.

![Add a new oracle vps instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkg6zk7qm2fpsgtqbrko.png)

On the **Image and shape** card, click **edit**. You'll need to select the **Canonical Ubuntu: 20.04** instance.

![Edit the image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07hjfb3kiwmfs0hsjr2n.png)

![Edit the image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6oemaxs6kmpfpsxh4d7.png)
 
Add your SSH key (you'll need to SSH into the new server in the next steps).

![Edit the image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8jyi3jhbb5lxiqcpzhi.png)
 
Finally, click on **Create**. This will provision the server on Oracle's side.

## Step 3: Connect Cleavr to the server

Once the Oracle server has an assigned Public IP Address, copy the IP to the clipboard and header over to [Cleavr](https://cleavr.io).

On the dashboard, click the **Create** button and select server.

For VPS Profile, select **Custom Server**.

Give the server a name and paste the **IP Address** into the corresponding field.

Copy the command to run as root on the server and open up your terminal and SSH into the server.

```
ssh ubunutu@<public ip>
```

The default server user with Oracle Cloud is `ubuntu`. You cannot access as `root` at this point. Once you conenct to the server, you can switch to root using the following command.

```
sudo su root
```

Now, paste in the command and run it.

Back in Cleavr, provision the server.

Cleavr will add further dependencies to the server and get it all ready to host your apps.

## Step 4: Update Oracle firewall

We've seen some odd behavior that blocks port 80 connects, even when enabling it via the Oracle UI and in UFW. This often seems to really come into play after a server reboot.

Thanks to our community members, we've found that installing firewalld on the server and opening Port 80 works to resolve the issue.

On the server terminal via SSH, run the following commands one-by-one:

```
apt install firewalld
firewall-cmd --zone=public --permanent --add-port=80/tcp
firewall-cmd --reload
```

## Step 5: Add sites and deploy

You're now all setup to use Cleavr to manage your free Oracle Cloud server and start adding sites and deploying web apps!