Self-hosting a blog: A Why and a How To

Tweets

TL;DR: Buy a domain and host one's blog away from companies with Terms of Service agreements for "acceptable content".

...

There's a reason blogging service like Medium and Wordpress are popular. They're convenient and mostly free to use. But with convenience comes a couple of major costs:

  • URLs: In general, users of such services have absolutely no control over the URL at which their posts reside. For example, if Medium take down posts for Terms of Service violations or go bust then the URLs to one's posts are dead forever.
  • Content (the "hosting" bit): Users are hostage to the company's Terms of Service for acceptable content. These are subject to change at any time.

What we want to do here is fix these two problems: Not having control over URLs and not having control over content.

URLs

Forgive me for fanboying for a second but URLs are an incredible invention. They're the web's killer feature. Any piece of content imaginable - a web page, a PDF, a photo, a blog post, an entire application - all addressable and all interwoven and cross-linked with one another. That's the web. The web only works because URLs are (well, should be) stable and unchanging. When for whatever reason a URL no longer works a fairy dies. Fact. URLs should be treated with respect and treasured, else the whole thing falls apart. URLs are how we share. They're what we paste into emails, tweets, whatsapp groups, link to in our blog posts, save in our browsers.

As I alluded to before, if one posts on Medium and for some reason Medium take the posts or the entire account down, or the company in the future no longer exists, then short of buying Medium's assets there is no way to get the URLs working again. Ever. Think about that. All those broken links in all those hundreds of other web pages. All those links in an unquantifiable number tweets and whatsapp groups and God know's where else that all now point to dead content. Horrifying!

So what to do?

The only way to guarantee URLs to your content don't for whatever reason result in a "404 page not found" is to own your own Top Level Domain - the "jackappleby.com", "medium.com", "amazon.us", "blahblah.blah" bit of a URL.

So before we get to the hosting bit - buy a domain. Hosting and domains are two separate things. For example, you can buy a domain via one company and hosting via another. A lot of the time companies don't make that clear and try to bundle hosting into buying a domain. Resist. It's not necessary.

Important

One thing that is necessary to purchase along with your domain is "domain / whois protection". When you buy a domain the name, email, street address, city, and even the phone number you provide is public information. Domain protection replaces these personal details with gibberish, or a generic company email, phone number and address. So be sure to select the option for domain protection as you purchase your domain. It's an extra charge sadly, but it's absolutely necessary to avoid potential doxing

There are hundreds of companies offering domain registration. 123-Reg, for example. Search Google for "domain registration" and ignore them when they try to sell you hosting. We'll get to that bit. 

Most domains are about five or ten dollars a year to secure. Come up with something obscure and it may well be cheaper. See what the prices are and buy one.

Content (the "hosting" bit)

A note about how Wordpress and Medium differ 

There are two different ways to use Wordpress. The first and easiest way is to let Wordpress the Company take care of the hosting. The second and more involved way is to download Wordpress the Software (it's open source) and stick it on another server. It should be apparent that the first way to use Wordpress means one's content is subject to their Terms of Service while the second isn't.

The model Medium use differs in so far as it's not possible to get one's hands on Medium the Software (it's closed source). The only way to use Medium is to accept their Terms of Service. So for our purposes - that of having control over one's content - Medium is a non-starter. Don't use it.

So that leaves Wordpress, and actually any other blogging software that's open source (aka, able to download and do with what you want). And here I want to put in a good word for another open source blogging platform called Ghost. Like Wordpress, Ghost the Software is open source and Ghost the Company offer hosting and, of course, have their own content Terms of Service for that.

So it's basically a tossup between Wordpress and Ghost. Both allow free signup so I recommend setting up throwaway accounts on each and having a poke around and seeing which one you prefer. 

Now for the "self hosting" bit. 

As I said earlier we want to download the blogging software and stick it on a non Wordpress or Ghost-owned server so our content is free of the companies Terms of Service. There's a manual (hard) way to do this and a more easy way. I'm going to stick with the easy way here but if you're feeling brave then google the many guides on "how to self host Wordpress / Ghost / Whatever".

 There are a lot of companies that have helpfully automated the process of self-hosting, for example Digital Ocean. There's obviously no obligation to go with that company but I've used them in the past and can recommend. Google "one click wordpress / ghost / whatever install" and check out the prices. And yep, you will have to pay to self host, usually something like five dollars a month. Unfortunately when things on the internet are free there's usually a non-money cost, like being bound by Terms of Service agreements. 

Using Digital Ocean as an example, they have a one click setup of Wordpress and a one click setup of Ghost. Again, there are more companies offering this service. I'm not being paid by Digital Ocean! Google around. 

Once you've done a one-click install of your choice of blogging software, follow the guides provided by whatever hosting company you chose on how to hook up your domain to your self-hosted blog. This bit can be a little tricky, but as you're now paying for a service support teams are a lot more responsive to any problems or questions you may have, so get your monies worth and use them. 

After a couple of hours wrangling you should have solved the problem of not having control over your URLs and your content. Even if your hosting company kicks you off (and unless you're actually breaking any laws that's highly unlikely) you can just set up your blog using another companies one-click setup, migrate your content over, and all your URLs will still work. How cool is that? 

Good luck! 

1st June 2019

Category: Web development