Build a self-hosted Fediverse server
Big Social has you, monitoring 24 hours a day all year round. Learn how David Rutland breaks free into his own self-run Fediverse echo-chamber.
We don’t think you need to be told that social media – in the form it exists today – is a mess. Users are ruled over by gigantic corporations with their own agenda and unfairly applied rules. They give a voice to absurd people (who you despise), while silencing your own, perfectly reasonable and rational opinions. How very dare they!
Doomscrolling has become a way of life and your social media feeds are optimised to keep you hooked, depressed, angry and engaged as you swipe through an endless stream of misery and outrage.
And don’t forget the Facebook and Twitter tracking widgets scattered across the internet. Every site you visit which has a ‘Facebook’ button reports back to Facebook that you’ve been there, allowing the Zuck and his minions to build a granular picture of your activities, interests, identity and sell adverts based on that.
While the company now known as Meta (for some reason) does offer a tool which it says will prevent it from linking your off-Facebook activity with your Facebook account, we can’t say that we trust them. Social media sites aren’t nice is what we’re saying, and you should avoid them all whenever possible.
Yet there’s a certain joy to be had from interacting with people online in a social media setting (raging political and ideological arguments aside). Joining groups with a common interest is great, and talking in real time to strangers who are into what you’re into is actually fun. Sometimes (and we’re loath to admit this) it’s just nice to scroll through dog (cat–Ed) pics all day. With Facebook, Twitter and all of the other predatory data-slurpers a hazard to your health, where are discerning readers going to go when they want to discuss topics raised in the latest issue of Linux Format, pets and fine art?
Enter the Fediverse
Social networks may have been pioneered by Mark Zuckerberg, Jack Dorsey and MySpace Tom, but they don’t have a monopoly on it.
In true open source style, the look and feel of Facebook, Twitter and even MySpace have been assiduously studied and copies – or tributes – made that give you the full social media experience but without the tracking, data mining, rage-feeding and exploitation that comes packaged with the originals. There’s an entire universe of people interacting moreor-less calmly, exchanging information, humour, cat pictures, articles, memes and technology.
By employing a common set of standards known as ActivityPub distributed social media protocol, users are able to start their very own social media servers on a budget, and populate it with their friends, relatives and neighbours. It’s fairly simple to do and we were able to deploy a simple Hubzilla hub on a lowly Raspberry Pi Zero 2 without an undue amount of difficulty. On our more powerful Raspberry Pi 4B, we have a Pleroma instance running 24/7 alongside a bunch of other web-facing software, and it doesn’t even break a sweat.
But the fun doesn’t stop with just the users on your own server. Running a server that adheres to the ActivityPub standards means that you can interact with users on other servers that also use the standards. We say that the servers are federated – hence the name of this phenomenon is Fediverse, Simples.
Even if your own server has only one user, you can follow people on servers devoted to cats (dogs?–Ed), computers, art or, if you must, adult content. And users on those servers can follow you back.
An unofficial LXF social server
From the plethora of Fediverse servers out there, we chose to go with Soapbox, by developer Alex Gleason. Our reasoning was simple: it’s designed to look similar to Facebook, which most people will be familiar with.
Soapbox is largely built on Pleroma, and reuses a lot of the code, so if you see commands specifically for Pleroma, we haven’t forgotten what we’re doing and remember: it’s not plagiarism, it’s FOSS!
While we’d love to give you a one-line Docker command you could run to get Soapbox up and running, there isn’t one available. So before you get started, go and make a cup of tea. You can check for updated instruction here: https://soapbox.pub/install.
Start socialising
First, make sure you have all of the dependencies:
$ sudo apt install git build-essential postgresql postgresql-contrib cmake libmagic-dev imagemagick ffmpeg libimage-exiftool-perl libssl-dev automakeautoconf libncurses5-dev
Note that we’re going to be using Postgres database instead of our much beloved Maria, and in total the dependencies will require downloading almost 900MB. This seems like (and is) a lot, but if you’re renting a quality VPS then it should only take around a minute.
For security reasons, it’s advisable to run Soapbox as a separate user with limited privileges, so:
$ sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma
Clone the Soapbox repository:
$ sudo git clone -b soapbox-v1.1.1 https://gitlab.com/ soapbox-pub/soapbox /opt/pleroma
and grant ownership of it to your new user:
$ sudo chown -R pleroma:pleroma /opt/pleroma
$ cd /opt/pleroma
and then sudo -Hu pleroma bash to become the new user.
Next, you need to install a specific version of Erlang and to do that, you will first need to get hold of the asdf
version manager: git clone HYPERLINK “https://github.com/asdf-vm/ asdf.git”https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0 echo ". $HOME/.asdf/asdf.sh” >> ~/.bashrc echo ". $HOME/.asdf/completions/asdf.bash” >> ~/.bashrc exec bash asdf plugin-add erlang asdf plugin-add elixir asdf install
Yes. It seems unnecessarily complicated, and no, it won’t work if you use the stock versions of Erlang and Elixir. Every Pleroma and Soapbox admin needs to do this, and fortunately, you only need to do it once. Again this will take a while, especially on a $5 VPS, so if there are any Sudoku puzzles that you’ve been wanting to complete, now’s your chance.
Once, Erlang and Elixir are finally installed, mix local. hex --force and mix local.rebar --force to install some Elixir tools. mix deps.get will fetch dependencies.
Finally, compile Soapbox and drink more tea with:
MIX_ENV=prod mix compile
Once that’s done, Soapbox is installed, but it’s not ready to use quite yet. First you’ll need to configure your instance. Running:
MIX_ENV=prod mix pleroma.instance gen
will enable you to set the URL, instance name, and whether or not you want it to be indexed by search engines. You should leave the database details, IP address and port numbers with their default values,
When the config generator has finished, move the generated config with:
$ mv config/generated_config.exs config/prod.secret.exs and exit the pleroma user.
Now, we’re acting as the postgres user to establish the database:
$ sudo -Hu postgres psql -f config/setup_db.psql
Then as the pleroma user again, we migrate the database with the following:
$ sudo -Hu pleroma bash -i -c ‘MIX_ENV=prod mix ecto.migrate’
There are in excess of 500 files to be compiled, but it only takes around three minutes.
Copy the Systemd service:
$ sudo cp /opt/pleroma/installation/pleroma.service / etc/systemd/system/pleroma.service
Then start and enable it.
$ systemctl enable --now pleroma.service At this point, your Soapbox server should be up and running, and the next step is secure SSL certificates with the following:
$ sudo certbot certonly --email your@email.address -d yourdomain.com --standalone
And now you can set up your reverse proxy to work with your new domain.
Fortunately, the developer has included two sample configuration files: one for Apache, and one for Nginx. They are named pleroma-apache.conf and pleroma. nginx. You can find them by navigating to /opt/ pleroma/installation/.
cp the one you need to either /etc/apache2/sitesavailable/ or /etc/nginx/sites-available/.
Edit the file with sudo nano pleroma-apache.conf (or pleroma.nginx ) and change all instances of example.tld to your domain name.
Activate with sudo a2ensite pleroma-apache.conf then restart Apache: sudo service apache2 restart .
The final thing to do is to create your admin user
$ cd /opt/pleroma then:
$ sudo -Hu pleroma bash -i -c ‘MIX_ENV=prod mix pleroma.user new
Confirm the details, then copy the password reset URL and paste into your browser to set the admin password. At last, you can log in and look around.
Boy in the bubble
Initially, there will be nobody in there with you, and even after adding friends to your server, it’s still short of the full social media experience that you were probably expecting. Head over to https://fediverse.space to find a server map, and look at the latest posts to find someone who you might want to follow.
Add them by copying their handle, pasting it into the Soapbox search bar (soap bar? – Ed) and click through until you find a follow option. Make sure that you use all parts of the username, for example @david@social.lxf. by. The first part indicates the local username, while the second part is the identity of the actual server. All very straightforward.
Once you’ve added a few people, their posts will start showing up on your timeline. You can reply to them, react to them, boost, or repeat them.
In Soapbox, you have three timelines: Home, Local and Fediverse. Home displays your own interactions and people who you follow, while local shows only the actions of users on your own server. Finally, Fediverse shows activity on your own server, friends on other servers together with interactions that they have with other people. Again, you can dive into a conversation at any time.
Following users means that you’re exposed to more users and before you know it, your little Soapbox server will be like a window on to a complete universe.
If the main point of creating your own social media server was to silence critics and live by your own rules, you’re in luck. Soapbox offers a full range of admin tools and it’s up to you to set the rules and enforce them however you see fit.
On the right-hand side, below the menus where you set up your profile and preferences, is a grey tag cloud. This is where true power resides.
In addition to the Blocks, Mutes, Filters and Domain blocks – which give your citizens some degree of control of their interactions, you’ll also see Soapbox Config (basic configuration), and AdminFE.
Inside AdminFE is a truly staggering array of options and settings, including moderation policies upload limits, maximum length of posting (we’ve limited ours to a mere 50,000 characters). You can also block, ban and otherwise censure your users.
As admin, you’re the king of all you survey. Use this immense power however you want. After all, if your users don’t like it, they can always go and set up their own server elsewhere!