Homelab
Selfhosting
I started my first homelab project as I watched a YouTube video about PiHole. Since I had a spare Raspberry Pi 3 at home, I immediately started setting it up, and I’ve been hooked ever since.
PiHole #
I started by flashing the SD card using the official Raspberry Pi operating system (previously called Raspbian). After boot, I installed the firewall management software UFW and denied all incoming requests and allowed all outgoing connections. Since I want to access the web interface from my local network, I allowed connections from my local address space to port 80.
As another security layer, I disabled the password login via SSH and created an SSH key on my local machine and disabled the root user on the Raspberry Pi.
Installing the PiHole software was done using this single command:
curl -sSL https://install.pi-hole.net | bashAfter the setup prompt, I needed to change the DNS server for the connected devices to use the PiHole instance. By doing this on the router, I can change the DNS server on all devices.
PiVPN #
In some cases, it is necessary to access my home network from outside, e.g. when I forgot to push some local development progress to GitHub, or when I want to access the computation power of my PC at home. For this, I wanted to host a VPN service to connect to my local network. The software solution chosen was PiVPN.
PiVPN provides a simple setup for a WireGuard or OpenVPN service on the Raspberry Pi. As a first start, you need to check if your ISP gives you a static IP. In my case, this was not the case, and therefore, I did the setup of the VPN service using my FQDN.
The installation of the PiVPN software is as simple as the installation of the PiHole.
curl -L https://install.pivpn.io | bashSamba #
In addition to my VPN and PiHole, I used a spare HDD and connected it via USB to my Raspberry Pi. After installing Samba with
sudo apt install samba samba-common-binI have now a personal cloud which I can access from anywhere using my VPN.
⚠️ TODO I still need to setup a backup of my HDD
Overview #
architecture-beta
group homenetwork(cloud)[Homenetwork]
service disk(disk)[HDD Storage] in homenetwork
service raspberrypi(server)[Raspberry Pi] in homenetwork
service gateway(internet)[PiVPN] in homenetwork
service internet(internet)[Internet]
disk:L -- R:raspberrypi
gateway:R -- L:raspberrypi
gateway:L <-- R:internet