Self Hosting - 2024 edition

18 Jul 2024

Tags: admin, cloud, hosting

Starting in around 2018 or so I decided to start reclaiming my Internet. Before then, as most people had I suspect, I’d drifted into relying on cloud services for just about everything I could possibly want, but by that year I think it’d become apparent to me that I didn’t like relying on other companies as the main host of my digital legacy. There was no one thing, but it seems time and time again large internet service providers like to make sure I feel glad that I’ve done this by finding new ways to exploit their users’ data.

That said, I’m somewhat pragmatic about it, as hosting all the things is hard and time consuming, and I really don’t like doing system administration. There’s nothing wrong with it, and I know many people who enjoy doing that, but it doesn’t really bring me joy. So I’ve ended up with a mish-mash of things that I personally host locally, personally host on other servers, and let other people host for me.

Anyway, this page is an attempt to snapshot what I have done and why, along with what has worked and what needs work still. I do this both to help future me and as I occasionally see posts of people wondering if they should or shouldn’t host their own stuff, and perhaps this’ll help them decide if that’s right for their needs or not.

Self hosted cloud

As already stated, I dislike having to do system administration any more than necessary, so cloud servers I host have to be very simple to both set up and maintain, and it’s why some things I just don’t do (e.g., see email later). But I have ended up hosting a bunch of things that are web based on a small set of VPSs (aka virtual machines someone else hosts), all of which are mostly quite simple to set up, and all have very similar dependancies which makes maintenance easier.

For this I still use linode for hosting as their control panel is super easy for me to use, they are relatively cheap, and my needs are quite simple.

Websites

I host three websites, my personal one, this one for tech stuff, and one for my guitar building and other maker things. At times it’s felt important to draw a line between the three, though these days I’m less sure of the need to do so, but I know I’m in good company of having far too many blogs.

All my sites are static sites: that is the content is served from files of content on disk, and not generated on request from some service using live code and a database. In the past I’ve used those, but they need updating and they store content in a database which makes it hard to fiddle with. At some point I said to Niddrie with all that, and hosted my things on Squarespace, but as I got more and more content I was frustrated at the lack of flexibility, so finally went back to hosting myself.

This time though I write everything markdown and convert that to HTML pages using a tool called Hugo, and then I use rsync to copy the generated pages and images from my laptop to the server. The server is just using Nginx for the actual serving data, and Let’s Encrypt for the HTTPS certificates. As I’m a nerd I have taken advantage of a bunch of features of Hugo in terms of letting me generate things from data as well as text, but that’s not necessary to do so if you don’t want to.

The nice thing about this setup is that there’s next to no state on the machine that can’t be recreated by just recompiling the site on my laptop and copying it over again, so if the machine was deleted I don’t really care, I could set it back up again pretty quickly. That said, I do use Linode’s backup system so that I can just restore the machine if I need to.

One downside of my current setup is that it means I need a copy of my site to edit it - I can’t just log into a web portal to add new content from any old device I happen to be on. To make this post I had to get my laptop that has the site code on it. The site is in git, so I could check it out on another device, but you get the idea - this isn’t ideal for those who need to share the editing responsibility for instance.

All of what I do here is fairly typical of anyone hosting a static website, but with one slight oddity: search. I wanted a search facility, and for that I need something dynamic to do the looking up when someone enters a search term. I did a long time ago use a client-side search library, where the client downloads a corpus of pages and terms and searches it using javascript in their browser, but at some point that no longer scaled. I failed to find an existing search system for a static site, so in the end I wrote my own - a little search engine in Swift that does run on my server. Thankfully this is a single binary that has to run and it doesn’t use a database, so it’s easy for me to administer.

One final note here: I have found that having my own website that’s simple to administer is fun, in that I can play a little bit when the mood takes me with new CSS stuff for instance, but the static nature of the website stops me getting to carried away and creating a beast that would be un-fun again.

Matrix

The bane of my computing life is that I seem to need run half a dozen different IM clients to talk to people, and all of those are based on commercial, closed servers (even supposedly open services like Signal and Wire). At work we use Matrix for our group and one-to-one chat, and although I could just register on someone else’s server, I opted to set my own Matrix server up so I can own my identity here - matrix is a federated system, so although I exist via my own server, I can partake in discussions on other servers as if they were one place. I feel where possible, I want to control my own identity, which is probably a theme of what I’ve done with all this hosting.

Thankfully for me running a Matrix server was just a case of installing Postgres and Matrix Synapse, and hiding them behind my existing Nginx/Let’s Encrypt set up. Postgres is non-trivial if you’re not a computer person, but I’ve done it before, and once set up it’s low maintenance for light workloads. I’ve seen others have said that Matrix servers are pain to manage, but my experience has been that it’s needed very little maintenance - but with the caveat that I don’t do any bridging between Matrix and other services like IRC or Slack, which might be why I see so many people complain about the process. But for me, touch keyboard, it’s been hastle free.

Fediverse

I have in the past made a few stabs at hosting my own social media (remember itenti.ca?), and generally found it a pain to manage so went back to other services. I switched to Mastodon in 2017, which is another federated system where you can join one server and still see things from people on other servers (like email somewhat). Specifically I joined the server mastodon.me.uk, set up by James smith, someone I know and trust. Whilst James has done, and continues to do, a great job with that server, but I knew at some point I’d like to try hosting my own server as, well, that’s how I am. However, this was tempered by seeing how much pain it was to run a mastodon instance yourself.

But I’ve been watching for a couple of years the progress of GoToSocial, a fediverse server aimed at just one or a few users, and once I felt it had enough basic features for me to get by with - particularly it had support for user migrations so I could move without losing my social graph, I made the hop and now I’m on my own instance. GoToSocial is just a single binary to run and needs the same set of dependancies I already run (Postgres, Nginx, Let’s Encrypt) and so has been (thus far) easy going. You can even use an sqlite file database if you don’t want to run Postgres, and the authors think that’s good enough for a single user, low traffic instance.

Self hosted at home

I remember when Dropbox went from being a thing that synced just a few files to trying to be a portal for all kinds of things, and at that point I deleted my account. In hindsight, my fear that it was trying to balloon into some other service that would own more of my data was unfounded, and most people still seem happy with Dropbox, but I’ve no real regrets from jumping ship, as it was a key inspiration for starting to own my own digital footprint, which started at home.

File storage

I have more data than fits on a single computer, or indeed I’d want on a single computer. I’m fortunate to have grown up in a university environment where networked drives were the normal way of hosting data, so that’s what I do today: I keep all of my data on a NAS device. I use a Synology device with 4 discs in it giving me a redundant array with about 12TB of space on it (redundant in that if one drive fails I can survive until it is replaced with no data loss). 12TB is enough for me currently, and in terms of performance it’s been fine. Even before I added wired ethernet in my home office, and added SSD caches to the Synology, I was able to edit photo RAW files stored on the NAS from my laptop without much issue - and now with all those improvements it’s pretty seamless. It worked a bit more smoothly on Windows than on Mac, as Windows will automount references to remove drives if it can, whereas on my Mac I need to remember to mount the drive when I want to use it, but small details.

The downside with taking all my files home with me is sharing large files with other people. Whilst Synology do have a way to make it possible to share files over the Internet, I don’t want the one box with all my personal data on it that accessible from the Internet, so I don’t allow that. As it is, I don’t have a good solution for sharing files with other people via the Internet currently, other than dumping files to my web server and sending people the URLs. This isn’t a very scalable solution, but given how infrequently I need to do this in practice currently I’ve not been motivated to do better.

There’s other friction points, like Apple Photos wont work with a NAS drive, and I have so many photos that I’d need to be giving Apple an awful lot of money each month to keep them in iCloud. So I have this weird system where the last couple of years of photos are easy to get from Apple Photos, and everything else I need to go looking for it on my NAS. I don’t mind this, but it is a friction point and so you might not like that. Synology has some photo management software, and I use it as it’s easy to add, but it’s pretty poor compared to Photos.

Source code management

This is I feel a bit of a failed experiment. I have a Gitea instance running on my NAS, which I use to host all my code repositories so I have a working copy on premise, which means I can work even if my connection to the Internet goes away, and is a place I can host client code when doing contract work and rest a little easier than hosting it in a private repo on GitHub where an accidental click might expose it. Also I can use as much space as I want without hitting paid limits as I have done on GitHub too - git LFS makes it easy to store a lot of data in git, but GitHub really wants you to pay for that. There’s no way I could affordably store my websites on Github for instance.

The failure though is that I have a lot of code that I want to be public and accessible, and for that I still end up keeping it on GitHub and my Gitea instance, but I mostly forget to update both, so I just end up using GitHub for most public things in practice. I could host Gitea on a VPS in theory, but Gitea is a pain to admin too, with certain updates needing you to make sure you’ve done all the inbetween updates, and so I am running some old version at home, and I’d not trust that on a public server. And also because it’s not federated I’d lose the benefits of having my code where people can easily fork it and submit changes etc. So this whole thing I consider a bit of a failure.

Using third party cloud services

As much as I like to host my own things, as I said in the opening, I don’t actually like tinkering, so there’s a limit to what I’ll host myself. Similarly there’s just some things where you do want to be in the place other people are due to lack of federation.

Domain hosting

All my domains are hosted by Mythic Beasts, who are a local company and I know the folk who run it, so that’s a bit of a no brainer.

B2

Whilst my NAS is locally redundant, if my office were to vaporise, then having redundant disks in the same place doesn’t help me. This is particularly worrying as I back up my laptop to my NAS.

To help give me a safety net here, I used the Synology cloud-sync feature to backup my NAS to BackBlaze’s B2 storage service. This gives me offsite data redundancy. I do know others who have a second NAS in another place and sync the two, but this is considerably cheaper for the most part, but at the expense of being a lot slower to recover from.

Email and VPN

I tried many options here, before moving all my email to Proton mail. Running email is hard, and after I decided to move away from GMail and the like, I tried a bunch of different small hosting companies, and I had problems with all of them with Google and co marking my email as spam. Given I was running a business this was not acceptable. In the end I found Proton to be big enough to not get flagged, but small enough I feel like I’m supporting a company with good intent.

Similarly I use Proton’s VPN service. At times I do wish I ran my own VPN back to my office so that I could access resources I have on my home network (like my Synology), but that’s not been enough of a pain point for me to want to go to the efforts of setting it up and maintaining it.

Misc others

I’ve never stopped using RSS as the way I keep up with the internet, and for a while after the demise of Google Reader I did host my own instance of Tiny Tiny RSS, but it was something that never was quite good noughts o became a management overhead as I kept updating it in hope it’d get better. In the end moved to a paid cloud service called Feedbin and I’ve never looked back. Feedbin has been a great service and I’ve no issues with recommending it.

I do a lot of photography, and although I’ve spent a lot of effort trying to make my photography presentable on my own site, I do still also post things to Flickr, as I find the community there to be a good one, from which I get some good feedback. Truth be told I actually post to Flickr first and then sync to my personal site, as I already had a script for going from Flickr to markdown. If I had the time and the inclination I’d swap that around to post to my own site first then sync that to Flickr, but what I do today works well enough I’ve never needed to switch that.

Source code we’ve covered already.

Summary

As you can see, it’s a very mixed bag of solutions I’ve come up with as I try to keep ownership of my Internet presence. I make not attempt to suggest any of this is optimal - more it’s just a mix of pragmatism based on what I need versus how much effort I’m willing to put into it. But still, I see people talking about self hosting often, and so perhaps this’ll both show you some options, and normalise the idea that it doesn’t need to be perfect or all-or-nothing for you to make some inroads to taking back control of how you exist on the Internet. I don’t use Azure or AWS for instance either, for a while I did, but I don’t really operate at the scale where the complexity is justified - I’m not really dealing with a lot of traffic for most things. I don’t deal with CDNs like Cloudflare either, as I’m not that big, and the few people who do want to see my websites probably don’t care if it’s a few seconds slower than it could be.

I’ll perhaps try to do a follow on post in a couple of years to see how much, if anything has changed.

Digital Flapjack Ltd, UK Company 06788544