Mastodon is a decentralised social media platform that you can host yourself
The topic of de-platforming has been discussed a lot lately between Trump getting booted off Twitter and Parler getting kicked off AWS. With most major social media sites cracking down on certain users, people have searched for alternatives. Unfortunately, some of the alternatives have gathered a less than desirable reputation for their user base. In this, I’m going to explain how you can automatically set up mastodon on your server with an Ansible script.
Mastodon is a social media site unlike any other. Instead of accessing a website running on some data center owned by a giant tech company, Mastodon is an open-source software project that anyone can use to create their own customizable instance. Each Mastodon instance can communicate with each other, and the site owner determines what can and cannot be done on their instance.
Before you start installing things, you’ll need to harden your SSH and set up fail2ban as recommended in the Mastodon documents. I previously wrote an article on how you can do that, which can be found here.
Next, you’ll need to set up your DNS record for your domain. If you bought your domain with GoDaddy or any other domain registry, then just point your record to your server IP address.
There are two main methods to install a mastodon instance. You can do it from scratch or use an Ansible playbook to do this automatically. I explain all the details for how to install from scratch in my video above, so go watch that if you want to do it the proper way.
However, I also decided to show you how to use their ansible-playbook to automatically set up all the dependencies and services in my instance. The playbook can be seen in the GitHub below.
One thing to note when running the playbook is that it’s wise to add the sudo password command as you mightn’t be able to type it in when the script is running remotely. Simply run the following on your Local Machine.
ansible-playbook bare/playbook.yml –skip-tags=postgres -u
That’s basically it. Once the playbook runs without error simply go onto your server and run the following commands.
su – mastodon
RAILS_ENV=production bundle exec rake mastodon:setup
Unlike a typical social media site, you’ll be able to have a more close-knit experience and you’ll have complete control over your data and who uses your instance. If you get stuck there are some additional explanations in the video above.
Stay happy and stay private.
My Website: https://eoincoogan.com
My Articles: https://articles.eoincoogan.com
My Github: https://github.com/CoogyEoin/