Jijin's blog

Nothing useful

Jijin's face

I built a home server, because why not

Sun Mar 09 2025

So one fine evening, I was chilling at home and had a sudden thought. What if I build a home server? So I started planning out and deciding what to do, and how to do it. A week of planning.

In the age of cloud, Why build a home server?

With the ever-increasing rise of SaaS and every other trillionaire company pushing their own cloud solutions, one might wonder, why build a home server? My reasons are simple.

1. Control Over My Data

Some cloud providers claim that my data is private and secure. But is it though? I don’t want my (not-so) well-documented notes and (not-so) masterful photos ending up in some new AI gizmo’s learning dataset, just to make billionaires even richer. I don’t need more AI doing art.

2. Local Access

This is another major factor for me. I want backups — neatly organized and easily accessible — for my photos, notes, and other files. As a software engineer who works from home, my needs are simple: a place to store my data (mostly photos, videos, and notes) and access it easily within my home. And when I move, I want to be able to set up remote access—only for myself—with minimal hassle.

3. The Experience

I want to see if building a home server (I know it’s fairly simple) is something I can actually do, and I have the patience to figure it out. Plus, with the sun being so damn hot all the time, I can’t go outside without getting sunburned, so I’ve got extra time on my hands. So why not do something I’ve never done before?

Research

I started my research with what I already knew. For my simple requirements, I knew that I had to build a NAS. So, the first step was to understand how to build one. Even though there were plenty of pre-configured NAS boxes with terabytes of storage, buying and setting up one like that seemed too simple, and I didn’t want to do that. So, I decided to build something better.

Luckily, my research (searching “How to build a NAS” on the internet) led me to a bunch of LinusTechTips YouTube videos. Almost on most videos, the team was using something called TrueNAS (the first time I had heard about this software, please don’t judge me). It seemed pretty straightforward: find a system to install TrueNAS on, set it up, and use the web UI to configure everything else. It wasn’t too difficult, but it did come with some challenges, which naturally made it more interesting to me.

Buying the Components

I didn’t have an old PC or laptop lying around to build this, so I had to go looking for the necessary hardware. I didn’t want to build a PC from scratch, and moreover, I didn’t want a full-sized PC. I had already planned where to place this server, but if I were to buy a regular PC, it wouldn’t look good in that space.

So, my options were either a cheap laptop or a mini PC. I went around asking for a cheap laptop in local shops, but the thought of having an unused laptop just lying around in my house didn’t sit well with me. I knew that visitors would likely ask questions and judge me for “wasting money” on a good laptop, simply because they don’t understand this kind of tech. So, a mini PC it is.

My options were very limited because none of the local shops had a mini PC available. So, I had to turn to Amazon (dire situations called for dire measures—please don’t judge me). And no wonder the local shops didn’t have mini PCs—even Amazon didn’t have many options. There were just a couple of junky-looking refurbished PCs. But one caught my eye, and it looked good. However, I had to wait a few days before it became available. So, I waited. And once it was in stock, I bought it—a refurbished HP EliteDesk 800 G3 with 500GB SSD and 8GB RAM. And now I wait for it to arrive.

Setting Up TrueNAS

With the mini PC finally in my hands, it was time to set up TrueNAS. The first step was to create a bootable USB drive with the TrueNAS installation image. I downloaded the latest version from the official website and flashed it onto a USB drive. Next, I connected my main monitor (the one I use for work), my keyboard, and my mouse and booted from the USB. The installation process was straightforward, just selecting the target drive and letting the installer do its thing. I was a little disappointed that I didn’t have much to do manually, but once the installation was completed, I could configure a lot of things myself, and I think things would get pretty complicated there. Once the installation was complete, TrueNAS prompted me to remove the USB and reboot.

After rebooting, I was greeted with a simple text-based interface displaying the system’s IP addres/Web UI link. This meant TrueNAS was successfully installed and ready for configuration through its web UI. Now, it was time to dive into the setup and start configuring my NAS(Finally!). Excited, I removed the monitor, keyboard, and mouse, placed the server (now a NAS) where I had initially planned, connected it to my router, and logged into the web UI. The first thing to do was set up the Pool (or the storage) where everything would be stored, where I could set up permissions, and so on. But here came the first problem. The dropdown to select a drive was empty. Nothing there. I was sure that I had 500GB of storage in my SSD and that TrueNAS wouldn’t use much. But I couldn’t find anything in the list. Naturally, I browsed the internet for answers (with a little help from GPTs too). I quickly learned that I could not use the same storage for TrueNAS and as a pool.

All right, no issues, I could just create a partition. I knew how to do that. My plan was to install TrueNAS on one partition and use the other, larger one for storage. But guess what? TrueNAS always uses the entire disk, no matter how I partition it. This meant I couldn’t move forward without another SSD or an alternative installation location. I didn’t want to spend more money on an SSD, so I needed to find something I else. I knew I had an old USB stickstick lying around (another one, apart from the one with the TrueNAS bootable installer) with 32GB of storage, which is plenty for TrueNAS. So I decided to install TrueNAS on it.

Now My plan was, Install TrueNAS on the USB stick, set it as the primary boot device, use the system’s internal SSD as the storage pool. Genius!!

So, I installed TrueNAS on my USB stick, set it as the primary boot device, and restarted the system. But before logging into the web UI, I had a random thought. I knew that USB sticks weren’t designed for frequent read/write operations, they’re meant for occasional storage, not constant use. My mind started wondering: Would all the logs TrueNAS generates every second cause an issue? So, I did some research (this time on Reddit; r/truenas). And, well, the responses were exactly what I expected: Don’t use a USB stick. It’s not good.

So there went my “genius” idea. I went back to the mini PC to remove the USB stick—and guess what? It was hot. So hot that I couldn’t even touch it. I had to turn off the PC and wait 2–3 minutes before I could pull it out. Imagine if I had actually used it as the primary boot device without checking first.

Back to square one.

Light Bulb Moment

I had wasted an entire day trying to make TrueNAS work, so by the time it was late, I decided to call it a night. But as I lay in bed, I couldn’t think about anything else. My mind kept running through all the possible solutions until, finally, I had a light bulb moment, I use Linux Mint as my daily driver, so why not use something similar, more lightweight, and build my own server (a mini one, of course) tailored to my simple requirements? I started looking up the most lightweight Linux distros, but I quickly realized that I didn’t need anything fancy. I could simply install a Debian server, without a GUI, and use it. Instead of a dashboard, I could just SSH into it and manage everything from there. Well, that solves it. That’s all I need to do. Come fast, tomorrow — we’ve got lots to do.

Building My Debian Home Server

1. Installing Debian and Setting Up SSH

With a fresh plan in mind, I wasted no time getting started. The first step was to install Debian on my mini PC. I went and downloaded Debian buster, and setup a bootable USB stick. I created a bootable USB with the Debian installer, plugged it into the mini PC, and started the installation. The process was straightforward: selecting the language, timezone, partitioning the disk (finally, I could use my SSD properly!), and choosing only the essential software packages. I made sure to skip installing a desktop environment to keep things as lightweight as possible.

Installation done, now time to setup SSH. I am looking to remotely login since I don’t have a web UI like trueNAS (I could set something up like this if I wanted but for now I am opting for SSH). Once the installation was complete I rebooted the system and logged in as root.

As every sane, I started by upgrading the whole system.

apt update && apt upgrade -y

The next step was setting up SSH

apt install -y openssh-server

With openssh installed, it was time to enable ssh on boot and just start it now to see if I can login to my system.

sudo systemctl enable ssh
sudo systemctl start ssh

Do a ip a to get the server address and ssh into my server.

ssh root@server-ip

It worked! Now, I could manage my Debian home server entirely from my main PC, without needing to connect a monitor, keyboard, or mouse. With SSH set up, I was ready to start configuring my storage.

2. Setting up NFS server for file sharing

Now what I need is to have a way to transfer files from my personal computer to my Debian server, so that it can act as a NAS. It should be over the wifi, I don’t want to connect anything to the server. The solution is simple if you know Linux well enough, NFS

First step is to install NFS server on Debian Server:

apt install -y nfs-kernel-server

Now I need to create a folder to be shared across the network. I chose /mnt/storage/Media since that was the norm(I think). Now to set the correct permissions.


chown -R nobody:nogroup /mnt/storage/Media
chmod -R 777 /mnt/storage/Media

Finally edit the exports file to define what other devices can do to this directory.

vi /etc/exports

Add this following to the exports file

/mnt/storage/Media 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)

Explanation for the above file

Now saving the file and restarting the NFS server for the changes to be applied.

sudo exportfs -ra
sudo systemctl restart nfs-kernel-server

It is all setup now. The directory is ready to be accessed across the network.

Now to setup NFS share on my personal machine. It is straight-forward. Install NFS client, create a local folder for NFS mount, mount the NFS share.

sudo apt install -y nfs-common
mkdir -p ~/NAS_Media
sudo mount -t nfs ip_addr:/mnt/storage/Media ~/NAS_Media # Replace with ip addr of server

And that is it. Finally setup a NAS (almost) locally. Debian buster running in an old mini pc. That’s all.