Railway

Deploy Flarum | Open-Source Community Forum on Railway, Discourse alternative

Self host Flarum. Lightweight, modern PHP forum with 1600+ extensions

Deploy Flarum | Open-Source Community Forum on Railway, Discourse alternative

Just deployed

/data

Just deployed

/var/lib/mysql

Flarum logo

Deploy and Host Flarum on Railway

Deploy Flarum on Railway to run a modern, fast, and elegantly designed community forum with zero server management. Self-host Flarum with full control over your data, extensions, and user experience — backed by 16k+ GitHub stars and 1,600+ community extensions.

This Railway template pre-configures Flarum with a MySQL database, persistent storage for extensions and uploads, and a production-ready Nginx/PHP-FPM stack. One click gets you a live forum at a public HTTPS URL with admin access ready to go.

Getting Started with Flarum on Railway

After deployment completes, visit your Railway-provided URL to see your live Flarum forum. Click Log In (top right) and sign in with the default administrator account created automatically on first boot — username flarum, password flarum. Change this password immediately from your profile settings once you're in. Then open the admin dashboard (gear icon) to set your forum title, description, and welcome banner. Install your first extension through the built-in Extension Manager — popular choices include FoF Upload for file attachments and FoF User Directory for member management. Create your first discussion category using Tags, then post a welcome thread to test the full workflow.

Flarum dashboard screenshot

About Hosting Flarum

Flarum is an open-source forum platform built on PHP (Laravel) with a Mithril.js single-page application frontend. It was designed as a modern successor to esoTalk and FluxBB, focusing on speed, simplicity, and extensibility.

  • Single-page application — real-time updates, infinite scrolling, and fluid navigation without page reloads
  • Mobile-first responsive design — full-featured experience on phones and tablets
  • "Everything is an extension" architecture — 1,600+ community extensions covering tags, mentions, SSO, OAuth, file uploads, SEO, analytics, and more
  • JSON:API compliant REST API — build custom integrations, bots, and mobile apps
  • Composer-based package management — install and update extensions via CLI or the built-in Extension Manager
  • Lightweight core — minimal resource footprint compared to Discourse or phpBB

Why Deploy Flarum on Railway

  • Managed MySQL database with automatic backups and failover
  • Persistent volume for extensions, uploads, and forum assets
  • HTTPS with automatic TLS certificate — no Nginx or Certbot configuration
  • One-click deploy with environment variable configuration
  • Scale vertically as your community grows

Common Use Cases for Self-Hosted Flarum

  • Product support forums — lightweight alternative to Discourse for SaaS companies needing a customer Q&A space
  • Niche hobbyist communities — fast, clean interface for enthusiast groups (gaming, photography, DIY)
  • Internal team discussions — private forums for organizations wanting threaded async communication
  • Open-source project communities — host discussions alongside your GitHub repo with full data ownership

Dependencies for Flarum on Railway

This template deploys two services:

  • Flarumcrazymax/flarum:latest — PHP/Nginx forum application with s6-overlay process supervision
  • MySQLmysql:9.4 — Railway-managed relational database for forum data, users, posts, and extension state

Environment Variables Reference for Flarum

VariableDescriptionExample
FLARUM_BASE_URLPublic URL of the forumhttps://${{RAILWAY_PUBLIC_DOMAIN}}
DB_HOSTMySQL hostname${{MySQL.MYSQLHOST}}
DB_PASSWORDMySQL password${{MySQL.MYSQLPASSWORD}}
FLARUM_FORUM_TITLEForum title (first install only)My Community
UPLOAD_MAX_SIZEMax file upload size50M
MEMORY_LIMITPHP memory limit256M
REAL_IP_FROMTrusted proxy CIDR0.0.0.0/0

Deployment Dependencies

Hardware Requirements for Self-Hosting Flarum

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM512 MB1 GB
Storage1 GB5 GB
RuntimePHP 8.1+PHP 8.2+

Flarum is one of the lightest forum platforms available. A small community (< 1,000 users) runs comfortably on minimal resources. Storage needs grow with file uploads and extension count.

Self-Hosting Flarum with Docker

Run Flarum locally with Docker Compose using the crazymax/flarum image:

services:
  flarum:
    image: crazymax/flarum:latest
    ports:
      - "8000:8000"
    environment:
      FLARUM_BASE_URL: "http://localhost:8000"
      DB_HOST: db
      DB_NAME: flarum
      DB_USER: flarum
      DB_PASSWORD: secret
    volumes:
      - flarum-data:/data
    depends_on:
      - db

  db:
    image: mysql:9.4
    environment:
      MYSQL_DATABASE: flarum
      MYSQL_USER: flarum
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: rootsecret
    volumes:
      - mysql-data:/var/lib/mysql

volumes:
  flarum-data:
  mysql-data:

Start the stack:

docker compose up -d

Visit http://localhost:8000 — the default admin account is flarum / flarum. Change the password immediately after first login.

Is Flarum Free to Self-Host?

Flarum is completely free and open source under the MIT License. There are no paid tiers, no enterprise edition, and no feature gates. The only cost is your infrastructure — on Railway, that means paying for compute and database usage based on actual resource consumption. Most small-to-medium forums cost under $10/month on Railway.

Flarum vs Discourse

FeatureFlarumDiscourse
LanguagePHP (Laravel)Ruby on Rails
FrontendMithril.js SPAEmber.js
RAM usage~256 MB~1–2 GB
Extensions1,600+ community200+ plugins
Setup complexityLowHigh
Real-timePolling-basedWebSocket
Mobile appResponsive webNative + web
LicenseMITGPL v2

Flarum is significantly lighter and simpler to deploy. Discourse offers more built-in features (chat, AI summaries, trust levels) but requires substantially more resources and operational complexity.

FAQ

What is Flarum and why self-host it? Flarum is a modern open-source discussion platform built with PHP and Mithril.js. Self-hosting gives you full data ownership, unlimited customization through extensions, and no per-user pricing that managed forum platforms charge.

What does this Railway template deploy for Flarum? This template deploys two services: the Flarum application (using the crazymax/flarum Docker image with Nginx and PHP-FPM) and a Railway-managed MySQL 9.4 database. It includes a persistent volume at /data for extensions, uploaded assets, and forum storage.

Why does Flarum need MySQL on Railway? Flarum stores all forum data — users, discussions, posts, tags, notifications, and extension state — in a MySQL database. Railway's managed MySQL provides automatic provisioning, persistent storage, and connection variables that wire directly into Flarum's configuration.

How do I install extensions on self-hosted Flarum on Railway? Use the built-in Extension Manager from the Flarum admin panel (/admin → Extensions). Search for extensions by name, click install, and enable them. Extensions persist across redeployments because they're stored on the /data volume. You can also install via SSH using composer require vendor/extension-name.

How do I change the default admin password on Flarum deployed on Railway? The crazymax/flarum image creates a default admin on first boot with username flarum and password flarum — there is no environment variable to override these. Log in with the defaults, then change the password from your profile settings immediately. You can also script this via Flarum's REST API: POST /api/token to authenticate, then PATCH /api/users/1 to update the password.

Can I migrate from Discourse or phpBB to Flarum? Community-built migration tools exist for importing data from Discourse, phpBB, MyBB, and other platforms. Check the Flarum community forums for the latest migration extensions and guides.


Template Content

More templates in this category

View Template
Strapi
A popular self-hosted CMS

Milo
7.6K
Deploy
View Template
WordPress with Redis
Deploy WordPress with MariaDB and Redis

Noor Adn
View Template
NEW
Docmost
Self-hosted Notion alternative with real-time collaborative editing.

Tasha