Self hosting for free (with caveats!) with Oracle Cloud

https://blogs.oracle.com/developers/install-run-discourse-for-free-in-the-oracle-cloud

This blog post is from last year. I didn’t see any mention here; I think Oracle as a hosting company is off the radar for most people.

So, before I posted I decided to try it myself to see if it’s really viable. I created a demo site:

I signed up for an account on Oracle Cloud. It said it would take 15 minutes to validate the account but I had to wait two days because of a problem with my credit card (you are asked for a credit card for validation).

I followed the instructions on the blog post and then I followed the normal docker installation instructions of Discourse. It almost worked on first try! I had a problem with the e-mail set up. I think it’s the only part that is not correctly explained in the blog post. I had to read the documentation. The Oracle documentation is very good.

Here is what this tier includes:

  • 2 (two) VMs
    The VM has 1/8th of an OCPU with the ability to use additional CPU resources. VM.Standard.E2.1.Micro. 2.0 GHz AMD EPYC 7551
    Memory: 1 GB

  • Bandwith: 10 TB

  • Storage: 100 GB block volume

  • E-mail: 1,000 / month (SMTP is not included)

31 Likes

Noteworthy is the configuration Oracle gives you has ~40gb disk (for OS and userdata) plus 8gb swap partition. No need for a swap file. And since you can get two VMs on the “always free” level, separating the database container is a scaling option.

(For some reason the free database PaaS there isn’t Postgres. :wink: )

6 Likes

Thank you for this interesting information!

I also had a problem. I tried multiple times without any success (“wrong cryptogram” message from my bank, though the cryptogram was right).
I tried in another browser and it worked, I just used another email address… And now it has been several hours that I’m waiting for my account to be validated.

It’s free but the registration process is a bit annoying… :sweat_smile:

1 Like

What exactly was wrong with the email part ? I have managed to install Discourse on Oracle Cloud but can’t for the life of me get Email Delivery to work. When I am about to register the admin user on the Discourse install I never get an email.

Discourse-doctor gets contact with the oracle smtp server but the mail is not sent.

I have set up many approved senders just in case. My admin email, noreply@[forum domain] and noreply@[main domain]. What is the important one?

I´ve also added a txt record to my domain’s DNS settings with the recommended SPF string.

1 Like

It was tricky. If I remember correctly what make it work for me was changing containers/app.yml:

  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  - exec: rails r "SiteSetting.notification_email='noreply@opendiscussion.pw'"
2 Likes

Thanks for the reply!

Unfortunately that didn’t help (after rebuilding the app too).

Can I ask how your TXT records look ?

You didn’t uncomment the “START TLS” setting as well ?

1 Like

So what did you do about the email? do you have to pay for it? (because you said SMTP not included)

1 Like

SMTP is included. At a time it wasn’t so in all regions. It’s just bloody hard to set up … :neutral_face:

2 Likes

Do you know if there’s an SMTP log somewhere in Oracle Cloud ? I would like to know why the email is not sent when I can contact the SMTP server fine. Why I am not authorized or whatever the problem is.

1 Like

Oracle Cloud has an SMTP service, but it’s not included in the always free tier. It’s very cheap (USD 0.085 / 1000 emails) so I use it anyway. They haven’t charged me anything yet.

https://www.oracle.com/cloud/networking/email-delivery.html#pricing

https://docs.cloud.oracle.com/en-us/iaas/Content/Email/Concepts/overview.htm

2 Likes

My bad, you are correct. I didn’t realise I was put on a trial for the paid version as I signed up for the free tier.

Are there any free alternative SMTP services which works with Discourse, while keeping Discourse itself on Oracle Cloud ?

3 Likes

I think the only one left is Free email marketing software its really a shame that the silicon valley mafia stole free emails from the internet :smiley:

4 Likes

After 1 month trying to get my trial account working, having the chat support saying that couldn’t help me, the email support that didn’t help either and didn’t reply but once, saying they’d grab some info about my account and get in touch but they never did…

I asked a friend to open an account for me and it worked like a charm in less than 15 minutes.

Then I tried to install Discourse and I struggled a lot. I followed the Oracle Discourse installation tutorial but for some reasons, I couldn’t connect to the port 443.

I tried installing Discourse on a regular Ubuntu image, but I couldn’t get connect through port 80 nor 443 for unknown reasons.

I went back to the official instructions, it wouldn’t work at first (both ports connection failed), but I restarted docker and then it magically connected to both port.

So my experience isn’t the best, whether the issues comes from me or Oracle.

But in the end, I do now have a free, online, obviously not the fastest, but working Discourse installation. :+1:t6:

For those who want to follow the same tutorial, there is a small mistake in the server firewall part.

Instead of:
sudo firewall-cmd —reload
You must write:
sudo firewall-cmd --reload

6 Likes

By default, you can’t install Discourse because connections to port 80 and 443 aren’t allowed. You need to allow them both in the security list (in the Oracle control panel) and the instance firewall (via SSH).

Here’s how to do that on a regular Ubuntu installation (it’s slightly different from their official guide which uses another Linux image).

In the Oracle panel:

After creating your Ubuntu instance, go to Instance Details and click the Subnet link:

Click the Security List:

Click Add Ingress Rules, select the TCP protocol, set Source CIDR as 0.0.0.0/0, and Destination port range as 80,443.
Validate by clicking “Add Ingress Rules”.

Verify that the rules are added in the security list:

In your server command line through SSH:

Add these rules to iptables :

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

The command will add the rules in the right place. If you simply append them to existing rules without specifying the line number (5), that won’t work because they’ll be overriden by a previous existing “reject all” rule.

Save the rules so they’ll still be here after a reboot:

netfilter-persistent save

Now you can install Discourse! :tada:

8 Likes

Hi, do you recommend Oracle Cloud for a site in production, busy enough?
Thanks

1 Like

I think you can host a small community if you and your users don’t care much about the forum speed.
But I wouldn’t recommend as you can find cheap host (~5$/month) with way better specs.

@Hector, is https://www.opendiscussion.pw still hosted on a free server?

4 Likes

Hi, for cheap host ~5$/month you mean Digital Ocean 5$ droplet?

1 Like

Yes, for example.

Personally, I like Hetzner because they are not expensive and their servers are billed per hour so it’s great to try stuff for short durations. But I believe they only have servers in Europe.

3 Likes

Yes, still on the free server. It has zero traffic, so I can’t say what it’s capable of. I also use it for development. So far so good.

3 Likes

For Hetzner VPS will I also have to install LAMP, server updates, be careful of hackers etc?

On Digital Ocean, on the other hand, everything is ready, I don’t have to secure the server, do I just have to install and manage Discourse? Is this the real difference between Digital Ocean and any other VPS?

Is Digital Ocean like a managed VPS?

Thank you!
Deb

1 Like