I found myself a few months ago wishing for a home server. I had a few projects I was currently working on and a few on the horizon in which I wanted to be accessable to me and others from anywhere. I also needed a place to put this portfolio. Paying for hosting was always a choice, but my DIY blood told me the choice to make ahome server was clear.
I began by searching how self hosting even works. I had tried numerous times to set up a minecraft server for me and my friends, and never figured it out. I would follow whatever steps the article I had found at the time had given me and I would give my friends my IP address and they would never be able to connect. Turns out, there is a difference between internal and external ip. To some people, this might seem obvious, but it was new to me. Turns out, a router masks your ip address by giving you a local IP, and you use your routers IP by forwarding you ports to the router.
Next was DNS. How do I get ’pknepps.net’ reserved. I never realized that DNS was essentially a phonebook in which you had to pay a service yearly to renew. I always thought domain collecting just meant buying once and forgetting about it. I had to research DNS registrars, which ones were good, which ones were bad, and which ones were scams. I settled for porkbun. A humurous site which had very cheap domain renewals, but was reviewd to not be too beginner friendly. I figured through my technical backround, I wouldn’t have found it too difficult.
The obvious other key piece was the computer. I needed something to constantly run and keep everything up. I turned to mini-pc’s. I would be running my server headdless, so I wouldn’t need a graphics card, or any major computing power. After looking through a few, I settled on the Rasberry PI 5. With 8 GB of ram and an upgradeable nvme slot (I happend to have a 512 GB laying around), I figured it would be perfect.
My Rasberry PI came in the mail a few days later. It was quite intuitive to put together. It also came with a 32 GB sd card with PI-OS already mounted, but since I wanted my server headless, I went ahead and wiped it, putting on a fresh install of PI-OS with the default settings I wanted.
I was able to immediately SSH into my new server. So I started going through everything on my install checklist. I first installed a firewall, ufw, and it immediately kicked me from my SSH setting and I was locked out. Turned out, I had opened the SSH port incorrectly through ufw. So, when I turned it on, it ended my session.
To fix this wasn’t easy, I couldn’t plug a monitor into the machine because it was headless. So, I turned it off, removed the sd card, plugged it into my laptop, found the ufw config file, and wrote a new line allowing SSH access from my computer. Once I was back in, I turned off ufw, changed the settings correctly this time, and turned it back on.
After this, everything else was easy. I only opened ports for services that I would be using, and started those servicesxjj.