Lemmy

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

14.3Kstars
946forks
GNU Affero General Public License v3.0
Rust

Lemmy is an open-source, federated link aggregator and discussion platform built for the Fediverse. It gives anyone the ability to run their own forum server — hosting communities, setting moderation policies, and owning all content — without depending on a corporation or third-party cloud service. Users on one Lemmy instance can subscribe to communities and interact with users on any other federated instance, just like email works across providers.

Under the hood, Lemmy is a Rust monorepo with clearly separated crates for API, federation (ActivityPub), and database access. The backend runs on Actix Web with Diesel ORM over PostgreSQL, and a TypeScript client with auto-generated types keeps the API contract tight across the stack. An AGPL-3.0 license means all forks and modifications must remain open.

Lemmy is actively approaching its 1.0 release (in beta as of mid-2026) with features including a WASM plugin system via Extism, scheduled post publishing, cross-instance federation testing, and rate limiting with admin overrides. With over 14,000 GitHub stars, 253 contributors, and monthly releases, it is one of the most mature and actively maintained decentralized social platforms available.

What You Get

  • Federated Communities - Create or subscribe to topic-based communities across any Lemmy instance via the ActivityPub protocol, enabling cross-server discussion without central infrastructure.
  • Full Self-Hosting Control - Deploy your own server with Docker Compose or Ansible, configure moderation policies, customize the appearance, and retain complete ownership of all user data.
  • Reddit-Style Voting and Sorting - Up/down vote scoring with multiple sort options (hot, new, top, controversial) surfaces relevant content organically without opaque algorithmic feeds.
  • Live Threaded Comment Threads - Comments update in real time with full nesting and reply chains, enabling deep async discussion without page reloads.
  • WASM Plugin System - Extend server behavior with custom Extism-based WASM plugins that hook into vote, post, and comment lifecycle events without modifying core code.
  • Integrated Image Hosting - Upload images directly in posts and comments with no dependency on external image hosts, reducing link rot and preserving privacy.
  • Transparent Moderation Logs - Every moderation action — bans, removals, stickies, transfers — is logged publicly so communities can hold moderators accountable.
  • Cross-Platform RSS/Atom Feeds - Subscribe to All, Subscribed, Inbox, User, and Community feeds from any feed reader, enabling content consumption without logging in.
  • Data Portability and Erasure - Users can fully erase their posts and comments, replacing content with a placeholder to comply with privacy regulations like GDPR.
  • 30+ Language i18n - Community-driven translations via Weblate cover the UI and documentation in over 30 languages, with easy contribution workflows for new translators.
  • NSFW Community Support - Per-community and per-user NSFW toggles with explicit tagging allow adult content to be hosted appropriately without contaminating general feeds.
  • Registration Queue and Invites - Admins can require application-based registration or invite-only sign-up, giving full control over who can join a server.

Common Use Cases

  • Niche Hobby Community - A film photography group hosts a Lemmy instance to discuss analog cameras, share photos, and run polls free from ad-driven content moderation and recommendation algorithms.
  • Privacy-Focused News Aggregator - A small media organization runs a public Lemmy server to aggregate links and discussion around investigative reporting, federating with readers on other instances without requiring a social media account.
  • University Department Forum - A university department self-hosts Lemmy on internal infrastructure to run course discussion boards, controlling data residency and preventing student data from flowing to third-party ad platforms.
  • Open Source Project Hub - A large open source project stands up a Lemmy instance as a community forum, linking it to their documentation and GitHub while moderating with project maintainers and federating with adjacent tech communities.
  • Activist Coordination Network - An advocacy group uses a private Lemmy server with invite-only registration to coordinate campaigns, keeping membership lists and discussion off platforms subject to corporate takedowns.
  • Game Community Server - A gaming community replaces their proprietary forum software with Lemmy to benefit from federation with other game-related instances and mobile apps, while keeping their own moderation standards.

Under The Hood

Architecture Lemmy is organized as a Rust Cargo workspace with tightly scoped crates for each layer: API handlers, federation (ActivityPub), database views, and utilities. This separation enforces strict compile-time boundaries that prevent business logic from bleeding into transport or data layers. The ActivityPub federation crates encapsulate all protocol handling behind a clean interface, so the core application state never directly touches protocol-level concerns. Database access is abstracted through purpose-built view crates that compose SQL via Diesel ORM and PostgreSQL extensions like ltree for hierarchical comment trees, shielding the rest of the application from raw table complexity. Dependency injection flows through Rust’s type system — services such as database pools, rate limiters, and plugin registries are threaded through request context as typed data rather than global singletons.

Tech Stack Lemmy runs Rust on the Actix Web async runtime, compiled with aggressive release optimizations (LTO, single codegen unit) and mimalloc for reduced memory allocation overhead. PostgreSQL is the sole database, accessed through Diesel ORM with diesel-async for non-blocking queries, Diesel migrations for schema management, and ltree extensions for efficient comment-thread traversal. The TypeScript API client is generated from Rust type definitions via ts-rs, keeping client and server types in sync without manual contract maintenance. A WASM plugin system built on Extism allows server administrators to inject custom logic at hook points (before/after votes, post creation) without touching source code. Deployment targets Docker Compose and Ansible, and the CI pipeline (Woodpecker CI) runs formatting, Clippy linting, and federation integration tests across paired instances.

Code Quality The workspace Cargo.toml enforces an extensive set of Clippy deny rules — unwrap_used, expect_used, indexing_slicing, unreachable, and as_conversions among them — which effectively ban common Rust footguns at compile time across the entire codebase. Federation and API behavior is covered by a comprehensive TypeScript API test suite using Jest, organized by feature (posts, comments, communities, federation, images, tags, private messages) and running against live paired server instances rather than mocks, ensuring real cross-instance behavior is validated on every change. Error handling is centralized through a typed LemmyError and LemmyResult pattern, eliminating implicit panics and making error propagation explicit. The combination of Rust’s type system, strict lints, and integration-level tests gives the codebase unusually high correctness guarantees relative to a community-driven project.

What Makes It Unique Lemmy’s most distinctive technical decision is its deep integration between ActivityPub federation and PostgreSQL views: federated content from remote instances is stored and queried through the same view layer as local content, meaning the application has no separate “remote content” codepath. The WASM plugin system via Extism is rare in self-hosted social platforms and enables operators to customize vote handling, registration captchas, and notification behavior without forking. The TypeScript type generation from Rust definitions (ts-rs) eliminates an entire class of client/server contract drift that plagues most projects with separate codebases. Combined with a ltree-based comment hierarchy for efficient deep-thread queries and idempotency middleware to handle ActivityPub delivery retries gracefully, Lemmy applies production-grade distributed systems thinking to what is often treated as a simple CRUD forum.

Self-Hosting

Lemmy is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). The AGPL is a strong copyleft license: you are free to use, modify, and self-host Lemmy for any purpose — including commercially — without paying anyone. However, if you modify Lemmy’s source code and run it as a network service accessible to others, you are required to publish those modifications under the same AGPL-3.0 license. For most operators running an unmodified or lightly configured instance, this is not a concern. Organizations that make significant proprietary changes to the backend and expose it publicly need to be aware of this obligation.

Running Lemmy yourself means you take on full operational responsibility: provisioning and maintaining a PostgreSQL database, managing backups, handling server updates across major versions, configuring an SMTP provider for email notifications, and setting up a reverse proxy (typically nginx) with TLS. The project provides official Docker Compose and Ansible playbooks that cover a typical deployment, and the administration documentation at join-lemmy.org walks through the process in detail. Lemmy can run on modest hardware — a single-core VPS or a Raspberry Pi handles small communities without issue — but busy public instances require tuned PostgreSQL configurations and sufficient disk for image uploads. Database migrations are handled automatically on startup, but each major release requires reviewing the changelog for breaking changes.

There is no official managed or cloud-hosted version of Lemmy; the project is fully community-funded through donations (Liberapay, Ko-fi, Patreon, OpenCollective) and an NLnet Foundation grant. This means no paid tier unlocks additional features, but also means there is no SLA, no vendor-provided support contract, and no guaranteed uptime beyond what you build yourself. Community support is available through the Matrix development chat, the Lemmy support forum on lemmy.ml, and GitHub Issues. Organizations evaluating Lemmy as an internal forum should budget for a dedicated admin familiar with Rust/Docker deployments and plan for the ongoing maintenance burden that comes with any self-hosted federated service.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search