How to self-host Mastodon
Self-hosting a Mastodon instance on Fly.io comes down to a starter repo, a Dockerfile and two Fly config files: one runs the database setup, the other deploys the app. The guide covers Mastodon's architecture (Rails, Sidekiq, Node streaming server, Redis, Postgres, optional Elasticsearch and S3), generating app and VAPID secrets with rake, and provisioning managed services: Neon Postgres for scale-to-zero pricing, Upstash Redis and Postmark SMTP. A notable gotcha is passing the Neon project ID inside the password string, because the image's database client lacks TLS SNI support.
Related posts
- Deploy a Dart App on Railway, Part 1
Railway mediumAdeptA Flutter + Serverpod trivia app is deployed to Railway with a Railway-hosted PostgreSQL database, using the Railway CLI and a custom multi-stage Dockerfile that compiles the Dart server and bundles a Flutter web build into Serverpod's static webserver. Database credentials are wired in through Railway variable references, and migrations are applied in production mode. Because Railway exposes only one port per domain, a Caddy reverse proxy template routes traffic between Serverpod's API port (8080) and web port (8082). A curl request to the example hello endpoint confirms the deployment works.
- Fly Postgres, managed by Supabase
Supabase easyNoviceSupabase and Fly.io launched Fly Postgres, a managed Postgres running on Fly Machines (Firecracker VMs) with Supabase features like Supavisor pooling, pgvector, PITR, branching and auto-generated REST/GraphQL APIs; the offering has since been deprecated. Under the hood, Supabase packages all its services into a single All In One Docker image built from its Packer pipeline. Because Fly volumes lack network-attached storage, they are treated as ephemeral, with WAL-G continuously streaming WAL to S3 for recovery onto new hosts. Open issues include client IPs being masked by the Fly proxy, which breaks network restrictions, and inter-cloud bandwidth costs from backing up to AWS.
- Getting started with Ruby on Rails and Postgres on Supabase
Supabase mediumAdeptA Rails app can be wired to a Supabase-hosted Postgres database by scaffolding with `rails new -d=postgresql` and supplying the Supabase pooler connection URI through the `DATABASE_URL` environment variable. The walkthrough generates an Article scaffold, runs migrations, inserts and queries records from the Rails console, and routes the root path to the articles index. Deployment to Fly.io uses `fly launch` with Postgres provisioning set to none, the connection string stored as a Fly secret, and `fly deploy`.
- Deploy Authorizer on Railway
Railway mediumAdeptAuthorizer, an open-source self-hosted alternative to Auth0, can be deployed on Railway with a one-click template that provisions PostgreSQL and Redis automatically and wires up DATABASE_URL and REDIS_URL. Deployment needs only ADMIN_SECRET and JWT_SECRET, plus OAuth client credentials if social logins are wanted. A React integration follows: install @authorizerdev/authorizer-react, wrap the app in AuthorizerProvider pointed at the Railway endpoint, and use the Authorizer component and useAuthorizer hook for login flows and user state.
- How Cedalio uses Neon for an efficient development workflow
Neon easyNovice
Cedalio, an ESG data verification startup, moved from DynamoDB to Postgres and picked Neon over RDS for a simpler API and console. GitHub Actions creates a Neon database branch and a Fly.io app instance for each PR, then deletes both after merge, and scale-to-zero keeps these temporary environments cheap. A one-database-per-customer design gives tenant isolation. Their backend reads the Postgres WAL, bundles and encrypts operations, stores them optionally on IPFS or Arweave, and commits a hash to a client-owned smart contract for tamper-evident auditing.