Home Lab
An enterprise grade server I run in my basement.
Building out my home lab has been one of the most rewarding projects that I've undertaken. It started when I wanted to upgrade from an old desktop computer running Ubuntu to something a little more powerful. My little brother had been complaining about the Minecraft server I was running for him being slow, so I bought a second-hand enterprise grade server on amazon and use it to run many projects and lots of docker containers as well as a Minecraft server. This has become my own personal playground where I experiment with technology that I find interesting. Anything from my self-hosted instance of Nextcloud to running some python scripts that make my life a little easier.
The initial set up was fairly straight forward because I had some experience with running a Linux server. The old family desktop computer may have been a little underpowered, but it taught me the basics of getting a server up and running. I chose to run Ubuntu Server because I was already somewhat familiar with Ubuntu and there is a lot of community support around the distro. I knew that I would be able to google any problems that would arise and quickly find an answer. During the setup process I had to learn a lot about networking quickly because without proper configuration, a server is a very ugly and expensive paperweight. Little did I know at the time that this would be just the start of my networking knowledge. I'll get into that a little more in a bit.
After I had the server set up, I started noticing that I was getting pings, port knocks, and login attempts from Ip-addresses in China. I quickly discovered the need for security. These were obviously hacking attempts. I hadn't considered this would be a strategy that people would use before I saw it myself. It just hadn't occurred to me that there would be hackers just using brute force to discover and attempt to login to any networked servers that they could find. This is when I learned to lock down the root user so that root can't log in over the internet as this was the user the login attempts were for. This was probably the first security measure that I took beyond setting up a password. The next thing I did was set up passwordless login so that the hackers couldn't guess my username and password to login to the server. There are obviously many other security measures that you can and should take but I won't go into all of them here.
After a while, my personal projects started to pile up. It started to get a little messy with multiple scripts and programs running that would occasionally have to be restarted when they would crash or if the power to the server went out or any other number of reasons. I was started to get disorganized and annoyed with how manual the server was becoming. I started looking for a solution. I found cron jobs and startup scripts but what really caught my eye was docker and containerization. After only a short time exploring the concept, I had caught the docker bug. Before I knew it, I was containerizing all the things. With docker and docker compose I was able to put my scripts and programs into containers and have those containers restart automatically if they happened to shut down for any reason. This automated one of the most annoying parts of running my projects. I was also able to organize and control my projects more effectively. I could easily bring the whole service up or down with a single command. I didn't need to worry about port management as much because I could just map the local ports to any container port without conflict which also simplified my firewall settings. This is where I had another opportunity to learn about networking as well. Because I run a couple websites with subdomains and I want those subdomains to point to containers, I had to learn how to set up a dynamic dns (because I don't have a static IP) with my url registrar and set up reverse proxies for my web server to point to the right ports. I won't go into too much detail, but it was a very interesting challenge. There were so many benefits of running things in containers and I learned so much about the underlying concepts of virtualization and containerization as well. Now pretty much everything I deploy is deployed in a container.
The home lab has been completely invaluable to my learning journey. There have been so many little things that come up during the process that I would have never learned without it. The alternatives are paying for a cloud provider or only running things locally and neither were a great option for me. Sure, the server wasn't free, but it was only $200 up front and running locally doesn't give me any extra knowledge or challenge of deploying my work and making it available to others. I highly recommend anyone who has personal projects they want to manage and share, should have a home lab.