Running Sharkey
14 July, 2024
After using federated social media for a while, you start to run into people who run instances. You can often find people that run instances of all sizes, from large, public instances to small, even single user instances. When you see people running their own instance, you eventually get the idea of "what if I ran my own instance?"
The Idea
For me, this thought came up around 2 months ago, in the middle of May 2024. There were various reasons, partly to avoid fedi drama and instance blocks, and also because I needed a new project to work on.
The all important Domain Name
Of course, the first step in making a fedi instance is choosing an appropriate name. Originally, I wanted to use the domain feliscat.us. In theory, this would be pretty easy for me to get: I am a US citizen, so I could get a .US TLD. But, when I went to go register the domain on Porkbun (I highly recommend them, they're great!), I got warning after warning that I would not be able to hide my information from a WHOIS lookup. Basically, anyone would be able to see my legal name, and my physical and electronic mail addresses.
After some considering, as well as some help from some friends, I eventually settled on the domain catwithaclari.net. Once I got that domain registered (which was fairly cheap, as it's just a .net domain), my problems were only just beginning.
Reversing the Proxy
The first thing to set up was a reverse proxy. Due to the way my home network is set up, I can't do just port forwarding. In the end, I decided to use fly.io to host a reverse proxy, using frpc. I had already used this before, for a Minecraft server (which unfortunately is now dead), so I had a little experience with it. Although, as I would qiuckly learn, proxying a Minecraft server is very different from proxying a web server.
All good things must end
Along with setting up the reverse proxy, I also needed to set up the nginx proxy. After much fiddling, I managed to get everthing set up and working. For a couple weeks, everything was working fine, with no issues. Then one day, the server crashed. Normally, this would be fine, but somewhere between when I got everything working and when it restarted, some of the nginx config files were edited and were not tested. What this resulted in was somewhat complicated. The server was federating fine (as in properly recieving and sending posts) but nothing was automatically updating. If I refreshed the page, I could see new posts on the timeline, but it no longer automatically showed new posts as they came in.
The Solution
After much struggling, I eventually was able to find the problem. With the help of various people, we discovered that, for some reason, websockets were disabled. After some messing with the nginx configs, I was eventually able to get everything back up and running again.
What else?
Now that my instance was fully up and running, there were some other things that needed set up. First up, was moving my Sharkey IP to point towards the same reverse proxy as the blog and other services, so that I didn't have to run two reverse proxies. After I got all that set up, I also got SSh secured and set up so that I can access it when I'm not at home.
Conclusions
So, would I recommend running your own instance? Well, it really depends. If you have a lot of technical experience with nginx and docker and other sorts of system management software, I would totally reccommend it! Another thing to consider is hardware: I was lucky that I have my own physical server, but if you used a much lighter fedi instance, you could run your instance on a cloud VM. In the end, i think it was all worth it, since trying to run an instance has really showed me a lot of things in the deep end of Linux usage that I never would otherwise have learned. If you're looking for a project and have the spare resources floating around, I say, go for it! There really is not much downside to running you onw instance. Just remember to take regular backups!