Self-host a Mastodon server ?
Running your own corner of the fediverse means running five things that all have to agree with each other: a Rails web process, a separate streaming server for the real-time timeline, a Sidekiq worker for federation and notifications, Postgres, and Redis. Get the domain wrong in any one of them and you get an instance that half-loads or silently stops federating. By the end of this guide you’ll have a real single-server Mastodon instance running all five, behind HTTPS, with backups and an honest look at what it actually costs to run well.
What you’ll need#
A server with at least 4 vCPUs and 8 GB of RAM for a small instance; this guide uses the five services on one box, which is more than the web process alone needs. A Hetzner CX33 (4 vCPU, 8 GB RAM, 80 GB NVMe, €8.99/month excl. VAT) is the realistic starting point once Postgres, Redis, the streaming server and Sidekiq are all competing for resources on the same machine; growing past a few hundred active users is when splitting Postgres onto its own box starts to matter.
A domain name you can point an A record at. Mastodon ties your account handles to this domain permanently; there’s no supported way to move an existing instance to a new domain later without starting over.
An SMTP provider. This is not optional: Mastodon requires working email delivery for account confirmation, password resets and moderation notices, and ships with none configured by default. Any transactional email provider works.
SSH access to the server.
continue reading here : https://railyard.run/blog/self-host-mastodon/

RailyardSelf-host a Mastodon server · RailyardRun a real Mastodon instance with Postgres, Redis, the streaming API and Sidekiq as separate services, behind Caddy HTTPS, with backups.
commit 02df9cc
The shortcut: do it with Railyard
Everything above, Postgres and Redis wired to all three Rails-based processes, the streaming service split out with its own routing, Sidekiq sharing the media volume, is also what Railyard’s Mastodon stack template sets up for you. Connect a…