> TAKE IT BACK STEP 01 / 06
root@takeitback:~/guide/01-hardware$ cat readme.md
STEP 01

Get a box you own

Every other step in this guide sits on top of one machine you control. This is how to pick it, install a clean base system, and lock the front door before anything is exposed.

DIFFICULTYBeginner
TIME1–2 hours
COST$0–120
REPLACESNothing yet — this is the foundation

Why local first

You have a few realistic options for where your services live: the old laptop in your drawer, a small dedicated computer on your home network, or a rented virtual private server (VPS) in a datacenter. Start at home. It is cheaper, nothing is exposed to the public internet until you decide it is, and mistakes stay private while you learn.

Pick the operating system it runs

The box needs an operating system. This choice shapes every command in this guide, so the tabs on each step match it. Choose based on the hardware you have — and be honest about the trade-offs.

The natural home for self-hosting: free, light, stable, and what almost all this software targets first. Install Debian (rock-stable) or Ubuntu Server LTS. Do a minimal install with just SSH selected — no desktop.

flash & boot the installer, then # pick: minimal install, OpenSSH server, no desktop
hostname: takeitback
user: you (not root)

This is the recommended path. If you're repurposing an old laptop, wiping it and installing Linux gives the longest, lightest life as a server.

A Mac mini or an old MacBook makes a genuinely good, quiet server, and macOS is Unix underneath so most tooling works. Install Homebrew — the package manager this guide will lean on throughout:

you@mac:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then, in System Settings → General → Sharing, turn on Remote Login to enable SSH. Also set the Mac to never sleep while plugged in, or it won't answer at 3am.

Honest take: native Windows is the weakest base for these services, and faking PowerShell equivalents would send you down broken paths. The right move is WSL2 — a real, full Linux environment running inside Windows. You then follow the Linux tab for every step.

powershell (as administrator) PS> wsl --install -d Ubuntu
# reboot, set a username/password, and you're in a real Ubuntu shell

For anything containerized later, install Docker Desktop, which uses this same WSL2 engine. From here on, use the Linux commands inside your WSL2 shell.

Lock down remote access (SSH)

SSH is how you'll control this box without a monitor attached. Out of the box it may accept passwords, which bots hammer relentlessly. Switch to key-based login. First, on the computer you'll connect from, create a key and copy it to the box:

on your everyday linux machine you@laptop:~$ ssh-keygen -t ed25519
you@laptop:~$ ssh-copy-id you@192.168.1.50

Then on the box, edit /etc/ssh/sshd_config so these read exactly, and restart:

PermitRootLogin no
PasswordAuthentication no
root@box:~$ sudo systemctl restart ssh

Same keys, same idea — macOS ships the identical OpenSSH tools:

on your everyday mac you@mac:~$ ssh-keygen -t ed25519
you@mac:~$ ssh-copy-id you@192.168.1.50

Harden the same /etc/ssh/sshd_config lines, then reload the service:

you@mac:~$ sudo launchctl kickstart -k system/com.openssh.sshd

Work inside your WSL2 shell (or PowerShell — both ship OpenSSH now):

wsl2 shell or powershell $ ssh-keygen -t ed25519
$ ssh-copy-id you@192.168.1.50
# powershell has no ssh-copy-id; append the key to the box's
# ~/.ssh/authorized_keys by hand, or run this from WSL2

The hardening happens on the box, so it follows the box's OS tab — not Windows.

// don't lock yourself outOpen a second SSH session and confirm you can still log in before closing the first. If key login fails, that open session is your way back in to fix it.

Keep it patched

A server you never update is a liability. Turn on automatic security updates so it happens without you thinking about it.

root@box:~$ sudo apt install unattended-upgrades
root@box:~$ sudo dpkg-reconfigure unattended-upgrades
enable automatic updates you@mac:~$ sudo softwareupdate --schedule on
# keep Homebrew packages current too:
you@mac:~$ brew update && brew upgrade

Windows Update handles the host automatically. Keep your Linux environment current inside WSL2:

$ sudo apt update && sudo apt upgrade

Before you move on

That's the foundation. Next we make this box quiet the entire network.