Can We Make Local Hosting Easier?
I’ve been trying on and off for several years to get my own website hosted on my own PC in my own home. There have been periods of time where I’ve actually had the website working, but inevitably something goes wrong that takes the site down. A power outage turns off my computer. A bad local network prevents access. My router breaks and I can’t figure out port forwarding on the replacement. Or I just plain restart my computer and forget to turn the server back on. The most difficult thing for me, though, is that if I leave the site up for long enough, I forget how it’s running. Then when it comes time to do maintenance, I have to figure everything involved in setting the site up from scratch. This invariably takes time and energy that I often do not have. And so the site goes down.
What I’ve noticed, having broken my very simple website over and over again, is that web hosting is surprisingly difficult, and I don’t really understand why. We have all these fancy technologies trying to simplify hosting – cloud providers, docker, kubernetes – and although they are all great, they all add layers of complexity. Now don’t get me wrong, docker is great for running virtual machines, and it’s hard to simplify computer hardware management more than “pay a guy in virginia to watch your computer,” but I feel like we get away from the core of the web, which should just be as simple as “write an HTML document, put it online.”
Why is this? Why is it so hard to go from an HTML document on your computer to an actual website? I don’t know, and this post is mostly a half-baked stream of consciousness about the steps involved. So here they are:
- Write an HTML document - honestly quite easy starting off. Any plaintext document will do, whether it has the actual tags or not. However, plaintext will only get you so far, and most human beings would rather use a WYSIWYG editor than learn HTML and CSS proper.
- Download a webserver - there are dozens to choose from. Which should I pick? NGINX? Apache? Rails? What are all of these? And what do you mean Rails isn’t a webserver?
- Start the webserver - This is very hard for someone not familiar with the command line. The commands are almost always different if a person is on windows or POSIX, and you probably need admin permissions. You also almost certainly want to launch the server as a long-lived background process that will continue running even if you log out. But good luck figuring out how to do that from the server manual.
- Point the web server at the HTML document - Honestly, if you managed to get the web server started, you can probably handle this. But if you’re running apache or NGINX, you’re going to need to learn about symlinks to understand what any of the docs are doing.
- Find the port the server is running at - Also not too difficult if you got to this point and can read command line output. But it’s easy to forget if the server is backgrounded.
- Open that port to the network - This needs to be done through your router, and the process is different for every router. I have invariably lost the router’s manual whenever I need to do this. My current router though, does have a nice GUI.
- Purchase a domain name - Where should I buy from? (The correct answer is almost certainly cloudflare)
- Configure the domain record - I’ve been paid money to do this on more than one occasion and I still don’t know how to do this.
Now, if you get through all of those steps, you will have a website running on your local machine. But if you’re not familiar with any of these steps or concepts, you’re in for a lot of reading.
I don’t think it needs to be so difficult. The original dream for the web was that you could do all of this in your own web browser. A single spot where you could both visit websites, and edit your own web content. The only points where this dream seems to have failed though are:
- Exposing a port to the network (which is beneath the web in the OSI model)
- Centralized domain (which is well known to be the one major point of centralization in an otherwise fully decentralized model) Everything else I feel like can be drastically simplified so a non enthusiast can set up their own site. It would be best if beginners don’t have to depend on Wordpress hosting for everything.
I should also note that Wordpress doesn’t solve this problem. Its web interface is great, yes. And you can download and install the software locally (also great). But running the software locally is immensely challenging. You need to install MYSQL and PHP, and then figure out the install instructions. All unnecessary friction.