Mastodon — The Flagship Federated Social Network on the Fediverse
Mastodon is the decentralized Twitter/X alternative powering the Fediverse. Run your own instance, federate with thousands of others, and control your own community without ads, algorithms, or a single corporate owner.
What it is
Mastodon is an open-source, decentralized social networking platform. Instead of one company owning the entire network, anyone can run a Mastodon instance (called a server) that federates with every other Mastodon server and ActivityPub-compatible platform. Users on different servers can follow, reply, and share content across the network without a central authority.
Mastodon targets individuals and communities who want social networking without ads, algorithmic feeds, or corporate ownership. It is also used by organizations that need a self-hosted communication platform under their own control.
How it saves time or tokens
For developers and teams building on the Fediverse, Mastodon provides a complete ActivityPub implementation out of the box. Instead of implementing the federation protocol from scratch, you deploy Mastodon and get a fully functional social network with user management, moderation tools, and media handling. The REST API lets you build bots, integrations, and custom clients without touching the server code.
For AI workflows, the Mastodon API is straightforward to automate for posting, scheduling, and monitoring social engagement programmatically.
How to use
- Choose a hosting approach: join an existing server at joinmastodon.org, or self-host using Docker or the official installation guide on a VPS.
- For self-hosting, deploy with Docker Compose. Configure your domain, email delivery (SMTP), and object storage for media files.
- Set up moderation rules, customize your instance branding, and open registration. Your server automatically federates with the rest of the Fediverse.
Example
# Docker Compose deployment (simplified)
git clone https://github.com/mastodon/mastodon.git
cd mastodon
# Copy and edit environment config
cp .env.production.sample .env.production
# Edit: LOCAL_DOMAIN, SMTP settings, S3 storage
# Build and start
docker compose build
docker compose run --rm web rails db:setup
docker compose up -d
After setup, your instance is accessible at your configured domain and federates with the global Fediverse network.
Related on TokRepo
- AI tools for content — Tools for creating and managing social media content
- Self-hosted tools — Other platforms you can run on your own infrastructure
Common pitfalls
- Self-hosting Mastodon requires ongoing maintenance: database backups, media storage growth, and Ruby/Rails security updates. Budget for operational overhead.
- Moderation is per-instance. As an instance admin, you are responsible for your users' content and must handle reports, blocks, and federation policy.
- Email delivery is critical for user signup and notifications. Misconfigured SMTP causes silent failures where users cannot verify their accounts.
Frequently Asked Questions
A small instance for a few hundred users runs on a VPS starting around $10-20/month. The main cost drivers are media storage (S3 or local disk) and database size. Large instances with thousands of users need dedicated database servers and CDN for media delivery.
Yes. Mastodon uses the ActivityPub protocol, which means users can follow and interact with accounts on Pixelfed (photos), PeerTube (video), Lemmy (Reddit-like), and any other ActivityPub-compatible platform.
No. Mastodon shows posts in chronological order by default. There is no algorithm deciding what you see. You see posts from people you follow, your local instance timeline, and the federated timeline from connected servers.
Each instance sets its own moderation rules. Instance admins can block or silence entire other instances (defederation), block individual users, or set content warnings. There is no central moderation authority across the Fediverse.
Yes. Mastodon supports account migration. You can move your followers to a new server. Your old profile redirects to the new one. However, past posts do not transfer automatically.
Citations (3)
- Mastodon GitHub— Mastodon is a decentralized social network using ActivityPub
- Mastodon Documentation— Federation with ActivityPub-compatible platforms
- W3C ActivityPub— ActivityPub is a W3C standard for decentralized social networking
Related on TokRepo
Discussion
Related Assets
doctest — The Fastest Feature-Rich C++ Testing Framework
doctest is a single-header C++ testing framework designed for minimal compile-time overhead and maximum speed.
Chai — BDD/TDD Assertion Library for Node.js
Chai is a flexible assertion library for Node.js and browsers that supports expect, should, and assert styles.
Supertest — HTTP Assertion Library for Node.js APIs
Supertest provides a high-level API for testing HTTP servers in Node.js with fluent assertion chaining.