Deploy Bonfire

Federated Social Networking Toolkit

Deploy Bonfire

Just deployed

/meili_data

/var/lib/postgresql/data

/opt/app/data/uploads

Deploy on Railway

Deploy and Host Bonfire on Railway

Bonfire is an open-source, modular, federated social networking platform built with Elixir and Phoenix. It empowers communities to create custom digital spaces with ActivityPub federation. This Railway template deploys a complete Bonfire stack featuring the core application server (bonfire), a PostGIS geospatial database (db), and a Meilisearch search engine instance (search).


About Hosting Bonfire

Hosting Bonfire on Railway runs a modern three-tier infrastructure stack:

  • Bonfire App Server (bonfire): The core Elixir/Phoenix backend and social web interface (bonfirenetworks/bonfire:1.0.5-social-amd64). It handles user interactions, ActivityPub federation protocol messages, and media processing. It mounts a persistent volume at /opt/app/data/uploads for media storage and listens on port 4000.
  • PostGIS Database (db): PostgreSQL database with geospatial extensions (postgis/postgis:17-3.5-alpine). It stores application state, user profiles, posts, and social graph data with persistent storage mounted at /var/lib/postgresql/data.
  • Meilisearch (search): Lightning-fast full-text search engine (getmeili/meilisearch:v1.11) configured with SEARCH_ADAPTER=meili to power instant search across social feeds, users, topics, and federated content. Persistent storage is mounted at /meili_data.

Common Use Cases
  • Self-hosted federated social networks: Launch an independent node connected to the broader ActivityPub Fediverse (Mastodon, Pleroma, Misskey, etc.).
  • Custom community platforms: Build tailored digital spaces for discussions, collaboration, and content sharing.
  • Privacy-focused social networking: Maintain full ownership of community data, uploaded media, and social analytics.
  • Full-text search enabled community hubs: Provide high-performance search across discussions, posts, tags, and user profiles via Meilisearch integration.

Dependencies for Bonfire Hosting
  • Bonfire Application image: bonfirenetworks/bonfire:1.0.5-social-amd64
  • PostGIS Database image: postgis/postgis:17-3.5-alpine
  • Meilisearch image: getmeili/meilisearch:v1.11
  • Three persistent volumes:
    • bonfire: /opt/app/data/uploads (User media and file attachments)
    • db: /var/lib/postgresql/data (PostgreSQL database files)
    • search: /meili_data (Meilisearch indices and internal state)
  • Railway public domain for the bonfire web interface (port 4000)
  • Auto-generated secrets: SECRET_KEY_BASE (64 chars) and POSTGRES_PASSWORD (32 chars)

Upstream: Bonfire Networks · GitHub Repo · Meilisearch Docs

Implementation Details
ServiceImageRolePortVolume Mount
bonfirebonfirenetworks/bonfire:1.0.5-social-amd64Social Network Core & Web UI4000/opt/app/data/uploads
dbpostgis/postgis:17-3.5-alpineRelational & Geospatial Database5432/var/lib/postgresql/data
searchgetmeili/meilisearch:v1.11Full-Text Search Engine7700/meili_data

Volumes (drives) — what to mount
ServiceMount pathWhat is stored
bonfire/opt/app/data/uploadsUser avatars, images, media attachments, and uploaded files
db/var/lib/postgresql/dataPostgreSQL tables, PostGIS spatial data, indexes, and transaction logs
search/meili_dataMeilisearch indexes, documents, and search engine state

Quick Start
  1. Click the Deploy on Railway button above.
  2. Sign in (or create a free Railway account) and click Deploy.
  3. Allow 2–3 minutes for all three services (db, search, and bonfire) to build and provision.
  4. Open the bonfire service → Settings → Networking and click the generated public domain URL.
  5. Complete the initial admin setup in the Bonfire web onboarding wizard.
  6. (Optional) Configure SMTP settings in the bonfire environment variables if email verification or notification delivery is required for your network.

Configuration
Core Application Variables (bonfire)
VariableDefault / SourceDescription / Notes
HOSTNAME${{RAILWAY_PUBLIC_DOMAIN}}Canonical public hostname for web traffic and ActivityPub federation
SERVER_PORT4000HTTP listening port for the Elixir application server
PUBLIC_PORT80Public HTTP port exposed to clients
APP_NAMEBonfireName of your social networking instance
LANGen_US.UTF-8System locale setting
SECRET_KEY_BASEAuto-generated secret (64 chars)Cryptographic secret for session signing and cookies
SIGNING_SALT${{db.POSTGRES_PASSWORD}}Salt for security token signing
ENCRYPTION_SALT${{db.POSTGRES_PASSWORD}}Salt for data encryption at rest
RELEASE_COOKIE${{db.POSTGRES_PASSWORD}}Erlang cluster distribution release cookie
POSTGRES_HOST${{db.RAILWAY_PRIVATE_DOMAIN}}Private network hostname of the PostGIS database
POSTGRES_USERpostgresDatabase username
POSTGRES_DBbonfire_dbMain database name
POSTGRES_PASSWORD${{db.POSTGRES_PASSWORD}}Database authentication password
DB_MIGRATE_INDEXES_CONCURRENTLYfalseDisable concurrent index creation during database migrations
SEARCH_ADAPTERmeiliEnables Meilisearch integration for full-text search
SEARCH_MEILI_INSTANCEhttps://${{search.RAILWAY_PRIVATE_DOMAIN}}:7700Internal Meilisearch connection URL
MEILI_MASTER_KEY${{db.POSTGRES_PASSWORD}}Master API key for Meilisearch authentication
UPLOAD_LIMIT20Maximum file upload size limit in MB
MAIL_BACKENDnoneEmail delivery backend (none, smtp, etc.)
MAIL_SERVER""SMTP mail server hostname
MAIL_PORT""SMTP mail server port
MAIL_USER""SMTP authentication username
MAIL_PASSWORD""SMTP authentication password
PORT4000Web server listening port
Database Variables (db)
VariableDefault / SourceDescription / Notes
PGDATA/var/lib/postgresql/data/pgdataInternal data path inside the PostgreSQL container
POSTGRES_DBbonfire_dbInitial database created on startup
POSTGRES_USERpostgresDefault superuser name
POSTGRES_PASSWORDAuto-generated secret (32 chars)Database password secret
DATABASE_URLpostgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}Internal database connection string
Search Variables (search)
VariableDefault / SourceDescription / Notes
MEILI_MASTER_KEY${{db.POSTGRES_PASSWORD}}Authentication key shared with bonfire
MEILI_ENVproductionProduction environment mode
MEILI_NO_ANALYTICStrueDisables telemetry reporting
Custom Domain
  1. Open the bonfire service → Settings → Networking → Custom Domain.
  2. Enter your custom domain (e.g., social.yourdomain.com) and configure the CNAME record in your DNS provider.
  3. Update the HOSTNAME environment variable on the bonfire service to match your custom domain (social.yourdomain.com).
  4. Railway automatically handles SSL/TLS certificate provisioning.

Updating Bonfire
  1. Open the bonfire service → Settings → Source.
  2. Update the image tag to a newer release (e.g., bonfirenetworks/bonfire:1.0.5-social-amd64).
  3. Click Redeploy.

Database schema migrations run automatically on startup. All database state, uploaded files, and search indexes remain safe inside their attached volumes.


Traps

Common pitfalls and failure modes:

  • HOSTNAME Mismatch for ActivityPub Federation — Federation protocol messages embed canonical URLs. Changing HOSTNAME after creating federated accounts or posts can break existing ActivityPub actor IDs and remote follower connections.
  • Unconfigured Mail Backend (MAIL_BACKEND=none) — With email disabled by default, password reset emails and user registration confirmations will not be delivered. Configure SMTP settings (MAIL_SERVER, MAIL_USER, MAIL_PASSWORD, MAIL_FROM) for production deployments.
  • Database Connection Race Condition — On cold starts or first-time deploys, the bonfire container may attempt to run database migrations before PostGIS is fully initialized. Railway will auto-restart bonfire until db accepts connections.
  • Meilisearch Master Key Mismatch — Ensure MEILI_MASTER_KEY in the search service matches the MEILI_MASTER_KEY variable in bonfire. They both derive from ${{db.POSTGRES_PASSWORD}} by default.

Why Deploy Bonfire on Railway?

Railway delivers a powerful cloud platform for deploying multi-container federated architectures. Hosting Bonfire on Railway provides high-performance PostGIS database support, private inter-service networking, persistent storage volumes, automated SSL encryption, and simple scale-out capabilities without managing underlying servers.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
2
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
167