Skip to main content

Lemmy

Decentralized Reddit alternative. Link aggregation and discussion forums in the Fediverse.

Overview

Lemmy is a free, open-source social news aggregator and forum that federates via ActivityPub. It provides a Reddit-like experience where anyone can run their own instance while staying connected to the broader network.

Key Features

Federation

┌─────────────────────────────────────────────────────────┐
│ Lemmy Network │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┐ ┌───────────────┐ │
│ │ lemmy.world │◄──────►│ lemmy.ml │ │
│ │ Instance A │ AP │ Instance B │ │
│ └───────┬───────┘ └───────┬───────┘ │
│ │ │ │
│ └────────────────────────┘ │
│ │ │
│ ActivityPub Protocol │
│ │ │
│ ┌────────────┴────────────┐ │
│ │ │ │
│ ┌───────▼───────┐ ┌───────▼───────┐ │
│ │ Mastodon │ │ Kbin │ │
│ │ (comments) │ │ (compatible) │ │
│ └───────────────┘ └───────────────┘ │
│ │
│ Subscribe to communities on any instance │
│ Mastodon users can participate in discussions │
│ │
└─────────────────────────────────────────────────────────┘

Community Structure

┌─────────────────────────────────────────┐
│ Community: !technology@lemmy.ml │
├─────────────────────────────────────────┤
│ │
│ 📌 Pinned: Community Rules │
│ │
│ 🔥 Hot Posts │
│ ├── [1234↑] New open source project │
│ ├── [567↑] Linux kernel update │
│ └── [234↑] Self-hosting guide │
│ │
│ Moderators: @alice, @bob │
│ Subscribers: 45,678 │
│ │
│ [Subscribe] [Create Post] │
│ │
└─────────────────────────────────────────┘

Content Features

FeatureDescription
PostsLinks or text posts
CommentsThreaded discussions
VotingFull scores (+/-) visible
CommunitiesTopic-focused groups
ModerationPer-community moderators
Cross-postingShare to multiple communities
Saved postsBookmark content
BlockingUsers and communities

Interface

  • Clean design — Mobile-friendly responsive UI
  • Multiple themes — Light, dark, solarized
  • i18n — Many languages supported
  • Markdown — Full formatting support

Self-Hosting

Requirements

  • Docker and Docker Compose
  • PostgreSQL
  • Domain name with HTTPS

Docker Installation

# docker-compose.yml
version: '3'
services:
lemmy:
image: dessalines/lemmy:latest
depends_on:
- postgres
- pictrs
ports:
- "8536:8536"
volumes:
- ./lemmy.hjson:/config/config.hjson
environment:
RUST_LOG: "warn,lemmy_server=info,lemmy_api=info"

lemmy-ui:
image: dessalines/lemmy-ui:latest
depends_on:
- lemmy
ports:
- "1234:1234"
environment:
LEMMY_UI_LEMMY_INTERNAL_HOST: lemmy:8536
LEMMY_UI_LEMMY_EXTERNAL_HOST: lemmy.example.com

postgres:
image: postgres:15-alpine
volumes:
- ./postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password
POSTGRES_DB: lemmy

pictrs:
image: asonix/pictrs:0.4
volumes:
- ./pictrs:/mnt

Configuration

// lemmy.hjson
{
database: {
host: postgres
user: lemmy
password: password
database: lemmy
}
hostname: "lemmy.example.com"
email: {
smtp_server: "smtp.example.com"
smtp_login: "noreply@example.com"
smtp_password: "password"
smtp_from_address: "noreply@example.com"
}
setup: {
admin_username: "admin"
admin_password: "changeme"
admin_email: "admin@example.com"
site_name: "My Lemmy Instance"
}
}

Ansible Deployment

git clone https://github.com/LemmyNet/lemmy-ansible.git
cd lemmy-ansible
# Configure inventory and vars
ansible-playbook lemmy.yml

Technical Stack

ComponentTechnology
BackendRust (Actix-web)
FrontendTypeScript (Inferno)
DatabasePostgreSQL + Diesel
FederationActivityPub
LicenseAGPL-3.0

Why Rust?

  • Performance — Fast and memory-efficient
  • Safety — Memory-safe by design
  • Reliability — Strong type system

Mobile Apps

PlatformApps
AndroidJerboa (official), Liftoff, Thunder
iOSMlem, Thunder, Voyager
Cross-platformVoyager (PWA)

Moderation

Hierarchy

Site Admins

├── Site-wide policies
├── Instance federation
└── Global bans

Community Moderators

├── Community rules
├── Post/comment removal
└── Community bans

Tools

ToolDescription
ReportsUser flagging system
RemovalHide content
BansUser restrictions
FederationAllow/block instances
Auto-modSlur filter, etc.

Comparison with Reddit

AspectLemmyReddit
OwnershipDistributedCentralized
Open sourceYesNo
AlgorithmNoneHeavy
AdsNoneMany
APIFreePaid/restricted
ModerationDistributedCentralized
Self-hostingYesNo

Finding Instances

Popular instances:

InstanceFocus
lemmy.worldGeneral
lemmy.mlTech
beehaw.orgCommunity
programming.devDevelopers

Growth

After Reddit's 2023 API changes, Lemmy saw significant growth:

  • Pre-June 2023: ~100 instances
  • Post-June 2023: 1,500+ instances
  • Monthly active users: 60,000+

See Also