Posted: Thu 02 Mar, 2017, 08:53

Yes, this page is hosted at my house on a Raspberry Pi. Personally (and I may in the minority), I find that fact pretty remarkable, and not through any great personal achievement of mine. It is of impressive simply because it is now very easy. This is not a static HTML page, this is a dynamically render page using a wiki-style server, it is secured using HTTPS, with inline images and all hosted on the same machine. It all runs on a silent, low power, inexpensive machine - namely a Raspberry Pi. I can edit upload content, add a blog, share an image, all via the web without ever having to log onto the machine. That's it in the picture - pretty cool huh?

The purpose of this blog is just to quickly explain why I think this is pretty special, why you might want to consider it and then a guide to building your own personal web site at home. It's actually very good fun, creative and rewarding and it just might be how things are in future.

Network, hardware and software come together

Running your web site at home (home hosting) has never really caught on, over all these years. And yet we all have our own personal data that we want to share on the web, via Facebook, Instagram and the like. The natural location to serve our personal content, that we create, is from a server running at home. After all, why would you want your most precious and personal data languishing on multiple SSD drives in a datacenter in some unknown, random location? For many years there have been several obvious barriers to making this possible, but these barriers have one by one fallen. Today, through a happy convergence of technologies, there is absolutely no reason not to run a personal website at home.

My efforts to run a site from home actually started years ago, but have really worked due to the fact that the key components were not ready. Ten years ago, I used to run my site on a noisy desktop that I had built as an everyday server and for a while, I just left it on all the time and it served my website. At that point I had ADSL broadband which provided a (normally) fixed IP address and enough bandwidth. Except it didn't work. Having a noisy machine running at home was never a cool idea. And the software to run the site was pretty poor, at that stage I was building HTML pages, which quickly became very boring. But it was a start.

Roll forward five years and now (in a different house) I have fibre broadband, which provides an even faster and more stable internet connection. I had an old Dell laptop which could run all day every day and was pretty quiet. Once I had installed Gentoo Linux it was now a pretty nice platform to host my site. It was located under the stairs, next to the router and I could just login remotely if needed. At this stage, I had better hardware, a great internet connection and still not very good web software. I have to confess that leaving a laptop running, out of sight, with a propensity to occasionally run very hot (fan blowing at full speed) did not fill me with confidence. The hardware was still not quite right.

Three years ago, I invested in a shiny new Aleutia T1. It was 100% silent, designed to be left on all the time and had an SSD drive for super fast access. Now I was getting close. Network? Check. Hardware? Check. Software? Eh... still not got that figured out. Obviously I could keep going with static-ish HTML files, but this quickly became difficult to maintain. The main options at that time (and in many ways still today) for running a site were a Content Management System (CMS) or a Wiki. Running a CMS (like Drupal) just seemed like total overkill. This would involve running a database, an application server and then learning all the intricacies of how to administer an enterprise strength system. A Wiki could have been a good alternative, as they are simple to run and easier to use than a CMS. I had some reservations however, it would still require a database probably and the site structure of a Wiki tends to be very random and hard to control. Close, but not quite.

And now it is 2017. The Raspberry Pi has been born, and evolved rapidly. It has a 1 Ghz processor. Just to repeat that, a one gigahertz processor! It is completely silent, generates virtually no heat, consumes very little power and is extremely inexpensive. Ok, so the hardware is definitely sorted now. This little beauty has the power. If your personal website needs more than that processing power, then either you are a celebrity with millions of fans checking your every move or you are running some very bad software. The network was already sorted. And now actually, the software is too.

In the end, I wrote my own software, called triki, that suited my very precise requirements. Happily, there are now some very good alternatives however, for example Hugo or Jekyll that will do a very similar job. triki, Hugo and Jekyll all take a very similar approach. They are static site generators, but they basically render HTML from simple to add text (or Markdown) components. It is definitely not a new concept and is exactly how CMS and Wiki software works, but with no separate database requirement and they are optimised for simplicity and speed. So finally, now the software is sorted too.

And so, today, we can all run personal web sites from home thanks to the rapid evolution of the technical "trinity" that is network, hardware and software. That is why this feels like quite a noteworthy moment, because without running some crazy solution, a home hosting solution has only recently matured into something both viable and desirable.

Why?

I said that this is a desirable solution, but is it? The technical barriers have now disappeared, which just leaves the justification. This is not something I am going to try and argue, because it is a very big and complex topic with huge vested interests. Most people have huge personal investments on their social media presence, with photos, messages and timelines (memories essentially) going back years. If you want an insight into why I think we should all be owning our own data, you can read my blog from last year on the subject. Everything in there is still valid, but there are now other motivations. Yesterday there was a huge outage on Amazon S3 and the week before Cloudflare started to generate web pages with other people's data embedded. If you put your data in a cloud, or publish your content through a cloud provided service (like Wordpress), you have no idea where you data is and who has access to it.

It's ok, I know what you are thinking. Am I seriously suggesting a Raspberry Pi is a more stable and secure solution? I think this is a matter of perspective. Unless you publish something that goes viral (which is unlikely), your software and network (via standard broadband) should be more than sufficient to handle your data requirements. If you run HTTPS then all your content is encrypted. Yes, you can still have outages due to a power cut or some hardware issue. No biggie. You're not running a bank website or a major news stream. It will be back online shortly. So is it more stable and secure? I think for the sort of content and volumes we typically share, it is the right level of stability and security for our personal content. And hey, if your site becomes a roaring success then you can just bump it onto a linode server and still own your data but get better bandwidth and uptime. That would be a very nice problem to have. :)

And here's how...

This is an express guide to how to create your own website at home. There is more detail but this is the basic process. If you need more detail, please feel free to drop me a line and I'll do my best to point you in the right direction.

Buy a Raspberry Pi

Easy to get one from Amazon, no instructions needed. Get a USB stick as well. All your actual content (photos, blog etc) will reside on the USB stick which is faster and easier to expand and replace than the internal SSD card.

Install your web software

Install either Hugo or Jekyll or whatever you chose to run your site. triki is certainly an option, if you want some help to get it running, please let me know.

Give your Pi a static IP address

When a new device joins your home network, the router will give it an IP address using DHCP. This is expected to change every time you reconnect, so it is important to ensure your Pi always has the same IP address. This document worked for me.

Install a web server

Not strictly speaking necessary, but if you want to run HTTPS and ensure all your content is secure, then it is recommended. I use Apache, but Nginx is increasingly popular. Configure the web server to "proxy" back to your web software. This will listen for traffic on port 80 (HTTP) or 443 (HTTPS) and direct it to the whichever port your web software is running on. If you want to run HTTPS, read this blog. You should now be able to browse to the IP address of the Pi on your network and see your site.

Punch a hole in your router

If you have broadband, you will have an external router that your provider installed and you may also have an internal router of your own. You need to let HTTP/HTTPS traffic in through the outer router and then on the internal one, you need to send that traffic to your Pi. This is done through what is called "Port Forwarding" on most routers. Here is what my configuration screens looked like, click the links to see them full screen.

Oh, and find out your external (WAN) IP address when you are on the external router. You will need this for the next step. It can change from time to time, but mine has never changed in three years. It's normally on the Status page.

Reserve a domain

Go to your domain provider of choice and buy an available domain name. Once you have reserved it, go to the DNS administration page and configure say www.yourdomain.com to point to the external IP address of your router that you took a note of before. You should now be able to browse to your website from anywhere.

Go make some content

Now the fun bit, go and add some content. Share your favourite recipe for spaghetti bolognese. Post your photos from your scuba dive. Or write a blog about something you care about. Then share it with some friends or post a link on Twitter. Enjoy!