# What’s Mastodon
I am not going to explain this here, so sorry! An explanation of Mastodon deserves its own post and I don’t have time right now. Need to write out more technical stuff while it’s still fresh in my brain.
However, I will very likely write out a blog post about mastodon and decentralized web in general, since I’ve been proselytizing (is that the word?) to people in real life for months and I’ve gotten fairly good at the spiel.
And when I do, I promise it will be linked here!!! But anyway, getting into the details.
# How it started
When I first joined Mastodon in May 2022, I did what almost every noob coming from Twitter did: I joined mastodon.social. It’s the biggest instance; I didn’t want to choose a niche – or rather, those that I was really interested in shut down – and really, it was comfortable. Typical sign in process, don’t need to talk to anybody.
After a few weeks, I also created an account on a second instance, mastodon.art. I posted a couple of things on there. It was kind of cool.
Eventually I realized that I didn’t particularly feel like segmenting my presence online, but mostly, I was really excited by the prospect of being more in control of my online presence. While browsing instances to join, I saw stuff like forks with custom functionality; fake dates (unless those people really joined 400 BC! real early adopters); fun themes…
I don’t know, it just seemed fun to self-host.
# Why self-host?
Mastodon is built to be decentralized. There’s a lot of benefits that come with that; the biggest one being small websites are less costly to run, and therefore the need to earn money (by doing stuff like selling ads) – is much lower.
However, it is also built with the idea in mind that each instance will contain multiple users.
I chose to self-host, even though I’m basically wasting the resources of a larger website on just myself, because:
- I didn’t want anyone else to control my data, see my messages, or moderate me
- I wanted to tinker with the code and potentially contribute
- I wanted to mess with the CSS like on myspace
- I wanted to create bot accounts! (like one for posting my blog posts, and one for my calendar)
# How I went about it
My first step was to go to masto.host in August 2022. Big props to the person running it; it cost me 7 euros a month and was simple and reliable. The limitations were that basically I couldn’t personally mess with much code – the best I could do was some CSS overlays from the client.
I made a social.
subdomain off my main domain and hosted my mastodon instance on there. I will say, I think I’m a bit of a trendsetter, because I don’t recall seeing anyone else doing that before, and I’ve seen a good handful since!
The other little hiccup was that when the servers were super overloaded (in the great exodus of Autumn 2022), I couldn’t upload files for a day or two. And also, I can be pretty verbose; I wanted to, for example, extend my post character limit, but that wasn’t an option.
# Moving to full self-hosting
So in January 2023, I downloaded my backup from masto.host (again, much love, they do such a good job making the backup easily available), and went through the docs for hosting Mastodon on a DigitalOcean droplet - what Mastodon and DigitalOcean both to as one-click install, which to be honest is uh……………… misleading.
Don’t get me wrong, the docs are pretty good, but still, the process was not silky smooth!
The big difference is that there is a Mastodon initialization wizard that comes preinstalled on your droplet. However, it is still pretty rocky, especially if you don’t know in advance everything that you’ll need. It’s an all-in-one command, as far as I know, so if you get one thing wrong you have to start all over. It also launches every single time you open the console - like bro, I am not trying to set up a new Mastodon instance from scratch every single time I open the console. Anyway. I am not sure I would really recommend it vs just getting a blank slate droplet and going through the Mastodon docs, which is what I ended up doing for most of the time anyway.
# Some pointers, in no particular order
# Overall
- You’ll need an SMTP mail server. I ended up using mailersend.com, it’s pretty great so far, and free. It just needs 24 hours to get approved.
- I’d probably still vouch for digitalocean, but again, I’m not sure the managed droplet is worth it. So if it ends up making you need a more expensive server or something I’d say give it a shot to do without it.
- Storing your SSH and other access keys in a password manager! Not just for safety, it’s also nice to have them in a central place vs. having to find them off websites.
- Doing stuff impulsively with no notice to the folks on my server was the luxury of being a solo instance :D but other people might want to be more prepared, bc this can take a while. And even as a solo instance, I basically just disappeared for a month for all the people who were interacting with me.
- I just found this very thorough walkthrough that probably would have helped me a bunch!
# For restoring a backup
- This blog post was a great starting point, though they use docker.
- I uploaded my backup to my droplet. The Digitalocean docs recommended installing filezilla; I ended up using VSCode with the Remote-SSH extension and just drag-n-dropping my backup on the
/
folder! (The connection kept dropping though, so I used the droplet’s web console for the majority of my other operations.) - when restoring your db, you’ll want to first create a postgresql user that corresponds to your backup, which in masto.host’s case is not the default
mastodon
but rather a username that’s specific to your masto.host account. I figured out the name when trying to runpg_restore
because it was in the error message. - That postgres user’s going to need more permissions in order to write to the db as you use the app; I gave it Superuser with
ALTER USER <user_name> SUPERUSER;
. - you’re probably going to be switching back and forth between your root, mastodon, and postgres users with
su <user>
(thenexit
should bring you back to root) - If you’re using a digitalocean droplet, it’s a pretty good idea to also get a Digitalocean space to host your content.
- After restoring your db, you should be good to log in and stuff, yay! But there will likely be some errors and you’ll need to reupload your files. I’m still working on getting avatars to show back up – just accidentally deleted my whole db trying to clear my cache. oh wellzzz
# Next steps
On the technical side, I still need to reupload all my media and there’s still some bugs to iron out, but I am soooo excited to start messing with the code!
On the social side, I am considering now hosting an instance for friends and family – I got faso.social for this purpose. Just not that excited about being a moderator, so my instance may be a bit unruly because I’ll probably just let my people do whatever they want.
And somewhere in the middle: now that I have an SMTP server, I feel like I should revive my email newsletter? or are people not really into that anymore? let me know!