Thoughts on making self-hosting easier for people

Self-hosting becomes more and more widely used by non-tech-industry people. They self-host rss readers, site saving systems, social ActivityPub/LitePub compatible applications and more. Thanks to wide usage of Docker and other containerization systems it became much easier to manage selfhosted items than it was 10 years ago.

Yet, sometimes it is still hard to do, especially when people want to run an application servers on bare metal, without containers or any kind of virtualization. And sometimes, it is painful to do it, even for software engineers, who developed it.

Why? Very simple – most times it takes much steps to perform to set it up.

You see, mostly you have to set up not just self-hosted service instance, but also databases like PostgreSQL or MySQL, Redis, ElasticSearch etc; write some kind of configuration file for an app; if service has microservice architecture, you have to set up every single microservice.

Of course, you can use Docker, Ubuntu Snap or other technologies. Yet, if you use them, it will take much more space, it will take a bit more time to start a container (duh, you have to download it, unpack or build from scratch). It is inappropriate for some people, for example, I run every thing I host on bare metal VPS I bought from provider.

Let's get back to how to make a service be easier to self-host: what you can do as a developer make it happen.

1 – Make your application be shipped as one executable file. Mostly it applies to scriptable languages like python, ruby, javascript and others.

It just grinds my gears when I see such thing with django packages, like this:

Now run python migrate

It's stupid – to put all source code in files so people have to install all the dependencies by themselves. Why not to package an application in single executable file that already has all the dependencies inside? It would make people 100500 times happier, because not all self-hosters are developers to read and change the code.

Also, there are some external bundlers that hide all amount of this things under the hood. It's nice, yet it is still shitty thing. Why in Equestria do you need an external bundler application to run an application? I don't want to install another package manager for javascript to run an application. I just want run an application, and that's all.

2 – External services dependencies, like databases or else. It is a painful one for developers. Yet, the best way to make service easy hostable, you probably should allow support of most popular alternative databases. Or make dependency on it optional.

Why it is painful? Because it will make code more complex. It will require more tests connected to environmental things. Why it should be done? Because it will allow people to use tools they know better, or decrease amount of additional services to support.

For instance, let's assume that you want to set up RSS feed reader. One, that fits the best for your need has a requirement of elasticsearch, and it is used only to index and search entries. Then, why do you need elasticsearch if you are not going to search for something at all? You just don't set it up, and service doesn't provide search at all.

Or, you already have running PostgreSQL database, and service you want to run strictly depends on MySQL. Do you want to set up another RDBMS? Of course no! You already know how to back up data for postgres, know it's cli, and now you need to lear mysql cli to set up back ups and it will take another amount of cpu and memory and all other consequences.

3 – A “setup” command that does most of hard job of configuring service. Or some single-entry item, which will take most of automatable actions done, like people do things in Makefiles.

It will hide all hard steps of dealing with stuff, so any non-techie-dude will be able to figure out how to do this weird thing in the terminal.

However, things are not such bad. There is lot's of services that are simple and shine easy to set up. For instance, I use RSS feed reader named Miniflux – it is simply awesome. The only thing I had to configure by myself was postgresql, just to create databases. And it takes really small amount of resources, so I can run it even on my phone if I want to. I just need to build it for arm64 architecture.

Also, there are organizations that create platforms to self-host services in one single click. They do the great job making things easier for developers of services, because they can focus on developing application instead of making it more “perfect” in perfection sense.

This was @alexcleac, I occasionally write things somewhere. You can follow me on mastodon or write as platform. Feel free to respond me if you have some thoughts on topic, but don't be rude, please :D

Have a good day :D