Flarum on Ubuntu/Debian in 2025: A No-Bullshit Guide for Grumpy Sysadmins

Rey Posted on 26 days ago 33 Views


Need a forum that doesn’t look like it crawled out of 2005?

Flarum is the answer.

Below is the exact checklist I used to spin up a clean instance on Ubuntu 22.04 LTS in 12 minutes, including the coffee break.

Copy-paste friendly, swear-word compatible.

What the Hell Is Flarum?

Flarum is a PHP/MySQL forum that steals the best parts of Slack, Reddit, and Discourse, then strips out the bloat.
Single-page app, real-time notifications, dark mode by default—basically everything your users bitch about when you hand them phpBB.

Perfect for:

  • internal company KBs that people will actually read
  • niche hobby communities that still care about RSS
  • “temporary” side projects that live for eight years

Prerequisites: Read This or Suffer

  1. OS: Ubuntu 20.04+ or Debian 11+ (anything older gets you PHP 7.4 and sadness)
  2. Specs: 1 vCPU, 2 GB RAM, 20 GB SSD (cheap VPS tier)
  3. DNS: A record pointed at the box before you start (trust me)

Step 1 – Update the Box

sudo apt update && sudo apt full-upgrade -y

Yes, full-upgrade.
No, you don’t need dist-upgrade unless you enjoy breakage.

Step 2 – Install the Stack

sudo apt install nginx mysql-server php8.3-fpm php8.3-{mysql,curl,dom,gd,mbstring,xml,zip} unzip composer -y

Ubuntu 22.04 ships 8.1 by default; use ppa:ondrej/php if you need 8.3.

Step 3 – Harden MySQL

sudo mysql_secure_installation

Set a real root password, nuke test DBs, disable remote root.
The script hasn’t changed since 2012—just mash Enter.

Step 4 – Create a DB and User

sudo mysql -u root -p
CREATE DATABASE flarum CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'flarum'@'localhost' IDENTIFIED BY 'SuperSecretPass123!';
GRANT ALL ON flarum.* TO 'flarum'@'localhost';
FLUSH PRIVILEGES;
EXIT

Step 5 – Grab Flarum via Composer

cd /var/www
sudo composer create-project flarum/flarum . --stability=beta

When Composer asks about VCS files, say y; you’re not committing this mess to Git anyway.

Step 6 – Nginx Config (Copy-Pasta Certified)

sudo nano /etc/nginx/sites-available/flarum

sudo ln -s /etc/nginx/sites-available/flarum /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Step 7 – Fix Permissions (No 777, Ever)

sudo chown -R www-data:www-data /var/www
sudo chmod -R 755 /var/www
sudo chmod -R 775 /var/www/storage /var/www/vendor

Web Installer – 60-Second Walkthrough

  1. Hit http://yourdomain.com.
  2. Fill in DB creds from Step 4.
  3. Create admin user notAdmin (seriously).
  4. Turn off “Allow username change” unless you want 3000 ElonMusk clones.

Extensions That Don’t Suck

Extension Why You Care Install
fof/upload Images, zips, whatever composer require fof/upload
fof/sitemap Google likes you composer require fof/sitemap
flarum-lang/english (or chinese-simplified) Stop the “why is this half Chinese” tickets composer require flarum-lang/english

After enabling in Admin → Extensions:

sudo -u www-data php flarum cache:clear

Troubleshooting: The Greatest Hits

404 on every page
Nginx try_files block is wrong. Re-copy the config above.
Can’t upload avatars
chmod 775 /var/www/assets/avatars and chill.
Posts hang at “Saving…”
PHP memory limit. Edit /etc/php/8.3/fpm/php.inimemory_limit = 256M.

Wrap-Up: Ship It

Don’t open registrations on day one. Seed 20–30 posts yourself, then invite three power users.
After that, the community trains itself.
If something breaks, the Flarum Discuss forum is faster than any doc—just search before you post; they hate duplicates.

Now go forth and host a forum that doesn’t look like ass.
You’re welcome.

This author has not provided a description.
Last updated on 2025-08-16