# התקנת Discourse ב-Oracle Cloud Free Tier

**URL:** <https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749>\
**Category:** Sysadmins\
**Tags:** how-to, install\
**Created:** [23 בינואר,‏ 2022,‏ 11:15pm UTC](https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749 "2022-01-23T23:15:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [23 בינואר,‏ 2022,‏ 11:15pm UTC](https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749/1 "2022-01-23T23:15:36Z")

</div>

--- Oracle offers a free plan including two low-spec virtual machines able to run Discourse. This trial has no time limit.

⚠ These virtual machines are very slow and I advise you not to use them for hosting a community.  
That said, it can be enough to host a _very small_ community that doesn’t care about the slowness, or for personal projects/tests.

* * *

## Requirements

- A credit card number - you won’t be charged anything, but it’s needed to register the free account
- A domain name
- An email provider
- Discourse installation will be identical to [the official guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md), but this tutorial will guide you through Oracle’s Interface and configuration.

For this tutorial, we’ll consider that you’re using Windows 10, and we’ll use [PuTTY](https://en.wikipedia.org/wiki/PuTTY) to connect to your server via SSH.

## Create your free trial

First, create a trial account on [Oracle Cloud Free Tier | Oracle](https://www.oracle.com/cloud/free/)  
Your account creation is not instant and you may have to wait for a few minutes or hours (or days, in some cases) for your account to be validated.

When your account is created, go to [https://cloud.oracle.com](https://cloud.oracle.com) and log in.

## Create your server

Click “Create a VM Instance” (VM meaning “Virtual Machine”):

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/2/d24d60da46e97107e072a4dada8b011aa61d11de.png)

### Configure your server

(Optional) rename your instance to something meaningful, so you’ll know what it refers to in your virtual machine list:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/2/72972834c1d8f731e2bfc5ab69f6cc6161396273.png)

I’ll name mine the same as the domain name I’ll use: “Canapin.win”:  
 ![image](https://global.discourse-cdn.com/meta/original/3X/7/f/7ff9c8290314c4dcd31f6b7815dd886205592132.png)

In **Image and shape** , change the default operating system to **Ubuntu** by clicking edit:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/9/797812f26938ec05cc4fc1618ba4797bed621ed4.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/8/38dbffcc7df5c5a04e8d8cd4b9df61481776f32f.png)

Choose **Canonical Ubuntu** , then click **Select Image** at the bottom of the page:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/2/72c1bf63565649a7474a4c5a93af1cb580eb1786.png)

On the **Add SSH keys** , multiple options are available:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/a/8a293de9a6851622c9c2d67b54def6c07e6f1d0c.png)

Click **Save Private Key** and **Save Public Key**.  
It will download a `.pub` public key, and a `.key` private key. Store them in some folder.

### Convert the private key for PuTTY

✋ We’ll stop browsing Oracle’s interface for a while, and we’ll go back to it later.

In this tutorial, we’ll connect to our server with PuTTY. Since the generated private key is incompatible with PuTTY, we’ll use a tool named PuttYgen to convert the key so it’s compatible with PuTTY.

Install PuTTY from the official site: [Download PuTTY: latest release (0.84)](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)

After installing PuTTY, you should be able to look up PuTTYgen with the Windows search:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/6/b6cfd46be7ee77f55c71fe0da8a14f3778fa2295.jpeg)  
If it doesn’t appear here, you can locate it here: `C:\Program Files\PuTTY\puttygen.exe`

Start PuTTYgen.  
Select Conversions → Import key:  
Locate your `.key` file downloaded from Oracle’s interface and click **Open** to validate the file selection.

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/1/a198686cd51d3030d0261635f0f6437ffd4d66f1.png)

Some fields will appear and will be automatically filled. Don’t modify them unless you know what you’re doing.

(Optional) add a passphrase to your key. Think of it as a password to enhance security that will be asked each time you log in to your server.  
Then, click **Save private Key** and store it in a folder:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/b/7b615f7b72634a056066e5439acab223b74cbfa7.png)

## Finalize the server’s creation

👉 Time to go back to Oracle’s interface.

Scroll down to the end of the page, and click the **Create** button:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/5/c58fb92955cbbcd3e5f6f176c0432a84ff166541.png)

Wait for a about a minute for the server to be created. The page and its information will be updated in real-time. No need to refresh:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/1/d171742121d2a4d5175339193f91a4f323a1ac97.png)

### Make sure your domain point to your newly created server’s IP

Make your domain point to the server’s IP address and wait for the DNS propagation.  
ℹ This won’t be explained in this tutorial and must be done in the DNS configuration of your domain name’s provider.

### Note the server’s created username

Note the username the server automatically created. Here, the username is **ubuntu**.

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/9/d90a19aef3c74b6256c2ec03e9a0efb6e3bba4c9.png)

## Configure Oracle’s firewall

Now, here goes a very specific Oracle’s configuration section to make Discourse work. We will open some ports on a firewall.  
Click **Public Subnet** in the \*_Primary VNIC_ section:

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/2/02f4634c6292ceb930e425e646747bbea0947693.png)

Click the Security list link in the **Security Lists** section:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/5/25bf39d506b450bf56afde0cb983bf9e20df58b5.png)

Click **Add Ingress Rules** in the **Ingress Rules** section:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/516e03d8d3760ea91432d19451c9d3382e149af4.png)

Fill in the rules as such:

- Set SOURCE CIDR to `0.0.0.0/0`
- Set DESTINATION PORT RANGE to `80, 443`  
Click “Add Ingress Rules”:  
 ![image](https://global.discourse-cdn.com/meta/original/3X/6/d/6d79ca278ec41d9ea99c6ab60319067732aad83a.png)

Check that your rules were properly added:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/3/93ece25c1feecbeaecb149be70916fb0fe41df84.png)

### Connect to your server via SSH with PuTTY

Start PuTTY and fill the **Host Name (or IP address)** with the IP address of your newly created server:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/1/c1b8538e604ae9836eb69ed75b7afd3a15529a33.png)

On the left tree menu, go to **Connection** → **SSH** → **Auth**.  
In the “Authentification parameters”, locate your private key (the file with the `.ppk` extension you generated with PuTTYgen) by clicking **Browse…** :

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/f/0fb9c4cb4c736038cfa82da379e1b09e1aee2ec1.png)

Click **Open** :

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/e/ae433c03dc13230668b5ecca614d1d9b09fd81d2.png)

Click **Accept** :

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/3/634125158186d0ef55cb89110e82a84aeb1bd819.png)

Log in by writing your username (ubuntu) and press enter:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/7/e70aeda98390d44ce1f8b3b74e29bdb6d2231aab.png)  
Enter the passphrase if you chose one in PuTTYgen.

PuTTY will verify your private key, and you should be logged in:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/8/689cf4517243fb62e4948e272be871c2c82830d2.png)

### Configure Ubuntu’s firewall (iptables)

At this stage, we still can’t install Discourse. We must open some ports directly in Ubuntu.

Log as root by writing `sudo su` and press Enter.

Add these rules to iptables by writing:

```plaintext
iptables -I INPUT 5 -i ens3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT 5 -i ens3 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT

```

_Note: the “`5`” means that both rules will be added starting from line 5, just before the `DENY ALL` input firewall rule. The line number could have to be changed in the future if Oracle changes the default iptables configuration on their Ubuntu image in the future_

![image](https://global.discourse-cdn.com/meta/original/3X/3/c/3c34177151ff7e7e83478ad83c81bdf5b2db5882.png)

Save the updated rules with:

`netfilter-persistent save`

![image](https://global.discourse-cdn.com/meta/original/3X/8/e/8e58adf01f5d4f7dfac59bfbb9bde642b10cec68.png)

## Install Discourse

Now, your server should be ready to install Discourse.  
Just follow the official steps: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md)

_(40 minutes of building time later… 🐌)_

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/7/776ca95a00053d0bb1633b77f632b29a15e0fa93.png)

* * *

⚠ Again, Oracle free servers are **slow**. Installing and rebuilding take ages.  
Even installing themes or components from the interface can sometimes time out.  
Be warned… And patient. 🧘

* * *

Related discussion with various information and resources: [Self hosting for free (with caveats!) with Oracle Cloud](https://meta.discourse.org/t/self-hosting-for-free-with-oracle-cloud/139184)

---

_[View the full topic](https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749)._
