Rolling my own Mastodon

A short write-up about setting up my own Mastodon instance

2022-11-08 21:45:17 +0100 +0100

I admit I had not paid much attention to Mastodon. Sorry! But along with 70,000 others, recent events1 pushed me enough to check it out.

Can I have an account please?

My first inclination was to find a popular instance and make an account there. Mastodon is a federated network, so you can talk to others across instances. The problem is, most instances are growing so rapidly this week that administrators shut off account creation for most of the well-known ones. Even paid services like masto.host which provide fully managed hosting for a fee (note, less than $8 😉 per month) are temporarily shut.

I noticed in the docs there’s a section for “Running your own server”, thought, “how hard could this be?” (spoiler: moderately hard!) and got to work.

Hosting

This is easy. I already have a DigitalOcean account that I use for small projects from time to time. Creating a new Droplet with backups is $7.20.

creating an instance on DigitalOcean

Assigning a domain

This was also easy. I have some domains managed via Fastmail. Adding an A record to point to my new server took less than a minute:

pointing a subdomain to the server

1-click install?

The running your own server docs point out that there’s a 1-click installer for DigitalOcean. That sounded intriguing, but the install version is 3.1.3 (latest version is 3.5.3), and Ubuntu image is 18.04 (latest is 22.10). So, I left that option to the side and went forward with the innocuous sounding preparing your machine docs.

Preparing your machine

This part was pretty straightforward: lock down SSH, update system packages, and set up a firewall. Rather than muck around with iptables or ufw I used DigitalOcean’s firewall.

Then, the difficult part, installing from source.

Installing

To be clear, this document mostly worked and some of the frustrations are due to my misreading.

In fact, right at the top it says:

A machine running Ubuntu 20.04 or Debian 11 that you have root access to

while I am running 22.10. This probably led to some of the subtle annoyances which I’ll outline quickly here:

tl;dr if you build from source yourself, you should probably use Ubuntu 22.04 or Debian 11, and not Ubuntu 22.10 to save your self some headache.

Success!

After all that, I was able to create an account for myself with the CLI. And the result:

I spent a bit of time looking around at how to get linked up with other instances and then realized I just had to start following accounts!

I did some basics like 1) shutting off account registration, as this is just for myself, for now, and 2) setting up 2FA. Everything was easy and intuitive in the admin.

So, there is my $7.20 and ~45 minute tale of setting up my Mastodon instance. Not sure how long I’ll keep it going before migrating to an instance managed by someone more responsible than me, but I love that this is even a possibility. See you there!


  1. a.k.a repugnant billionaire taking an axe to human rights and content moderation teams, among other things. ↩︎