Connecting FreeFlarum to your Domain

Have you ever stumbled across a tool you wanted to try immediately? That’s exactly how I felt when I discovered Flarum, a modern, open-source forum software brimming with possibilities. But unfortunately I didn't have a VPS and with very limited space on my disk drive self hosting was not an option either. 

Enter FreeFlarum, A service which allows you to create your very own Flarum forum. If you don't have domain they will host you under one of their own domains under a subdomain. But here is the bit more technical part, I already had a domain name where I wanted to host my forum at. FreeFlarum allows you to do this with limitation being that it has to be under a subdomain of yours like forum.example.com or www.example.com.

I realized it shouldn't be a much of a problem I can always redirect my root domain to www and went with that setup. Hence this guide, where I’ll walk you through setting up your FreeFlarum forum with a custom domain.

Linking custom domain

First go to Freeflarum Settings, and then to Forum Settings, scroll down to Link custom domain. Here, enter your subdomain it can be www.yourdomain.com or forum.yourdomain.com or any other subdomain of your choice. And then click Link domain.

Domain DNS Management

Your next step is to go to your domain provider, it could be Porkbun, Namecheap or any other provider. I use Cloudflare for this guide. In there look for DNS management because we need to update the DNS records. Here you add a new CNAME record, that will direct your subdomain to FreeFlarum. It should look like below:

TypeNameContentTTL
CNAMEwwwcname.freeflarum.comAUTO

And that's it, now your www.yourdomain.com is successfully connected to your FreeFlarum forum.

Redirect root domain to www

This is not a necessary step as your subdomain is now already connected to your FreeFlarum forum, only do this if you want your root domain to redirect to your forum subdomain. This was the hardest step to get right, as I kept running into issues. I tried to use URL forwarding with my domain provider but for some reason it did not work. So instead used Cloudflare after moving my nameservers to it.

In Cloudflare you need to do three things for this to work, first you need to create a dummy A type DNS record like the one below (You can use "192.0.2.1" or any random IP.) :

TypeNameContentTTL
Ayourdomain.com192.0.2.1AUTO

Next, go to SLS/TLS and change (configure) from Flex or whatever you have now to Full (Strict)

Finally, go to Rules, and then Templates. And create Redirect from Root to WWW rule.

  • Request URL: https://yourdomain.com/*
  • Target URL: https://www.yourdomain.com/${1}
  • Status Code: 301 (or whatever you want.)

and then click deploy.

Wait for a bit, and now your root domain should redirect to your forum as well.