Deploy Diaspora

Federated social network where every server is its own community

Deploy Diaspora

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

Just deployed

/data

Just deployed

/data

diaspora-media

Bucket

Just deployed

Deploy and Host diaspora* on Railway

Deploy diaspora*, the federated social network running since 2010, and you get a "pod": a server you own, whose members post, share photos and follow people on every other pod in the network. It behaves more like Facebook than Twitter: posts are long-form, photos are first-class, and every contact lands in an "aspect" that decides who sees what you write. A pod with three members is not an island: its users follow anyone on any other diaspora* server. Communities, families and privacy-minded groups self-host it so the moderation policy and the data are theirs.

Self-host diaspora* on Railway and the template wires up the whole production shape, not one container. diaspora runs the Puma web tier behind your public domain. sidekiq runs the workers as a separate service — photo processing, federation delivery, mail and seven recurring jobs — so heavy work never blocks a page load. Postgres stores every post, profile and relationship, Redis carries the job queue, a managed bucket holds every uploaded image, and media is a signed read gateway serving those images to browsers and remote pods. mailpit captures outgoing mail, so password resets work immediately.

Diagram of the diaspora, sidekiq, media, mailpit, Redis and Postgres services

Getting Started with diaspora* on Railway

The first administrator is created before the web server accepts a request, so there is no window in which a stranger can claim the account. Set ADMIN_USERNAME, ADMIN_EMAIL and ADMIN_PASSWORD at deploy time, or read the generated values back from the diaspora service's variables, then open the public URL and sign in.

Post something first: click "Start a conversation", type, and press Share. Then attach a photo with the camera icon — that one action exercises the whole stack: the upload goes to object storage, sidekiq builds four resized versions, and media signs the read that puts it back on screen. If the photo appears within seconds, every service works. Next, visit the admin panel for pod status, usage statistics and the mounted Sidekiq monitor. Then tell people your address — anyone on any pod can search for you@your-domain and follow you. Registration is open and captcha-protected by default; set SETTINGS_ENABLE_REGISTRATIONS to false for an invitation-only pod.

A diaspora* stream showing a photo post with a like and a comment

The diaspora* admin usage statistics page listing popular tags

Sidekiq's cron tab listing diaspora*'s seven recurring jobs

About Hosting diaspora*

diaspora* is an AGPL-licensed Rails application that speaks its own federation protocol to every other pod. Teams self-host it for a social space with a known moderation policy and no advertising, analytics or algorithmic feed — and for the option to leave, since accounts export and move between pods.

Key features:

  • Aspects: per-contact audience lists, so one account is personal and professional at once
  • Long-form posts with Markdown, hashtags, mentions, polls and photo galleries
  • Federation with other pods, plus a gateway to Friendica and Hubzilla
  • Account export and import, including photo archives
  • A moderation panel, two-factor auth and per-post visibility

The architecture splits the app the way upstream's own Procfile does. diaspora serves HTTP; sidekiq consumes the same Redis queue and runs every job the web tier enqueues. Neither has a disk, because uploads live in the shared bucket — which is what lets the tiers scale independently. media exists because that bucket serves no anonymous reads: it accepts only GET and HEAD under the image prefix, signs each request and streams the object back, keeping account exports private.

Why Deploy diaspora* on Railway

Railway removes the parts of running a pod that are not about community:

  • Managed Postgres and Redis, backed up and upgraded for you
  • Object storage for photos, no S3 account needed
  • HTTPS and a public domain provisioned automatically
  • Web and worker tiers scale separately, no load balancer to configure
  • Captured outgoing mail on day one, swappable for a real relay

Common Use Cases

  • A private pod for a family, club or co-op that wants a feed without advertising
  • A community server for a city, campus or interest group, federating with the network
  • A personal pod: one account, your own domain and moderation rules

Dependencies for diaspora*

  • diaspora and sidekiq — built from gridalpha/diaspora-railway on koehn/diaspora:0.9.1.0, which ships diaspora* with its assets compiled
  • Postgres — every post, profile, aspect and relationship
  • Redis — the Sidekiq job queue and the recurring job schedule
  • diaspora-media — object storage for uploaded photos and account exports
  • media — a dependency-free Node service signing bucket reads for browsers
  • mailpitaxllent/mailpit:latest, an SMTP sink with a web inbox

Environment Variables Reference

VariablePurpose
SECRET_TOKENSigns session cookies and password-reset tokens; never change it
ADMIN_USERNAME / ADMIN_EMAIL / ADMIN_PASSWORDThe first account, created before the server takes traffic
SETTINGS_POD_NAMEThe name your pod introduces itself by
SETTINGS_ENABLE_REGISTRATIONStrue for an open pod, false for invitation-only
ENVIRONMENT_SIDEKIQ_CONCURRENCYWorker threads; the database pool is sized from it
MAIL_SMTP_HOST / MAIL_SMTP_PORTPoint at a real relay to deliver mail off the pod
MP_UI_AUTHLogin for the captured-mail inbox

Deployment Dependencies

Hardware Requirements for Self-Hosting diaspora*

ResourceMinimumRecommended
CPU1 vCPU per service2 vCPU for diaspora and sidekiq
RAM1 GB each for diaspora and sidekiq2 GB each once federation traffic starts
StorageManaged Postgres plus object storageGrows with photos; the bucket scales itself
RuntimeRuby 3.3, PostgreSQL 13+, Redis 6+PostgreSQL 18, Redis 8

Federation is chatty, and the work lands on the workers, so raise sidekiq before diaspora.

Self-Hosting diaspora* Without Railway

diaspora* publishes no official image, so a manual install builds from source:

git clone -b v0.9.1.0 https://github.com/diaspora/diaspora.git && cd diaspora
cp config/database.yml.example config/database.yml
cp config/diaspora.toml.example config/diaspora.toml
bin/bundle install --with postgresql
RAILS_ENV=production bin/rake db:create db:migrate assets:precompile
RAILS_ENV=production ./script/server

You also need a reverse proxy terminating TLS, Postgres, Redis and an SMTP relay. To skip the build, run a prebuilt image against your own database:

docker run -d -p 3000:3000 -e RAILS_ENV=production \
  -e ENVIRONMENT_URL=https://social.example.com/ \
  -e ENVIRONMENT_REDIS=redis://redis:6379 \
  koehn/diaspora:0.9.1.0

Edit config/diaspora.toml before the first boot: environment.url is written into every account handle and cannot be changed later without orphaning them.

Is diaspora* Free?

diaspora* is free and open source under the AGPL-3.0: no paid tier, no license key, no hosted edition. The project is run by volunteers and funded by donations. On Railway you pay only for the compute, storage and bandwidth the services use — a few dollars a month for a small pod. sidekiq usually grows first, because federation delivery scales with how many remote accounts your members follow.

FAQ

What is diaspora?* A federated, open-source social network. Each server is a "pod", pods talk to one another, and a user on one pod can follow and comment on posts from any other pod without an account there.

What does this Railway template deploy? Six services: the diaspora web tier, a sidekiq worker tier, Postgres, Redis, a media gateway serving photos from object storage, and mailpit for outgoing mail. The bucket and the first administrator account are created for you.

Why does the template include a separate worker service? Photo processing, federation delivery and mail all run as background jobs. Upstream's own process file separates the web server from the workers, so a burst of federation traffic never slows page loads and each tier scales alone.

Why is there an object storage bucket instead of a disk? Both tiers read and write the same uploads: one receives the photo, the other resizes it. Shared object storage is what lets them run as two independent services, and neither has a disk that can fill up.

How do I connect my own domain to a self-hosted diaspora pod?* Attach it to diaspora before anyone registers. A pod's address is written into every account handle, so changing it later breaks existing accounts.

How do I send real email from my pod instead of capturing it? Point MAIL_SMTP_HOST, MAIL_SMTP_PORT, MAIL_SMTP_USERNAME and MAIL_SMTP_PASSWORD on both app services at your provider, set MAIL_SMTP_AUTHENTICATION to plain, and delete mailpit.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51