admoore.xyz

Creating the Server: Part 1

Tags: web_dev

This series of posts will detail what I did to set up my personal server. Overall, it was a pretty smooth process, with only a few snags here and there. Hopefully this can be of use to anyone else who might want to set up their own home server. In this first part I’ll cover how I chose my hardware and the initial installation process.

Why Make a Home Server? 🔗

These days there aren’t a whole lot of reasons to have your own physical server. If all you want to do is host a website, using any one of a dozen cloud providers is less of a hassle, and might even be cheaper than having your own server, all things considered. However, there were a few compelling reasons that made me choose to self-host on my own hardware.

  1. I wanted a media server that I can stream from in my own house without bandwidth limitation.
  2. I wanted direct control over the hardware and software I would run (i.e. no 3rd party telemetry or analytics).
  3. I wanted to get some experience with networking/hosting for my own personal development.

Considering these requirements, I decided creating a home server was the best option.

Choosing My Hardware 🔗

For my use case I only had one hard requirement: I needed the ability to transcode at least one, but preferably multiple 1080p video streams. To accomplish this, I looked for machines that supported hardware video encoding/decoding. Hardware encoding refers to using the GPU (whether integrated or discrete) to encode video. GPUs are designed in a way that makes it much more efficient to use them for encoding, as opposed to using the CPU.

Previously, I tried running a media server on my NAS itself, but that didn’t work out. Because I couldn’t use a hardware encoder, it had to use the CPU for encoding. Its CPU wasn’t the most powerful, and it couldn’t keep up with even a single 1080p transcode without buffering every 15 seconds.

With that in mind, I also decided to err on the side of getting a machine that was too powerful rather than too underpowered. I’d rather pay a little extra now than deal with not having enough resources later. So I started browsing online for different options.

I’ve had some experience with products in the Intel NUC Series before, and the small form factor made it very appealing. There’s not enough space in my apartment for a server rack, so I have to make do with keeping all my networking equipment in a small bookcase. The mini PC form factor was small enough that I could just plop it on top of my NAS, with room to spare.

I ended up selecting the NUC11PAHi70001, which is a bit of a mouthful of a model number. The important parts are the ‘11’ and ‘i7’, meaning that it’s an 11th generation i7 CPU. 8 cores should be plenty, especially since I shouldn’t be stressing the CPU too hard anyway, given the integrated GPU supports transcoding H.264 and HEVC video in hardware. The model I chose was a kit, and I got some RAM and an M.2 SSD for it in the same order. Everything included came to about $650. I was really surprised at just how cheap memory has gotten in the past few years.

Assembly and Installation 🔗

Assembling the NUC was pretty easy, just clicking the parts into place and screwing in a few screws. In less than 15 minutes I had the whole thing assembled and ready to go. For the operating system, I chose Ubuntu Server 22.04. I’ve used Ubuntu in the past and so I’m pretty familiar with it. So I downloaded the ISO file, stuck it on a flash, drive, plugged it into the computer, booted it up and waited. I waited for a few minutes, but nothing happened. Those of you who have created installation media in the past probably know what went wrong. It took me an embarrassingly long time to figure out that just putting the ISO image on a flash drive isn’t enough to make a bootable disk. You need a program to burn the ISO onto the drive before you can boot from it. In my case, I used balenaEtcher, a FOSS program that makes this process very simple. After making the installation media I was able to install the OS without any issues.

During installation there was one final hurdle: what do I name this server? After much thought, I decided to give my server a name that matched its hardware. After all, it is a NUC.

That’s all for this post. In the next one I’ll go more into detail about how I set up networking. After all, that’s how you’re able to read this in the first place!