• Other
  • FreeFlarum software and hosting setup

Hi!

I’d like to learn more about how FreeFlarum is set up, so that I have a good and battle-tested starting point. Are these assumptions correct?:

  • Caddy
  • MariaDB
  • PHP-FPM
  • CloudFlare

Are there any other software/hosting details that you might share? What kind of hosting manages to serve so many instances of Flarum?

Thank you very much for such an awesome service!

    navindra FreeFlarum uses Python Flask + FastAPI app for the main page backend, for frontend it uses Alpine.js and Tailwind CSS (https://freeflarum.com).

    As for the server itself, your assumptions are correct - FreeFlarum uses Caddy, MariaDB and PHP-FPM (you can check versions for these at your Flarum admin dashboard), with Cloudflare free plan to back it up in terms of speed and protection. It also uses a self-hosted Postfix mail server for outgoing e-mail.

    We rent a Hetzner server (CAX31, 8 vCPU & 16 GB RAM) which is located in Falkenstein, Germany. FreeFlarum has been running since 2017 and has hosted over 30K unique forums in its existence so far (however, many of which are no longer active).

    I hope this helps. Or are there perhaps any other specific questions that you might have?

      12 days later

      SKevo Had a follow up question. I’ve configured Caddy, MariaDB, PHP-FPM, and Cloudflare.

      However, Flarum is using REMOTE_ADDR (via Symfony I think) which corresponds to the Cloudflare proxy IP instead of the actual client IP. Caddy is updating the client_ip correctly but PHP isn’t using that.

      I noticed that FreeFlarum doesn’t seem to have any such problem and is correctly detecting the client IP. How did you manage to work around this problem?

      Thank you!

        navindra I put the following code in public/index.php, right before $server = new Flarum\Http\Server($site);:

        if (isset($_SERVER['X-Real-IP'])) {
            $_SERVER['REMOTE_ADDR'] = $_SERVER['X-Real-IP'];
        } elseif (isset($_SERVER['X-Forwarded-For'])) {
            $_SERVER['REMOTE_ADDR'] = $_SERVER['X-Forwarded-For'];
        } elseif (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
            $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
        }

          SKevo Thank you! That was my last resort, but seems like the approach is at least validated by FreeFlarum. 👍

            navindra it was also mentioned by Flarum at their Discord server, when I was having the exact same issue. However, that solution used an extender instead of injecting the code directly like I did (IIRC). My fix was only temporary and will likely not be preserved between updates.

            For this reason, it is always a better idea to use extenders for things like this, but because I am not a PHP programmer, I just overwrote the file directly