TiloBox
Back to directory
Mastodon project preview

Mastodon

Decentralized, open-source social network server based on the ActivityPub protocol.

LicenseAGPL-3.0
GitHub stars50.2k
Last commit1 weeks ago
Tags6 topics
Social NetworkRubyFediverseMicrobloggingSelf HostedActivitypub
Overview

Why consider Mastodon?

Mastodon is a federated social networking platform that operates as a decentralized alternative to Twitter/X. It allows individuals and communities to run independent servers while interconnecting seamlessly.

Guided learning

Learn Mastodon by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 10 sections
In this guide10 sections

What is Mastodon?

Mastodon is an open-source, decentralized social networking platform built on the W3C ActivityPub protocol. It operates as a direct, federated alternative to centralized microblogging platforms like Twitter and X. Instead of a single company hosting all user data and algorithms, Mastodon consists of thousands of independently operated servers that seamlessly federate with one another.

Users on one Mastodon server can follow, reply, boost, and message users on any other federated server across the Fediverse with zero vendor lock-in.

Who Is It For?

  • Communities & Organizations: Hosting private or themed social networks tailored to specific interests, languages, or geographic regions.
  • Journalists & Independent Publishers: Broadcasting articles, updates, and analysis without fear of platform-wide algorithmic suppression.
  • Privacy-Conscious Users: Engaging in social media free from commercial ad tracking, data harvesting, and invasive profiling algorithms.

Key Features

  • Federated ActivityPub protocol allowing cross-server following, interactions, and content sharing.
  • Granular post privacy settings: Public, Unlisted, Followers-only, and Direct mention messages.
  • Advanced content warnings (CW), customizable filtering, and comprehensive anti-harassment tools.
  • Open REST API supporting rich mobile and desktop client applications across iOS, Android, and web.
  • Full server-level moderation tools including domain blocking, keyword filtering, and automated report queues.

Deployment with Docker Compose

Running a Mastodon instance requires PostgreSQL, Redis, and a background worker queue.

yaml
1version: '3'
2
3services:
4 db:
5 image: postgres:15-alpine
6 restart: unless-stopped
7 volumes:
8 - ./postgres:/var/lib/postgresql/data
9 environment:
10 - POSTGRES_DB=mastodon_production
11 - POSTGRES_USER=mastodon
12 - POSTGRES_PASSWORD=secure_mastodon_password
13
14 redis:
15 image: redis:7-alpine
16 restart: unless-stopped
17 volumes:
18 - ./redis:/data
19
20 web:
21 image: ghcr.io/mastodon/mastodon:v4.7.0
22 restart: unless-stopped
23 env_file: .env.production
24 command: bundle exec puma -C config/puma.rb
25 depends_on:
26 - db
27 - redis
28 ports:
29 - 3000:3000
30
31 streaming:
32 image: ghcr.io/mastodon/mastodon:v4.7.0
33 restart: unless-stopped
34 env_file: .env.production
35 command: node ./streaming
36 depends_on:
37 - db
38 - redis
39 ports:
40 - 4000:4000
41
42 sidekiq:
43 image: ghcr.io/mastodon/mastodon:v4.7.0
44 restart: unless-stopped
45 env_file: .env.production
46 command: bundle exec sidekiq
47 depends_on:
48 - db
49 - redis

Generate your secret keys and configuration:

bash
1docker compose run --rm web bundle exec rake mastodon:setup

Start the instance:

bash
1docker compose up -d

Configure your reverse proxy (Nginx or Caddy) with SSL certificates to point to ports 3000 (web) and 4000 (streaming).

Practical Use Cases

1. Community Interest Network

A tech collective establishes an instance dedicated to open-source software where members post project updates and collaborate while remaining connected to the global Fediverse.

2. Organization Public Broadcast Channel

A non-profit organization maintains its own official verified Mastodon instance to publish announcements and press releases directly to followers worldwide.

3. Niche Regional Discussion Forum

A regional city group launches a local Mastodon server for neighbors and municipal representatives to discuss civic issues with local moderation rules.

Troubleshooting and Limitations

  • Media Storage and CDN: As your server federates with thousands of remote instances, downloaded media attachments can rapidly consume storage; configure an S3 bucket with lifecycle cleanup rules for remote media cache.
  • Sidekiq Queue Backlog: On active instances, ensure sufficient Sidekiq worker concurrency to prevent delay in delivering outgoing federated messages.

Official Resources

Related tools

More options with a similar category or technology profile.

Mastodon FAQs

Mastodon is listed as a Media tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

Mastodon is listed under the AGPL-3.0 license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

Mastodon is listed as an alternative to Twitter. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.