A deep dive into Mastodon
NGINX Configuration
Mastodon comes with a sample configuration file that you can copy over for NGINX to use. So set up your sites
directory for NGINX:
mkdir /etc/nginx/sites-available
and copy it over:
cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
You will also have to enable it by creating a soft link in the nginx/sites-enabled
directory:
mkdir /etc/nginx/sites-enabled ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon
Edit the file to adapt it to your instance (see Listing 5), and add the following line:
include /etc/nginx/sites-enabled/*;
in the /etc/nginx/nginx.conf
file within the http
section.
Listing 5
Mastodon NGINX Site File
. . . server { listen 80; listen [::]:80; server_name [your domain here]; root /home/mastodon/live/public; location /.well-known/acme-challenge/ { allow all; } location / { return 301 https://$host$request_uri; } } . . .
When you visit your page, you should see an error screen with an angry mammoth bashing a keyboard (Figure 12).
Don't panic! This is really good news. The error is there because you still have to start the Mastodon services. To get everything up and running, Mastodon starts three services: Sidekiq, for Ruby jobs Mastodon has to run in the background; Streaming for the feeds; and the Web service.
To start the services, use systemd. Copy over the Mastodon service files to systemd's service folder:
cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/
and start and enable Mastodon's services:
systemctl daemon-reload systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streaming
You are done! Reload your Mastodon, and happy tooting.
Post Install Setup
You can now log in using the email you set up and the password that was provided during the Mastodon configuration step.
Visiting Preferences as admin will show you a bunch of settings not available to regular users. With your newly running instance, probably the most important section is Administration, and, under that, the Server Settings subsection. There you can change the name of the server, define who can register, and configure other settings.
Another important consideration is the set of rules you apply on your site. You can define rules against harassment, hate speech, toots about billionaire owners of competing platforms, and so on, by visiting Administration | Server rules.
To make sure rules are followed, visit the Moderation section, where you will be able to check reports from users, set up accounts with special roles (moderator, admin, owner), block certain domains from federating with your instance, and more.
There are many more options, of course, but most are self-explanatory. That said, if you need more information, your best source is the Mastodon docs themselves [13]. Federating with other instances it is more or less automatic: Find a user on another server you would like to follow, for example mailto:@linuxmagazine@fosstodon.org, and follow them. Bam! You're federated.
Conclusion
Despite the length of this article, there is more, much more, to Mastodon. How could there not be? At this moment of writing, Mastodon is just shy of 9 million accounts and has added 50 thousand new users in the past 24 hours. The landscape is constantly shifting, and new features are continually added to the platform.
This article will get you off to a good start, but be prepared to explore Mastodon and the Fediverse with an open mind, because tomorrow you will find exciting new things to play with.
Infos
- Mastodon: https://joinmastodon.org/
- Cory Doctorow, "Tiktok's enshittification":https://pluralistic.net/2023/01/21/potemkin-ai/
- ActivityPub: https://activitypub.rocks/
- Linux Magazine on Mastodon: https://fosstodon.org/@linuxmagazine
- A curated list of Mastodon servers: https://joinmastodon.org/servers
- William Shatner (yes, that William Shatner) uncovers a flaw in Mastodon: https://twitter.com/WilliamShatner/status/1218176903107895296
- WPCode for WordPress: https://wordpress.org/plugins/insert-headers-and-footers/
- Pixelfed: https://pixelfed.org/
- PeerTube: https://joinpeertube.org/
- Mastodon mobile apps: https://joinmastodon.org/apps
- Fedilab Mastodon client: https://f-droid.org/en/packages/fr.gouv.etalab.mastodon/
- Fail2Ban: http://fail2ban.org/wiki/index.php/Main_Page
- Mastodon docs: https://docs.joinmastodon.org/
« Previous 1 2 3 4 5
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.