In the age of privacy invasions and data breaches, it's now more important than ever to store all of your data locally instead of having your data in some company's data farm. A great way to do this is to set up your own server. This guide is going to try to explain how you can start selfhosting.
Why should you Selfhost?
There are alot of reasons as to why you should selfhost, like:
Total control over your data and what you can store on your server.
More private than using a service by a company like Google. (i.e no one can snoop in on your data and analyze it)
inherently more secure than using an online namebrand service, as those are bigger targets for hackers, and they may have been secured incorectly (passwords stored in plaintext, stuff like that.).while your small home server would be a way smaller target .
You don't need internet to access your data, if you are self hosting locally.
Cheaper than paying for each service individually, as you can run multiple services on one server (for example: paying for a netflix and google drive storage and other things individually is gonna cost more than renting a vps or having a home server in the long run.)
Moreover, you can selfhost your data on most, if not any spare computer. Even a $35 Raspberry pi 4(1) or an old Laptop will suffice.
How you can selfhost
"How can I start selfhosting?" you might ask. Well, you'll first need the following:
An Internet connection, Obviously
A *Nix operating system (cause Windows Server is a meme.)
knowledge of networking and computers will be helpful.
If you're setting up a home server, you will also need:
Storage, such as a hard dive (an external one can be used, but they tend to be less reliable than standalone hard drives)
Step 1: Pick an operating system.
without an OS, you just have a metal box of capacitors and PCBs. Picking an operating system is the first step in making a home server. I'm going to use Gnu/linux here, but Bsd-based OS's can work as well. There are many distros to choose from. Personally, I'd pick one of the following:
OpenMediaVault (OMV), a simple to use operating system built for NASes and home servers with a webui.
TrueNAS (previously FreeNAS) for a more professional grade OMV alternative based on freeBSD, with nice graphs and support for OpenZFS.
Debian, it's very stable, but default Debian has some pretty outdated, but stable packages.
Fedora Server and CentOS, They are both based on RHEL and they offer more up to date and stable packages. From what I know, CentOS is more stable and better for server use than Fedora Server
Arch linux, if you want a cutting edge server (and bragging rights).
Most Gnu/linux OSes can work well for server use (with a bit of tweaking and optimizing of course) but there are specific things you need to look out for in a distribution, like how frequent are the packages updated, how stable is the distribution itself, etc.
Step 2: Install it on your machine (home server only).
This step is pretty easy (for most distros at least, looking at you Arch Linux), just get a flash drive, download the ISO, flash it on the flash drive using Rufus for windows ( BalenaEtcher if you're a normie.) or DD for *nix or macOS, complete the installation, then Bob's your uncle! If you are using a VPS, then the operating systems are a one click install in the VPS setup page.
Step 3: Securing your server.
If you're ever gonna set up a server, no matter what it's use case is, or what you have on it, you must secure it properly to prevent any unwanted breaches. this can be done by replacing the SSH password with a SSH key, Disabling root login, Securing your services with HTTPS instead of HTTP, and regularly updating your software in case there is a vulnerability, Among others.
Step 4: Recommended software and self hosting ideas.
Now that you have a server up and running, it's time to start filling it up with software to make it useful. I'd recommend the following software for the following use cases:
samba share or Nextcloud for having a network storage solution.
Plex or Jellyfin for a selhosted Netflix.
Ampache for a self hosted spotify.
Qbittorrent-Nox, Deluge thinclient, transmission daemon and all other torrenting software for Seeding linux distros, obviously.
Step 4: profit?
You should now have a server built to fit your needs. Very nice 👌
It is HIGHLY recommended that you do not use a raspberry pi earlier than the raspberry pi 4 if you want to set up a home server, as earlier versions do not have usb3 or gigabit ethernet, so on top of the already slow USB2 file transfer speeds, having 100MBit ethernet will slow file transfers to a crawl. At that point, it's just better to download whatever you want from the internet than from one of those.
While a wireless home server is possible, it is highly prefered to use a wired internet connection as your home server will be used to move data back and forth, and that might saturate your wifi network, leaving it very slow.