Intro

The inception of this journey happened when I wanted to utilize our decade old PC. It was a Dell Inspiron 660s. A small form factor PC which was quite capable back in 2013. After spending some time on Reddit and watching a couple of YouTube videos, I came across this interesting idea of Homelab. It basically means you host a server at home that locally runs different services you want to use. Here is a list of advantages from my perspective.

  1. You have control over your data for maximum privacy.

    • Last year, Google and Samsung had introduced a tool called Magic Eraser, which is a great tool when you want to remove unwanted objects from your picture. Turns out, if you cover your face with your hands and then erase your hands using this tool, then AI will fix the photo eerily close to the real deal. At this point you ask yourself, if the claim “We do not train our models on your photos” really true?
      Now that your data does not leave your server, you are in charge of everything. This is truly powerful and the most important benefit of this setup.
  2. No more running out of space issues.

    • Remember that time you took a picture and got a warning that you are running low on space, 👀 iPhone users. That is going to be a thing of the past. Theoretically, you can have unlimited storage in this setup. Realistically, think of how many pictures/videos you can store with 1 TB of space.
  3. The feel good factor.

    • Once everything is setup and you cancel your, spoiler alert, Google Photos subscription, you get this happy feeling that you did something cool and get the bragging rights to talk about self-hosting.

However, there are some points to consider before you begin with this project.

  1. If you want your services up and running 24/7, then you have to leave your server on 24/7.

    • Energy consumption and cost of running the server is a real consideration here. Later, I will also talk about how to have an efficient system.
  2. You have to be comfortable with the shell environment. You could have a GUI but that requires more resources.

  3. Backup > Backup > Backup

    • Now that you are in control of your data that also brings the responsibility of preserving that data in the long run. A disk failure can happen anytime without any warning. So make sure to backup your data regularly. This is still better than forgetting a recurring payment for Google One or iCloud and loosing all those photos forever.
  4. You have to invest your time and energy.

    • With the advent of LLMs it definitely gets easier to find the correct information, but at the end you have to find the time to execute these things, fix bugs, pull the latest updates and general maintenance of your infrastructure. IMHO, it is not a set-it-and-forget-it kind of a project. You have to be involved. This will be your baby now. But, I see this as a positive challenge.

As you saw, the cons outweigh the pros 4:3. I leave the decision to the reader if they want to make the transition or not. With that out of the way, let’s talk tech now.

Coming up with a name

I named this server, Rohini, after one of the stars (nakshatras) found in the ancient texts in Indian astronomy. Assigning a name to the server makes it easier for future references and helps in maintaining the infrastructure.

Choosing the OS

There were couple of options here. Ubuntu Server, OracleBox on another OS, ESXi or Proxmox. I chose Proxmox. It provides kernel level virtualization and is community driven but is also used in enterprise environment. The documentation is really rich and you can find what you are looking for fairly easily. I went into this with no prior experience with virtualization software but was able to manage by myself. That is the advantage of community driven development. You get a lot of support.

Hardware

Here’s a list of what I am running Proxmox on.

  • Intel core i3-2120 @3.6 GHz
  • 4 GB DDR3 single memory
  • 500 GB Crucial BX500 SSD,
  • 500 GB decade old Seagate HDD
  • m-ATX Dell proprietary Motherboard and 120W PSU.

There’s a second RAM slot but for some reason I never got it to work. As soon as I plugged another RAM in that slot, I could not POST and got beep-beep-beep sounds from the MB.

CD/DVD Writer

Remember the good old days when we use to burn our favorite songs on CDs. I had to resort to this to install Proxmox on the system since the BIOS was soo old that I could not boot from a USB and the BIOS did not want to update and did not support UEFI for some stupid proprietary reason. Eventually, I got Proxmox up and running. The plan was simple, use the HDD for backups and SSD for live storage.

Power Consumption

These decade old PCs were not designed to run 24/7. Running something like that, I had to make sure I am just the necessary amount of power. There used to be a Nvidia GPU, I think it had 2GB of VRAM and it was model no. 560(?). But I removed it, since I did not require it for my needs and all it would do was draw more power. I turned off the on-board WiFi card since I am plugged in via the ethernet. Finally, there were some Proxmox tweaks that I enabled to reduce the power consumption when idle. Here’s the bash script,

#!/bin/bash
# LXC Container Control Script, make_idle.sh
# Usage: ./containers.sh [start|stop]

CONTAINERS=("102" "103" "104")  # Add container IDs

if [[ $# -ne 1 ]]; then
    echo "Error: Please specify 'start' or 'stop'"
    exit 1
fi

case $1 in
    start)
        for container in "${CONTAINERS[@]}"; do
            echo "Starting $container..."
            pct start $container
        done
        echo "Enabling performance mode..."
        echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
        ;;
    stop)
        for container in "${CONTAINERS[@]}"; do
            echo "Stopping $container..."
            pct stop $container
        done
        echo "Enabling powersave mode..."
        echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
        ;;
    *)
        echo "Invalid argument: Use 'start' or 'stop'"
        exit 1
        ;;
esac

echo "Operation completed for containers: ${CONTAINERS[*]}"

When I do not want to use the server, I just run ./make_idle.sh stop from my Proxmox mobile client noVNC console. It stops the resource hungry containers, [immich, nextcloud, dashboard] and sets the scaling governor to powersave mode. This way the power draw at idle is around 65W, which is still a lot but that’s what you get for running old PCs. The good thing about this is when I want to use these services I just run the script again with the start keyword and all the containers just resume from their last state.

Running services

All the services that I have running at the moment are running in their individual LXC containers. I got most of the services up and running using the Proxmox Helper Scripts and the first service that I installed was,

Note: Keep in mind that Proxmox-Helper-Scripts has seen a change of administration and the outlook, at the moment, is that it is not what it used to be.

Tailscale

It is a wireguard based VPN technology that relies on their relay servers to form a mesh network for your devices. This was of utmost importance since this server will be hosted at my parents place in India and I live in Germany. I should be able to connect to my server even when I am 6000 kms away. And in this regard Tailscale works like magic. Best part is you do not have to forward any port on your router. This is nice because I am still a little skeptical about opening a port on my router towards the public internet since I lack proper knowledge and experience to make things secure when it comes to networking.

Tailscale enables end-to-end encrypted, point-to-point connections between devices without routing traffic through a central VPN server, which reduces latency and enhances security. The relay servers are just used to authenticate the devices in the tailnet by exchanging public-private keypair.

Immich

Immich is a self-hosted drop in replacement of Google Photos. Essentially, Immich is running inside a docker container which is running inside a LXC container. I know this situation is like the Russian doll and I would like to fix this in the future. The transition itself was pretty smooth. Getting the photos out of Google Photos was time-consuming but easy. There is this service called Google Takeout which you can use to download all the data that you have given to Google. You won’t believe how much of that can amount to. I was already on the Google One 100 GB plan and after requesting the data it took Google some hours to generate the download links. Once you have the data you can use Immich-go another open-source software to manage your transfer from Google Photos to Immich. The setup was self explanatory and worked like a charm. It took me 4.5 hrs on 250 Mbps UP/DOWN speed to upload the data to the SSD.

Note: I could have done this much better by copying the data to an external drive and then offload the same on the SSD on the server. Finally, I could have told Immich to just use this source as an external library. But I learnt this later. Soo moving on.

Today, Immich is working really great. Now, my photos directly get backed up to the server from my mobile client. I take periodic backups to ensure I do not loose anything in case of a failure. The experience was soo great that I got my father and my wife on this service as well.

Nextcloud

Now, Nextcloud, similar to immich is a self hosted replacement for Google Drive. And again, I used the Proxmox Helper Script to install the service. I don’t use this service as much I would like it too since I have not imported all of my data from Google Drive to Nextcloud, yet. Something for the future.

Homepage

Homepage is a simple dashboard for your services so that you can find all your services in one place. It is highly configurable and can also talk to other services using API calls.

Pihole

Pihole is my ad-blocker and DNS resolver of choice. This is crucial for your infrastructure and who does not like network wide ad-blocking. The real benefit is when you configure Pihole to be the Global DNS resolver in your tailnet so whenever you are connected to your tailnet you can still block those pesky ads wherever you are.

Caddy

Caddy is a great reverse-proxy written in Go that automatically obtains and renews the TLS certificates for your sites. It is recommended for its ease of use and the community offers a variety of plugins. This became a crucial service when I wanted to use my purchased domain for reverse-proxying the services and obtain TLS certificate with DNS-ACME challenge via Hetzner API. This can be a blogpost of its own. Long story short, after setting this up, I could reach, for e.g., Nextcloud using cloud.vaibhavnath.in.

Outro

This was just an introduction of an even bigger project. I will continue this series where I extend my Homelab with 2 more nodes and one NAS. I will also write about automatic backups of entire LXC using BorgBackup. Getting a Hetzner Storage Box for achieving true 3-2-1 backup policy. So stay tuned.

Until then, 😊
VJ