---
title: "Deploy Diaspora"
description: "Federated social network where every server is its own community"
category: "Other"
url: https://railway.com/deploy/diaspora
---

# Deploy Diaspora

Federated social network where every server is its own community

**[Deploy Diaspora on Railway](https://railway.com/template/diaspora)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/diaspora/manifest.json

- **Creator:** A3A
- **Category:** Other

## Template content

### Postgres https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### diaspora https://raw.githubusercontent.com/diaspora/diaspora/v0.9.1.0/app/assets/images/branding/logos/app-icon-512.png

- **Source:** https://github.com/gridalpha/diaspora-railway
- **Health check:** /
- **Public domain:** Yes

### media https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/nodejs.svg

- **Source:** https://github.com/gridalpha/diaspora-railway
- **Health check:** /healthz
- **Public domain:** Yes

### sidekiq https://cdn.simpleicons.org/sidekiq/ffffff.svg

- **Source:** https://github.com/gridalpha/diaspora-railway
- **Health check:** /healthz

### mailpit https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mailpit.svg

- **Image:** axllent/mailpit:latest
- **Health check:** /livez
- **Public domain:** Yes

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Buckets

- **diaspora-media**

## Documentation

# 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](https://res.cloudinary.com/rroe4rtk/image/upload/v1788867313/diaspora-architecture.png)

## 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](https://res.cloudinary.com/rroe4rtk/image/upload/v1788867315/diaspora-stream.png)

![The diaspora* admin usage statistics page listing popular tags](https://res.cloudinary.com/rroe4rtk/image/upload/v1788867316/diaspora-pod-statistics.png)

![Sidekiq's cron tab listing diaspora*'s seven recurring jobs](https://res.cloudinary.com/rroe4rtk/image/upload/v1788867317/diaspora-sidekiq-cron.png)

## 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](https://github.com/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
- **mailpit** — `axllent/mailpit:latest`, an SMTP sink with a web inbox

### Environment Variables Reference

| Variable | Purpose |
|---|---|
| `SECRET_TOKEN` | Signs session cookies and password-reset tokens; never change it |
| `ADMIN_USERNAME` / `ADMIN_EMAIL` / `ADMIN_PASSWORD` | The first account, created before the server takes traffic |
| `SETTINGS_POD_NAME` | The name your pod introduces itself by |
| `SETTINGS_ENABLE_REGISTRATIONS` | `true` for an open pod, `false` for invitation-only |
| `ENVIRONMENT_SIDEKIQ_CONCURRENCY` | Worker threads; the database pool is sized from it |
| `MAIL_SMTP_HOST` / `MAIL_SMTP_PORT` | Point at a real relay to deliver mail off the pod |
| `MP_UI_AUTH` | Login for the captured-mail inbox |

### Deployment Dependencies

- Source: [github.com/diaspora/diaspora](https://github.com/diaspora/diaspora)
- Deployment sources: [github.com/gridalpha/diaspora-railway](https://github.com/gridalpha/diaspora-railway)
- Runtime: Ruby 3.3, Rails 6.1, Puma, Sidekiq 7
- Docs: [diaspora* wiki](https://wiki.diasporafoundation.org/)

## Hardware Requirements for Self-Hosting diaspora*

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU per service | 2 vCPU for `diaspora` and `sidekiq` |
| RAM | 1 GB each for `diaspora` and `sidekiq` | 2 GB each once federation traffic starts |
| Storage | Managed Postgres plus object storage | Grows with photos; the bucket scales itself |
| Runtime | Ruby 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`.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/diaspora
