Video coming soon…

🐁 Setup Lemmy — Self-Hosted Reddit Alternative

Federated open-source link aggregator and community discussion platform — a self-hosted Reddit alternative with full ActivityPub federation.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — your own Reddit-like community running in minutes.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/social/lemmy/lemmy-ubuntu.sh
chmod +x lemmy-ubuntu.sh
sudo bash lemmy-ubuntu.sh

Tutorial Steps

1 Download & Run Installer

The script installs Docker if needed, then pulls the Lemmy, Lemmy-UI, PostgreSQL, and Pictrs images and starts all containers. Lemmy will be available on port 80 with a PostgreSQL database for persistent storage.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/social/lemmy/lemmy-ubuntu.sh
chmod +x lemmy-ubuntu.sh
sudo bash lemmy-ubuntu.sh

2 Access Web UI & Create Admin

Open your browser and navigate to Lemmy. On first visit you will be prompted to create the admin account — set a strong username and password as this account has full control over your instance.

http://<your-server-ip>:80

3 Create Communities

After logging in as admin, go to Create Community to set up your first discussion communities. Give each community a name, description, icon, and banner. Set the community type (public, restricted, or private) and configure moderation rules. Communities are the equivalent of subreddits.

4 Configure Federation

In the admin settings panel, enable federation so your instance can connect with other Lemmy servers and Fediverse platforms. You can allow all instances by default or use an allowlist/blocklist. Once enabled, users can subscribe to communities on remote instances and your communities become discoverable across the Fediverse.

Ports Used

PortPurpose
80Web UI (HTTP)
8536Lemmy API
5432PostgreSQL (internal)

Overview

Lemmy is a free, open-source federated link aggregator and discussion platform similar to Reddit. Communities (subreddits) are hosted on independent instances that federate via ActivityPub, allowing users on one instance to subscribe to and interact with communities on other instances across the Fediverse.

Why Use It

Lemmy gives communities and organizations the ability to host their own discussion forum without Reddit's algorithmic moderation, ad tracking, or API restrictions. Federation means your community is not isolated — users from across the Fediverse can participate without creating a separate account.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              Lemmy's web interface runs on port 80 and the backend API on port 8536. Always serve via HTTPS through a reverse proxy. For federation to work, your instance must be reachable from the public internet with a valid domain and TLS certificate.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Alternatives include Reddit (centralized, large), Kbin (Fediverse magazine aggregator), Mastodon (microblogging focus), Discourse (traditional forum), and Flarum (lightweight forum). Choose Lemmy for a Reddit-like federated experience with link aggregation and community voting.

                    When Not to Use It

                    Avoid Lemmy if you need a traditional threaded forum without federation — Discourse or Flarum are better suited. Also avoid if you have no moderation plan — an unmoderated public Lemmy instance will attract spam and harmful content.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      What is federation and how does it work in Lemmy?

                      Federation means Lemmy instances communicate with each other via the ActivityPub protocol. A user on one Lemmy instance can subscribe to communities on another instance, upvote posts, and comment — all from their home instance. The instances exchange activity data automatically, making the distributed network feel unified.

                      Can I keep my Lemmy instance private?

                      Yes. Configure federation as none or set a strict allowlist of trusted instances. Set registration_mode to RequireApplication or Closed so only approved users can join. With these settings, your instance acts as a private forum invisible to the broader Fediverse.

                      Are there mobile apps for Lemmy?

                      Yes. Several Lemmy client apps are available: Jerboa (official Android), Thunder (iOS and Android), Liftoff (iOS and Android), and Connect for Lemmy (iOS). All apps work with any Lemmy instance — you enter your instance URL and log in with your account.

                      How do I moderate a Lemmy community?

                      Community moderators can remove posts and comments, ban users from the community, and lock or pin threads. Instance admins have broader powers to remove content site-wide and ban users from the instance. Moderation is done from the web UI or compatible mobile apps.

                      Can Mastodon users interact with Lemmy?

                      Yes, partially. Mastodon users can follow a Lemmy community as if it were a Mastodon account. New Lemmy posts appear in the Mastodon user's timeline. Mastodon replies to a Lemmy post appear as comments on that post. The interaction is not perfect but the basics of cross-platform federation work.

                      How many users can one Lemmy instance handle?

                      A single-server Lemmy instance can handle thousands of active users with moderate hardware (4 vCPU, 8 GB RAM). Very large instances like lemmy.world with hundreds of thousands of users require significant server resources and database optimization. For a community of up to a few thousand, a standard VPS is sufficient.

                      What is pictrs and why does Lemmy need it?

                      Pictrs is an image hosting service that Lemmy uses to store and serve uploaded images, thumbnails, and avatars. It runs as a separate container in the Lemmy Docker Compose setup. Without pictrs, image uploads and link preview thumbnails will not work.

                      Can I migrate communities from Reddit to Lemmy?

                      Not automatically — there is no direct import tool from Reddit. You can manually recreate community structure, rules, and sidebar content. Some community migration involved asking Reddit members to join the Lemmy equivalent and repost important content. Historical posts and comments cannot be migrated from Reddit's API.