Deep Dives

Self-Hosting on Two Old Laptops

I turned two old laptops — an HP G62 from 2010 and a Dell from 2012 — into a home server setup running Ubuntu 24.04. Split by exposure rather than by role: one box faced the internet, the other didn’t. Between them they ran a few public sites, a VPN, a private git server with CI, DNS for the house, and file shares. I ran it for seven months, then shut it down. Here’s what I learned.

Why Bother

Cloud storage costs money and someone else holds your data. A home server costs electricity and an old laptop you weren’t using anyway. I wanted to own my files, run my own services, and learn how infrastructure actually works. That last reason turned out to be the most valuable — this project taught me more about networking, security, and Linux administration than any course.

The Setup

Hardware: An HP G62 from 2010 and a Dell Inspiron 3520 from 2012 — sixteen and fourteen years old by the time I shut the lab down. 5.6 GB of RAM on the box facing the internet, 3.7 GB on the other. No monitor, no keyboard on either — headless after initial setup, lid closed, tucked on a shelf.

OS: Ubuntu 24.04. No GUI — everything through SSH. A desktop environment would waste RAM on machines that thin.

Network: Split by exposure. One box had the router’s port forwards pointed at it and faced the internet directly; the other had none at all and only ever spoke to the LAN.

internetrouterstatic IPpublic boxnginx, apps, VPNport forwardsno forwardsLAN boxDNS, git, file shares

Two machines to patch instead of one, but a harder boundary than containers or separate users would have given me on a single box — getting to the LAN box means owning the public one first and then pivoting across the network.

What’s Running

Public box — bare metal host running a small container stack: nginx as a reverse proxy with automated SSL, three apps, ntfy for notifications, and Watchtower keeping images current. The whole stack idled around 285 MB, which mattered more than it sounds on 5.6 GB total — no room for a leaking container. WireGuard ran natively on the host rather than in a container, since it needs kernel-level control of the network interface and containerizing it buys nothing.

LAN box — all bare metal, no containers at all. With Pi-hole and Gitea already resident on 3.7 GB, a container runtime would have cost memory for nothing. Pi-hole for network-wide DNS filtering, Gitea plus a Gitea Actions runner for CI, Samba for file shares, rsyslog collecting the public box’s own logs (so a compromise over there can’t erase the evidence of itself), and pyLoad.

Nextcloud lived on the public box briefly — installed in March, gone within a few weeks. Three containers plus MariaDB and Redis, 596 MB of RAM just to do file sync on a 2010 Core i3. It worked in the sense that it answered requests. Deleted it, migrated the data out, and replaced the whole thing with a Samba share, which does most of what I actually wanted for a fraction of the memory. It was the first of eleven services I installed and later deleted — a dashboard, a container management UI, an uptime monitor, a file-sync tool, and others — installed because I could, not because I needed them.

public box, 5.6 GBstack idled around 285 MBNextcloud: 596 MB, then deletedreplaced with SambaLAN box, 3.7 GB

Security Hardening

This is the part most tutorials skip and the part that matters most:

  • SSH key authentication only — password login disabled completely.
  • Custom SSH port to cut noise from automated scanners. Ubuntu 24.04 made this an actual fight: ssh.socket overrides the port set in sshd_config, and disabling the socket isn’t enough either — it re-enables itself on reboot unless you mask it.
  • Fail2ban watching SSH logs — auto-bans IPs after failed attempts. (A good use case for process tricks if you want to watch the ban list in real time.)
  • UFW firewall — with the catch that Docker writes its own iptables rules directly and ignores UFW completely. Every port I thought was firewalled was actually open, until I set "iptables": false in the Docker daemon config and wrote the NAT and FORWARD rules into UFW’s own before.rules by hand.
  • Containers pinned to a user-defined Docker network rather than the default bridge — partly isolation, partly because the default bridge has no NAT rules at all and one-shot containers couldn’t resolve DNS on it.
  • AIDE watching the public box for unexpected file changes, and every secret pulled out of the compose files into one chmod 600 env file instead of being hardcoded per script.

Problems I Hit

Power. The house runs on solar, and I learned fast not to build any reliability assumption on top of it. The supply cut out every day. The laptop batteries rode out some of the cuts, and at the worst stretch the rest still meant six unclean shutdowns in ten days. That single fact shaped more of the setup than anything else — every service had to come back on its own after a hard power loss, because “restart it by hand” isn’t a plan you can rely on being awake for.

CDN blocks. Some package mirrors and CDNs are blocked or badly throttled from Syria — Docker pulls, when they ran at all, crawled at 9–14 KB/s. Workaround: download on my main laptop, which has different network access, then scp it to the server. Not elegant, but it works.

Lid close behavior. Laptops default to sleeping when you close the lid. Had to configure systemd to ignore the lid switch: edit /etc/systemd/logind.conf and set HandleLidSwitch=ignore.

What It Taught Me

This project is where I realized I’m not really a web developer or an ML researcher — I’m someone who thinks in infrastructure and systems. The lesson underneath that wasn’t “build a reliable server” — the power was never reliable, not once in seven months. It was building things that could come back on their own after being killed at a random moment, and being honest about which services actually needed to survive that and which didn’t. The one thing with real visitors moved off the hardware entirely in the end; everything that could tolerate a few hours of downtime stayed until I shut the whole thing down.

See Also