The Fediverse's answer to Reddit

Lemmy Tell You This

Article from Issue 275/2023
Author(s):

With Reddit closing off access to its API, it is time to look to the Fediverse for an alternative.

Search for help on programming and chances are the first five results you get back from your search engine of choice will be from Stack Overflow. If you ask the Internet something more niche, such as how much do sea turtles grow in a year or what fertilizer should you use to make the leaves on your basil grow more luscious and juicy, many of the responses will come from Reddit (that is, unless you use Google, in which case your first 10 results will be ads).

The point is that Reddit, originally designed to be a user-powered news aggregator, has become an excellent resource for specialized, obscure, often wacky knowledge and in-depth discussions. One hundred-percent of the content is generated and curated by the users, and the combined effects of splitting topics into subreddits, peer-moderation, and the upvote-downvote system itself often manages to keep content relevant, interesting, and helpful.

Alas, decadence arrives to all proprietary platforms. In a process technically known as "enshittification" (a term coined by Cory Doctorow [1]), as a centralized and corporate-owned platform grows and requires investors, and, hence, a viable business plan to keep it economically viable, more and more anti-features are introduced. Typical anti-features include ads, premium features, limitations on access to data, etc. The user experience gradually worsens until the platform reaches a breaking point, and the community – the only real, organic valuable asset a social platform has – leaves. It is happening at breakneck speed on Twitter, it is happening bit by bit on YouTube, and the process started years ago on Reddit.

The latest recent changes to API policies implemented by Reddit's owners have accelerated this process and prompted hundreds of subreddits to close doors and make their communities private, impeding non-subscribed users (and search spiders) from browsing them. When Reddit's admins threatened to remove mod privileges, mods opened up the subreddits, yes, but labeled their communities as NSFW (which meant no ads would be displayed within them, hurting Reddit's bottom line) or flooded their communities with photos and clips of John Oliver, making them to all practical effects useless. More threats were issued.

The process of enshittification is a one-way street. It may bring short-term (monetary) gains to the site's owners, but the degradation always becomes worse, and users leave. When Reddit decided to close its source code back in 2018 [2], users recognized the writing on the wall and immediately started thinking about creating alternatives. A year later, Lemmy [3], a Fediverse-powered alternative (Figure 1), emerged.

Figure 1: Lemmy looks very similar to Reddit on the surface.

Features

Because this is the Fediverse, the first step to registering as a Lemmy user entails picking an instance. As with Mastodon and PeerTube, Lemmy instances can be general, regional, or thematic [4], notwithstanding which, a properly federated instance will allow you to access, browse, and interact with most other instances, and therefore read, subscribe to, and post to communities, either local on your instance of choice or remote.

A note about terminology before I go any deeper: As with Mastodon, PeerTube, Pixelfed, etc., an instance in Lemmy is a Lemmy server someone has set up to host communities. Some instances are open and you can just roll up and register; some are closed and require an invitation or the approval from the owners. If you have a bunch of friends and a rent a spare server online, you set up your own instance for your friends, family, school, or work colleagues and hook it up to the rest of the Lemmy network, a process called federating. I will talk more about how to set up your own instance later.

Meanwhile, communities are equivalent to the subreddits on the Reddit site (i.e., theme-based groups for aggregating news, posts, and comments on a specific topic, such as Doctor Who, London, or World News).

On the surface, Lemmy's default layout (Figure 2) looks very much like Reddit. A list of posts (4) with their upvote/downvote buttons (7) take up most of the space, but a closer look will reveal some differences. Across the top, you can always go back to the home page by clicking on the Lemmy logo and name (1). If you are not logged in, the home page will be the highest scoring posts in the local instance. If you are logged in, it will be the highest scoring posts in your subscribed communities.

Continuing across the top from left to right in Figure 2, the Communities link (2) takes you to a page with a list of communities. You can choose to see the communities you subscribed to, local communities on the instance you signed up with, or all the communities across all the instances that federate with your instance.

Figure 2: A breakdown of Lemmy's front page.

Next up, Create Post (3) does what it says on the box and takes you to a form (Figure 3) ,which will allow you to create a post on this instance and pick a community to receive the post.

Figure 3: The form for sending news items is straightforward.

Back on the main page shown in Figure 2, you can choose whether to see Posts or Comments (4), whether you want to see only posts (or comments) on your Subscribed, Local, or All communities on all federated instances (5). You also have the option of changing how they are ranked (6).

Ranking is more complete on Lemmy than on Reddit, allowing you to order posts according to most Active, in which the rank of a post is based on the score and time of the latest comment, with decay over time; Hot, similar to active, but uses the time when the post was published; New, which shows most recent posts first; Old (self-explanatory); Most Comments, which shows posts with the highest number of comments first; New Comments, which ranks first posts when they receive a new reply; and then you can choose to see the highest ranking post of the day, week, month, year, or all time.

When you click on a post's title (7), you will be taken to the post on Lemmy, (in Reddit, you will be taken directly to the linked article). To go to the linked article itself (if the post indeed links to a site outside of Lemmy), click on the link just below the headline. In the lines below that, you can check out the poster's history and the community the post was sent to. On the bottom line, you can visit the comments section, the star icon saves/bookmarks the post for later reading, the copy/paste icon lets you crosspost the news item somewhere else, and under the three vertical dots you have the option of reporting the post and blocking the user.

As mentioned earlier, you can post directly from the front page, but you can also do that from within a community. In this case, by default, the box where you choose the community to post to shows the current community.

Another step up from Reddit is that, while on Reddit you can publish either a text post, or a link, or an image, Lemmy lets you do all at the same time. You have a field for a URL and another for text, in which you can embed images and videos in the same post using Markdown text formatting. Comments are equally versatile and allow Markdown formatting and embedded media just the same as posts [5].

Federation

However, Lemmy's most interesting features come from its Fediverse pedigree. As with Mastodon and PeerTube, a service such as Lemmy, spread out over multiple servers, is more than its parts, allowing for a community to rival the power of a megacorporation. At the same time, this makes the service less likely to be bought out or co-opted by a single player.

Lemmy allows you to access communities on your local instance or federated instances transparently, read news from throughout the network, and subscribe to remote communities from your own instance and send your votes, posts, and comments to them. Integration with other Fediverse services also makes it an exciting proposition. Crossposting and following from and to Mastodon is already working well. Add the name of the Lemmy community and name of the instance it is hosted on as follows:

@communityname@instancename.domain

to any Mastodon toot, and it will appear as a new topic in the community and on that instance, and can be voted up or down and shared and commented on like any other post.

For example, adding @kde@lemmy.kde.social to a post will make the toot appear as a post on KDE's Lemmy instance (Figure 4).

Figure 4: To send a toot from Mastodon to Lemmy, include the address of the community you want to send it to in the body of the toot.

Following a Lemmy community from Mastodon is simple, but the results can be messy. It is simple because you can search for a Lemmy community from within Mastodon by searching for @communityname@instancename.domain as above, and then follow the community like any other Mastodon account. It is messy because every post on the community you follow will show up as a toot in your notifications, and every comment as an unfiltered, public reply to the post. If the Lemmy community you follow is popular, that is a lot of noise! Also, at the time of writing, Lemmy's text formatting (which uses Markdown) and attached images do not translate well to Mastodon, making things like commented text confusing and posts boring, because images or videos are usually not included.

But the feature is there. We should expect it to improve over the next iterations of the platform.

PeerTube integration has also made it into Lemmy, as announced in version v0.16.4 [6], but it works so-so. I was able to see a PeerTube channel from Lemmy (Figure 5), but I was unable to see any of the videos or subscribe to it, either from Lemmy or on PeerTube using my Lemmy account.

Figure 5: Lemmy can find PeerTube channels, but total integration with the Fediverse's video platform is still not all there.

Again, this is something that will improve over future versions.

Roll Your Own

Setting up a Lemmy instance from scratch, or even with Docker, is not for the faint of heart. There are multiple convoluted steps and the documentation [7] often misses steps or is just downright wrong.

Thankfully, the developers have also created an Ansible installer [8] and have made it the only officially supported method for installing Lemmy, and with good reason: It works really well and cuts out a huge chunk of the drudgery.

Note that the installer is only designed for Debian-based systems at the time of writing, so you will have to be running Debian, Ubuntu, or something similar on your server for this to work.

Apart from that, to prepare your server, you will need to be able to access it using SSH keys, and the user you access your server with will need passwordless access to sudo.

To set up authentication with your server using SSH keys, set up a pair of private/public keys using ssh-keygen on your local machine. Then you can use ssh-copy-id to copy over the keys to you server:

ssh-copy-id yourusername@yourserver

where yourusername is your username, and yourserver is the address of your server.

Access your server using the keys to check that it works, then remove password access by editing the /etc/ssh/sshd_config file on your server and changing the line that says

PasswordAuthentication yes

to

PasswordAuthentication no

and restarting the ssh service:

systemctl restart ssh

You will need superuser privileges to do both things.

While you are still in superuser mode, set up your passwordless access to sudo by creating a file in /etc/sudoers.d. The name of the file doesn't matter much, but it is a good idea if it is the same as the username you are using on your server. Add the following line to the file:

yourusername ALL=(ALL) NOPASSWD: ALL

and save it. Exit superuser mode and check that your regular user can now run superuser commands without the need of typing in a password:

sudo su

You can now exit your server.

One last step before getting into the installation proper is to add your key to ssh-agent in your current session on your local machine. The reason is that the time out for typing in the password for you key during the Ansible install is ridiculously short, so it helps if ssh-agent can deliver it for you.

Start ssh-agent with

eval "$(ssh-agent -s)"

and add your key:

ssh-add ~/.ssh/id-rsa

ssh-agent will ask for the password for the key and will add it to its keyring.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Introduction

    This month in Linux Voice and Elvie.

  • PeerTube

    PeerTube, the Fediverse's video platform, offers a decentralized, open source way to watch videos and live stream your own content. We'll show you how to get started and even set up your own instance.

  • Fediverse Introduction

    Do you have to you give up your privacy to enjoy access to social media? The makers of the Fediverse say no.

  • Mastodon

    Get started with free microblogging, interact with others who share you interests, and even help expand the Fediverse with your own Mastodon instance.

  • Tutorial – Fediverse

    If you're looking for social media options where the user has more control, you'll find a range of options to explore in the Fediverse, including the popular Mastodon.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News