Before we start
You are about to dive into the world of self-hosting. This document is written to help you host at home or on a dedicated (rented) server some services unfortunately too often entrusted to third parties. The main goal is to keep things as simple as possible while learning gradually. Of course, compromises have been made. If you feel you want to learn more after reading this, that's great! 😊
In order to keep things simple, but secure, we describe OpenBSD OS in its last stable version. It is known to be safe. It is also, in my opinion, easy to configure because the same syntax is shared by different included tools.OpenBSD
Why OpenBSD rocks
Some says OpenBSD documentation is great. How this documentation can be useful to me?
It is for sure! Manpages are amazing, use them as a reference. I see this documentation as an entry point, not a replacement. Some fundamentals will be explained with a few tips. Anyway, manpages are great and you should read them too.
You'll see, hosting your server isn't that difficult and is mostly text-edition. Everyone should be able to do it.
Self-hosting : what is it? Pros and cons.
Most website you're used to read -- emails, social networks... -- are hosted on computers somewhere in the world. They are only used to serve contents to other computers, so we call them "servers". The biggest difference from most people point of view is that "they don't have a screen".
When you want to read your mails, a client (a webmail, Thunderbird...) is asking the server to retrieve your messages. A copy of them is then downloaded on your computer. In "real life", that would look like this :
Hey, mailman, do you have anything for me?
Yes, a postcard from your mom. I give it to you as soon as the copier finish to print it.
Of course, you can ask the post office to delete the message. But how can you be sure ALL copy have been deleted?
Better become you own post office, don't you think? 😀
At first, everyone was supposed to make a part of the web. Now, most of us depend on private companies that disrespect privacy.
- Data stays home. You keep control on it. You can be confident : your document aren't forgotten on a hard drive trashed after Google docs renew its hardware, or worse, sold to someone else.
- Your privacy is safe. Your mails aren't scanned to suggest targeted advertisement in your browser.
- You can have services that suits your needs.
- You can use low-powered hardware and be more environmentally friendly.
- Self-hosting is fun and rewarding.
Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say. -- E. Snowden
- It's time consuming.
- Bandwidth of your internet acces might not be enough depending what you want to host. Without optical fiber, movies and big data transfer could be tricky, though not impossible. No problem for mails.
- You have to take care of security. Fortunately, we use OpenBSD.
About this document
In this document, we assume that:
- You use OpenBSD
- Make sure to understand that commands beginning with "#" means "run as root or superuser" and those beginning with "$" are executed as regular user.
- Sometimes, we'll use "*". This means it must be replaced by anything that match your needs. As example, "John D*" can mean "John Doe" or "John Deer", depending on the situation. Actually, it means both :)
How to install OpenBSD