Working on different platforms, programming languages and even other adventures like fixing an underperforming server or various sysadmin tasks make having a place where you can test, experiment, destroy and rebuild something a must-have.
Enter the home lab. What is a home lab? Simply put, a home lab consists of one or more servers (or normal PCs acting as servers), that you have in your home and you use them to experiment and try out stuff.
But to be more precise, a home lab is something configured for your needs and set up just as you need it to get better at what you do. You can have a home lab as a sysadmin, as a networking guy, as a programmer, heck you might even want a home lab if you’re just getting started on any of the above.
After having my own lab for about 5 years now, if not even more, and seeing the popularity this sort of setups get, I thought I’d share some of my ideas on this topic with you guys. I hope you’ll find this article useful and let’s go!
Why do you need a home lab?
So you can fail in the privacy of your own home. As many times as you like.
In all seriousness though, experimenting on production servers, and even worse on your client’s production servers is a bad idea that can bring a lot of problems.
A home lab gives you the freedom to test anything regarding your current task, and if you fail, nothing bad happens. You can just re-start and figure out why things didn’t work.
I also like to have a staging container for each of my live websites, so I can first push updates and add features there and check out if everything is ok before touching a live blog or website. It’s just easier, especially if you are interrupted. You can just leave everything a mess for a couple of hours since nothing is live or critical and you’re in your own isolated environment.
Who needs a home lab?
At first, you might be thinking that a home lab is for a networking engineer and/or someone who is pursuing a Cisco CCNA certification or something similar. Probably due to some people’s insane setups (of which I am extremely jealous), usually in a server rack with several switches, servers, etc. Just search for home lab on Reddit and you’ll see some crazy cool setups.
I think a home lab can be very useful to someone falling in either of the below categories:
- a system administrator – and similar positions;
- a networking engineer – and similar positions;
- a DevOps engineer;
- a programmer, no matter the programming language;
- someone who is a fan of self-hosting various tools and services;
- anyone who is looking on learning and improving on any of the above;
And yes, before you say anything, knowing how to configure your own server in a Linux distro, and knowing how to set up a tech stack or a specific environment might not be in your job description. But assuming you want to learn something new while making something that will help you get better at what you do, a home lab is going to be useful.
Plus, it’s a great way to make sure you’re not completely oblivious to what’s going on behind the scenes. Sometimes you find out interesting things while meddling around with your own setup.
But a server is expensive plus other costs
Before thinking about buying any equipment, you have to do two things:
- Figure out what you want from your home lab. Are you a programmer? Do you really need an overkill switch? Do you really need a 16-core Xeon? If you want something to host a couple of VM’s or Docker containers so you can further your knowledge in PHP programming I have bad news: you don’t. A decent PC with at least 4 GB of RAM will suffice. Or even a Raspberry Pi.
- Do you have some old parts laying around? One of the ‘servers’ in my home lab is actually a Pentium G3420 with 8 GB of RAM and with a 250 GB SSD. I’ve just invested in a sturdy power supply, and an old PC became a server. It’s running Centos 7 happily and if I recall correctly, the biggest uptime was ~200 days. So yes, consumer hardware can do the job happily. Repurpose old parts if you can, you’ll save quite a bit.
As with most things, I’d advise you to start small and go from there. And don’t shy away from used enterprise/server-grade gear, if you need it.
Last but not least, do consider that for programming and software-only related tasks you always have the option of getting a cheap cloud-based server or VM from Hetzner, Digital Ocean, or other providers and experimenting on that. Depending on how deep you want to go with your lab, it might be a great option to rent a cloud machine for 10-20$/month. Especially if electricity is very expensive in your area.
For example: for about 11$ you can get the CX31 cloud server from Hetzner, and it has 2 cores, 8 Gb of RAM, and 80 GB of SSD disk space. More than enough for any development environment and experiments.
Choosing gear based on what you want your home lab to do
Once you figure out what you want to learn/do with your home lab, you can start creating it.
I will not go on and make specific hardware recommendations, but you should make some informed decisions before pulling the trigger on any kind of hardware. This being said, search online for other people’s home labs and see what they run. And check for reviews, ideas and even ask on Reddit or other places for opinions.
When choosing your gear, these are my basic ideas that you need to keep in mind:
- a normal PC, a server, and even a rack need a place to sit. A place that has access to power, is pretty safe, and has access to your network;
- make sure that you can reasonably physically access the lab. Sometimes things go wrong, or maintenance like cleaning needs to be done;
- great locations: closet, garage, attic, and even basement depending on your home;
- a server usually consumes more electricity and creates more noise;
- newer hardware uses less electricity but it ain’t cheap. Strive for a good balance;
- consumer-grade hardware doesn’t mean it can’t be used as a server or that it’s not reliable enough to be used as a lab. I have a motherboard from 2010 (it’s a Gigabyte GA-H61M-DS2), that is still alive and kicking. An 11 years old PC might sound like a bad idea for a gaming PC or workstation, but for a small Linux web server, it’s freaking great!
- more RAM is always nice to have;
- all above being said, a Raspberry Pi can be enough for a lot of people. Especially the 8 GB RAM variant; really, it’s an amazing piece of technology;
- protect your hardware with a UPS that allows you to at least safely shut down everything in case of power outages;
Regarding location, and where to actually place your hardware, I’d avoid a living room or somewhere too ‘in the line of sight’ just because it can be annoying to have something that makes noise and generates heat all the time when you’re not using it. Plus all the flashing lights might be distracting.
The main advantage of having the lab outside of living areas is that you can actually cool it properly. Noise won’t bother you since you can’t hear it. Also, you won’t make a mess once the maintenance is needed. Depending on the environment, cleaning 2-3 PCs that have been running 24/7 for the past year, can get dusty.
This being said, you can also shut down your home lab if you’re not going to work with it.
Advantages of a home lab and how it helped me
The main purpose of my home lab is that it allows me to test things before I go and do it in production on a client’s machine. And I’m not just talking about fine-tuning settings at the OS or service level. I’m also talking about applications like Magento or WordPress.
This need arises quickly when you have a couple of clients incoming, that have no staging site, no development medium, or anything. They just have their host, running their website and that’s it. Oh, and they’re not willing for long-term support or anything. Just a redesign, upgrade, new feature, or something like that and preferably cheap. So explaining why they need a staging site when their live host is close to being underpowered with no signs of upgrades planned is kind of hard. Getting approval even harder.
The second thing that pushed me to have a home lab is the electricity and internet infrastructure in my area. We have electricity outages quite often (by the standards of a geek that’s online too much). Especially during the night but sometimes even in broad daytime. I’m talking of 5-minute power outages + 3 to 5 minutes until my modem reconnects, nothing serious. Enough to annoy you, not enough to waste too much time. The exceptions are those occasional pesky Fridays when my ISP decides that 4 hours without internet access for a whole neighborhood or city is not that bad.
Enter the home lab: I just need my LAN, the internet can be down and my UPS can take about 32minutes of an outage. The bonus part, is I have a gigabit connection with 1ms ping to the application I’m working on.
Why did I choose a home lab instead of having a VM act as a lab?
Apart from negating internet connectivity downtimes, I also wanted to learn a bit more than the basics of networking, a bit more about Docker, and a lot more about Linux especially about RHEL distros and Ubuntu Server.
Why learn all those if my actual mail role is to be a developer?
A lot of reasons actually:
- be able to properly debug something, and quickly determine the root cause;
- be able to actually fix something that is not just tied to the application;
- be able to completely set up a secure VPS or a cloud server for my own projects and even for work;
- get better at my job;
But how does being able to create my own machine running Ubuntu and Docker help me be a better developer? Easy: quickly spawn as many things I need until I get to the bottom of a problem or issue I am hunting. I’m a big fan of learning by failing. And with a machine that I have really fast access to, I can fail faster therefore I save time :-))
Also, if you couldn’t tell by my other content, I love building PCs, tinkering with them, and just about anything tech-related.
My home lab
This wouldn’t really be complete if I didn’t showcase my home lab. Pictures will come soon as I’m into the process of rearranging stuff in that room and it’s a mess right now.
Every machine as well as the networking equipment have their own NAS.
I have an old PC with a new PSU that acts as a NAS. It’s a Pentium G3420 with 8GB of RAM, that runs Open Media Vault with Plex and NextCloud.
The work horse
It’s a Ryzen 2700 based machine with a 500 GB Samsung Evo SSD and 32 GB of DDR4-3200MHz. A beast! This machine’s role is to act as a development server as well as provide access to the in-work projects to some clients. It also hosts my own Gitea instance and other internal tests. Running Centos 7 with Docker and Portainer, and of course an Nginx reverse proxy. It’s opened to the world (can be accessed from the outside), every subdomain has SSL and etc.
It’s the testing machine. From stupid experiments to things I just don’t want to bloat the workhorse with (or I consider it’s not worth it). It’s an Asus ROG notebook with an i7-6700HQ, 32GB of ram, and a 250 GB Kingston SSD.
A poor Asus RT-AC66U that is quite full. Literally no LAN port free and a lot of wireless devices attached to it. Apart from this I also have the modem from my ISP, that runs as a router just because I needed another LAN port for extending the wired network to the kitchen.
Obviously, I am looking for a managed switch in the near future, as I have no wired ports available for anything new. Still searching for some good options that will not break the bank. Maybe hoping for a managed 2.5 Gbps switch.
Looking at upgrading the network speed of the NAS… either by a 2.5Gbps NIC (if I get the appropriate switch) or another method.
Replace the laptop with another machine, more reliable. (expecting the fan to fail on that laptop as it did on my other Asus notebooks)
Maybe sometime invest more in a cabinet and some server cases so I can have everything better organized. I saw some 4U cases that can fit mATX motherboards and ATX power supplies, so it might work just perfect.
Security and home labs
This one’s pretty easy. As long as you’re not opening ports to the outside world, you have nothing to worry about. Of course, this means that what you do on those machines is only accessible through your home network or LAN.
If you do decide to make something public, even if it’s just for friends and not the whole wide world, please make sure to try and harden the home lab server as much as you can and stay up to date with those security updates. From choosing strong passwords and setting up SSH authentication through a Key to more advanced stuff.
And as a side note, don’t bother hosting e-mail. Way too complicated in my opinion. It’s easier to just fork over a couple of bucks for a decent service.
And while we’re at it, having everything locked inside your own network is a great feature security-wise, if you’re paranoid that anyone might see what you’re testing and working on.
Conclusion – In the end it’s meant to help you.
There will always be pros and cons to anything. But if you’re in tech, or want to get into it, and you already have a spare PC (or almost complete PC) that you’re not using, it’s almost a no-brainer to give home labbing a try.
Found this article interesting? Share it!
Thanks for reading!
Tech jack of all trades. Programmer, sysadmin and a general tech enthusiast. I work with a lot of stuff, and love learning and talking about new or interesting stuff.