Companion volume · read alongside the field manual · zero assumed

Ground School
Servers from absolute zero

The field manual tells you what to type. This volume explains what everything means — and does the two server setups the manual compresses into a paragraph, one click and one screen at a time: Hetzner from a blank account, and an old laptop wiped into a real server.

AssumesNothing
Pairs withField manual
CoversTerminal · SSH · Hetzner · Laptop
RuleSame checkpoints

When a field-manual step feels like a jump, come here, find the matching part, land it, go back. Chips like Field manual · Part 3 tell you where the two books connect.

The one idea that unlocks everything

Your everyday computer — “the cockpit”Where you sit and type. Mac, Windows or Linux — doesn't matter. It only needs a terminal window.
ssh — a remote-control cable made of encryption
The server — “the machine” A Hetzner box in Germany or an old laptop in your closet. Commands you type in the cockpit run here.
always on no screen needed where the agent lives

Almost every beginner mistake is typing a command on the wrong machine. Every code block in both guides is captioned “your laptop” (cockpit) or “your server” (the machine). Read the caption before you paste. That habit alone puts you ahead of most first-timers.

00

How to use this book

2 min read

You need this volume for exactly four moments in the field manual:

When the field manual says……come here for
“From your laptop's terminal” FM · Part 2GS 01 — what a terminal is and how to drive one
“ssh root@YOUR_SERVER_IP” FM · Part 2GS 02 — what SSH is, making keys, surviving first contact
“Route A — Hetzner, step by step” FM · Part 2GS 03 — every single click, field by field
“Option C — old laptop” FM · Part 2GS 04 + GS 05 — full wipe-and-install, then server manners

Two promises hold throughout: the checkpoint rule (yellow-striped boxes tell you what success looks like — never continue past a failed one), and the no-shame rule: every explanation here assumes you've never done this, because the whole point of owning a server is that nobody was born knowing this.

Checkpoint

You know which four doors this book opens, and you'll read code-block captions before pasting. Proceed.

01

Terminal survival school

15 mindone in the cockpit

The terminal is just a text conversation with a computer: you type an instruction, press Enter, it answers. That's the entire interface. No icons, no menus — which is exactly why it works identically on a €4 server with no screen.

S1

Open one on your computer

You haveDo this
Windows 10/11Start menu → type Terminal → open Windows Terminal (or PowerShell — same thing for our purposes). ssh is already built in.
MacCmd+Space → type TerminalEnter.
LinuxCtrl+Alt+T, or find “Terminal” in the menu. You already knew that.
S2

Read the prompt — it tells you where you are

anatomy of a prompt
agent@hq:~/agent$
│     │  │        └─ $ = normal user   (# would mean root, the all-powerful admin)
│     │  └── the folder you're standing in (~ = your home folder)
│     └───── the machine's name  ← glance here to know WHICH computer you're on
└─────────── who you're logged in as

That middle piece is your seatbelt: if it says hq you're on the server; if it says your laptop's name you're in the cockpit.

S3

The nine commands that are 95% of everything

CommandMeansExample
pwd“Where am I?” — prints the current folderpwd
lsList what's in this folder (ls -la = show everything, with details)ls ~/agent
cdChange folder. cd .. = up one. cd alone = go homecd ~/agent/memory
mkdirMake a foldermkdir test
nanoOpen a file in the beginner-friendly editor (creates it if missing)nano notes.txt
catPrint a file's contents to the screencat notes.txt
cp / mvCopy / move-or-rename a filemv notes.txt old.txt
rmDelete — no recycle bin, no undorm old.txt
sudo“Do this as admin” — prefixes another command, asks your passwordsudo apt update
S4

The four superpowers

S5

Two-minute driving lesson

your laptop — try it now
mkdir groundschool
cd groundschool
nano hello.txt        # type anything → Ctrl+X → Y → Enter to save & exit
cat hello.txt         # your words come back
cd ..
rm -r groundschool    # clean up (-r = folder and contents)
Checkpoint

You created, wrote, read and deleted a file without touching the mouse — and cat hello.txt printed your text. You can now drive any Linux machine on earth. The screen just doesn't scare you anymore.

Trapped in nano?

The shortcut bar at the bottom is the map: ^X means Ctrl+X (exit). It asks “Save modified buffer?” — Y, then Enter to confirm the filename. That three-key dance is the whole editor.

02

SSH, demystified

15 minone-time setup

SSH (“secure shell”) turns your cockpit terminal into the server's terminal. You type ssh agent@65.108.1.2, and from that moment every command runs over there, encrypted, until you type exit. That's it — a remote-control cable made of maths.

S1

Make yourself a key pair (better than passwords)

An SSH key is two files that only work together: a private key (stays on your laptop forever, like a physical house key) and a public key (a lock you can hand out freely — servers install the lock, your key opens it). One command mints the pair. Works identically on Mac, Linux and Windows PowerShell:

your laptop
ssh-keygen -t ed25519
# "Enter file in which to save…"  → just press Enter (default location is correct)
# "Enter passphrase…"             → Enter twice for none (fine for starting out),
#                                    or set one — it's a password ON the key itself

You now own two files in a hidden .ssh folder inside your home folder:

FileWhich halfRule
id_ed25519Private keyNever leaves your laptop. Never pasted anywhere. Ever.
id_ed25519.pubPublic key (the lock)Safe to paste into Hetzner, GitHub, anywhere. This is the one ending in .pub.
S2

Print the public half, ready to paste

your laptop
# Mac / Linux:
cat ~/.ssh/id_ed25519.pub

# Windows PowerShell:
type $env:USERPROFILE\.ssh\id_ed25519.pub

The output is one long line starting ssh-ed25519 AAAA…. Select it with the mouse, copy it. That single line is what Hetzner's “SSH key” box wants in GS 03. Pasting the private file instead is the classic mistake — if what you copied doesn't start with ssh-ed25519, you grabbed the wrong one.

Checkpoint

The cat / type command printed one line beginning ssh-ed25519. Your key pair exists and you know which half is shareable.

S3

First contact — the three prompts you'll meet

  1. The fingerprint question“The authenticity of host … can't be established. Are you sure you want to continue connecting?” Normal on the very first connection to any new server: your laptop has simply never met this machine. Type yes. (Seeing it again later for the same IP means the server was reinstalled — or, rarely, something fishy. After a reinstall, run the ssh-keygen -R YOUR_IP command the error itself suggests, then reconnect.)
  2. Invisible passwords. When a terminal asks for a password, nothing appears as you type — no dots, no stars. It is receiving it. Type it blind, press Enter.
  3. The prompt changes. Success looks like the prompt swapping to root@hq:~# or agent@hq:~$. You're now typing on the server.
S4

Leaving, and escaping a frozen session

inside an ssh session
exit                    # polite goodbye — back to your laptop's prompt

# session frozen (wifi blipped, laptop slept)? the secret escape sequence:
#   press Enter, then type   ~   then   .     (tilde, dot — nothing to paste)

Decoding the three classic SSH errors

ErrorActually meansFix
Connection timed outNothing answered at that addressWrong IP, server still booting, or (Oracle) cloud firewall. Re-copy the IP, wait 60s, retry.
Connection refusedMachine exists, but no SSH service listeningOn the laptop route: you missed the OpenSSH checkbox in GS 04 — fix is in that part's note.
Permission denied (publickey)Reached the door; your key/user didn't open itWrong username (Hetzner = root, your laptop install = agent, Oracle = ubuntu) — or the server never got your .pub.
Checkpoint

Nothing to run yet — this pays off the second you have a server. You know: fingerprint → yes, passwords are invisible, exit leaves, Enter ~ . escapes a freeze, and which username each server type expects.

03

Hetzner from a blank account

20 min~€4/mothe calm option

This is FM · Part 2 · Route A in slow motion — every field on every screen, including the two moments that confuse everyone (the identity check, and the forced password change).

S1

Account

  1. Go to hetzner.com/cloudSign up. Real name and address (it's a German company; they invoice properly — handy for your Categoria B paperwork, incidentally).
  2. Confirm the email they send.
  3. Add a payment method — card or PayPal.
  4. The identity check: brand-new accounts are sometimes asked to verify — a small card authorisation, PayPal confirmation, or occasionally a photo of ID. This is normal fraud-prevention, not a scam; approval is usually minutes to a few hours. If your account sits in “pending”, that's this. Wait it out.
S2

Create the server — field by field

Open console.hetzner.com → you'll see a default project (a folder for servers — the default is fine) → big red Add Server button. The form, top to bottom:

FieldChooseWhy
LocationFalkenstein or Nuremberg (Helsinki also fine)All near enough to Lisbon; the bot talks to Telegram, not to you, so latency is irrelevant anyway.
ImageOS Images → Ubuntu 24.04Everything in both guides assumes it.
TypeShared vCPU → cheapest tier, ~€4/mo: CX22 (x86, 2 vCPU/4GB) or CAX11 (Arm, often a bit cheaper)Either works — every command in the manual is architecture-agnostic. Shared vCPU is fine; the LLM provider does the heavy thinking.
NetworkingKeep Public IPv4 ticked (small extra fee)IPv6-only is cheaper but complicates your life (some networks can't reach it, some APIs neither). Buy the boring option.
SSH keysAdd SSH key → paste the one-line .pub from GS 02 → name it (“jelena-laptop”)Passwordless, phishing-proof logins. If you skip it, Hetzner emails a root password instead — workable, see S3.
Volumes · Firewalls · Backups · Placement · Labels · Cloud configSkip allThe manual's ufw is your firewall; backups are optional money; nothing else applies.
NamehqIt'll appear in your prompt forever — keep it short and pleasing.

Press Create & Buy now. Thirty seconds later: green dot, and an IPv4 address like 65.108.x.x. Copy it — that number is “YOUR_SERVER_IP” everywhere in both books.

S3

First login (two flavours)

your laptop
ssh root@YOUR_SERVER_IP       # fingerprint question → yes
Checkpoint

Your prompt reads root@hq:~#. You are standing inside a computer in Germany. From here, continue with FM · Part 3 exactly as written.

Three Hetzner facts worth knowing

04

Old laptop → server, from scratch

45 min€0 + electricityfull wipe

This turns a forgotten laptop into FM · Part 2 · Option C: a real 24/7 Linux server. It works because the agent only makes outbound calls — a machine behind your home router needs zero network configuration.

Read before touching anything

This erases the laptop completely — Windows, photos, everything, unrecoverably. Copy anything precious off it first. You'll also need: a USB stick of 4GB+ (it gets erased too), your wifi password, and about 45 minutes.

S1

Is the laptop good enough?

CheckMinimumComfortable
Age / CPU64-bit — essentially anything from ~2010 onwardsAnything from ~2014 onwards
RAM2 GB (the field manual's swap step makes this survivable)4 GB+
Disk30 GBAny modern disk; an SSD makes everything nicer
Battery / screenCan be half-dead — it'll live plugged in with the lid shutA working battery is a free mini-UPS for power blips

Unsure of the specs? They usually appear on the BIOS screen in S3 — or just try; the installer runs fine on anything that meets the minimum.

S2

On your main computer: download Ubuntu, make the USB

  1. Download Ubuntu Server 24.04 LTS from ubuntu.com/download/server (~3GB file ending .iso). Server, not Desktop — no graphical interface means every scrap of the old machine's RAM goes to your agent.
  2. Get a USB-writing tool: Rufus (rufus.ie, Windows) or balenaEtcher (etcher.balena.io, Mac/Windows/Linux).
  3. Insert the USB stick → open the tool → select the .iso → select the stick → Start/Flash. Accept the defaults (Rufus may ask about “ISO mode” — keep the recommended option). Five minutes.
S3

Boot the laptop from the USB

Plug the stick into the old laptop, power it on, and immediately tap the boot-menu key repeatedly — it's a tiny window. A menu appears; choose the USB entry (often named after the stick's brand, or “UEFI: …”).

BrandBoot menuBIOS (fallback)
DellF12F2
HPEsc then F9F10
Lenovo / ThinkPadF12 (some need the tiny Novo pinhole button)F1
AcerF12 (may need enabling in BIOS first)F2
ASUSEsc or F8F2/Del
Toshiba / MSI / SamsungF12 / F11 / EscF2
Old Intel MacBookHold ⌥ Option from the chime, pick the orange “EFI Boot”

Missed the window and it booted the old system? Just restart and hammer earlier. If the USB never appears: enter BIOS instead, find Boot Order, put USB first, save-and-exit (F10 usually). On some machines you must also disable “Secure Boot” — Ubuntu normally handles it, so only touch that if the stick refuses to boot.

S4

The installer, screen by screen

A text-based installer appears — no mouse; arrows move, Space ticks boxes, Enter confirms, Tab jumps to Done. In order:

  1. Try or Install Ubuntu Server → Enter.
  2. Language → English (fewer surprises when googling errors).
  3. Keyboard → pick your physical layout (Portuguese if that's the hardware).
  4. Type of installationUbuntu Server (the default, not “minimized”).
  5. Network — the one screen that varies:
    • Ethernet cable plugged in? It self-configures — you'll see an IP appear. Done.
    • Wifi only: select the wlan… device → Edit → choose your network, type the password → wait for an IP to appear next to it. If no wifi device is listed, the card needs drivers Ubuntu lacks — borrow an ethernet cable for install day; wifi can be sorted after.
  6. Proxy → leave blank.
  7. Mirror → default; let its test finish.
  8. StorageUse an entire disk (leave the LVM default as-is) → Done → the summary appears → Done → a red Confirm destructive action box: this is the point of no return for the old system → Continue.
  9. Profile → Your name: anything · Server's name: hq · Username: agent · password twice. Using agent here means you skip the user-creation step later — the field manual's user already exists.
  10. Upgrade to Ubuntu Pro → Skip for now.
  11. SSH configuration☑ Install OpenSSH serverTHE checkbox of the whole install. Arrow onto it and press Space until an X appears (Enter does not tick it — this snags everyone). Miss it and the laptop is unreachable remotely. Leave “Import SSH identity” as No.
  12. Featured server snaps → tick nothing → Done.
  13. Wait through the install log (10–20 min on old hardware; “downloading security updates” can sit a while — let it). → Reboot Now → pull the USB stick out when it asks.
S5

First boot: find its address, then leave the couch forever

The laptop boots to a black screen with a login. Log in on the laptop itself this one time (agent + your password — invisible typing, remember), then ask it for its address:

the laptop (just this once)
hostname -I
# prints something like:  192.168.1.47   ← its address on YOUR home network

Now, from your main computer, take remote control — and never touch the laptop's keyboard again:

your laptop / cockpit
ssh agent@192.168.1.47        # your number from above · fingerprint → yes
Checkpoint

Your cockpit prompt now reads agent@hq:~$. The old laptop is officially a server. Continue with FM · Part 3skipping S2 (the agent user already exists because you created it during install; the swap step is also skippable if the laptop has 8GB+ RAM).

“Connection refused”?

You missed the OpenSSH checkbox in step 11. On the laptop itself: sudo apt update && sudo apt install -y openssh-server — then ssh works. No reinstall needed.

One home-network truth: 192.168.x.x addresses only work from inside your house. That's fine — the agent talks outward to Telegram, so it works from anywhere in the world regardless. It's only your ssh maintenance that's house-bound; GS 05 fixes that too.

05

Make the laptop behave like a server

15 minlaptop route only

A fresh laptop install still thinks it's a laptop: close the lid and it naps, killing your agent. Four fixes turn it into an appliance you can shut, shelve, and forget.

S1

Closing the lid must mean nothing

your server (the laptop)
sudo nano /etc/systemd/logind.conf

Find these two lines, remove the leading #, and set both to ignore:

logind.conf — edit to match
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
your server
sudo systemctl restart systemd-logind   # applies it (your ssh session survives)
S2

Ban sleep entirely

your server
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

“mask” = bolts the door shut so nothing — power settings, stray packages — can ever suspend it. With the lid shut the screen is off anyway, which is all the power-saving you need.

Checkpoint

Close the lid. Wait a minute. From your cockpit: ssh agent@192.168.1.x still connects, and later your Telegram bot answers with the lid down. The laptop is now furniture with a job.

S3

Survive power cuts without you

S4

Pin its home address (so ssh stops moving)

Home routers hand out addresses by lease; after a router reboot the laptop can come back as .53 instead of .47. The agent doesn't care — only your ssh does. Fix it at the router: open its admin page (address on the router's sticker), find DHCP → Address Reservation (name varies), and pin the laptop (“hq”) to its current address. Two minutes, once.

S5

Optional: reach it from outside the house — Tailscale

Want to ssh in from a café when something needs a restart? Tailscale gives your devices a tiny private network across the internet — no ports opened, free for personal use:

your server (the laptop)
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up            # prints a login link — open it, sign in, approve
tailscale ip -4              # its permanent private address, like 100.84.x.x

Install the Tailscale app on your main computer (and phone), sign into the same account, and ssh agent@100.84.x.x works from anywhere on earth. Entirely optional — the bot never needs it; it's purely for your own maintenance access.

Checkpoint — graduation, laptop edition

Lid closed, tucked on a shelf, plugged in — and the bot answers from your phone on mobile data. If you did S5, ssh from a different network reaches it too. It is now a €0 datacenter.

06

Linux orientation for the impatient

10 min read

Six concepts the field manual uses without ceremony. Read once; things stop feeling like incantations.

① The map — where things live

PlaceWhat's there
~  (= /home/agent)Your home folder. The ~ squiggle is shorthand for it.
~/agentThe entire project: agent.py, .env, venv/, memory/, projects/. Back this folder up = back everything up.
/etcSystem-wide configuration — where the FM · Part 9 service file and Caddy config live. Editing here needs sudo.
/var/log & journalctlThe system's diary. Your agent's diary is read with journalctl -u agent.
/tmpScratch space, wiped on reboot.

sudo — the admin prefix

Normal users can't modify the system; sudo in front of a command runs that one command as administrator, after asking your own password (invisible, as always). Files in your home folder never need it; anything touching /etc, installing software, or managing services does. If a command fails with “Permission denied” on a system path, the answer is usually just: same command, sudo in front.

apt — the app store

the whole of apt, honestly
sudo apt update            # refresh the catalogue (prices haven't changed — all free)
sudo apt upgrade -y        # install updates for everything (-y = stop asking, yes)
sudo apt install -y curl   # install a thing by name

④ venv — why Python lives in a bubble

Modern Ubuntu refuses system-wide pip install (that's the externally-managed-environment error) to stop projects trampling each other. A venv is a private bubble of Python inside your project folder. Two things to remember:

venv in practice
cd ~/agent
source venv/bin/activate     # step INTO the bubble → prompt gains a (venv) prefix
pip install whatever         # installs affect only this project
deactivate                   # step out

And the trick that makes FM · Part 9 work: the service file runs venv/bin/python directly — using the bubble's Python by full path needs no “activation”. Activation is for humans; paths are for robots.

chmod 600 — who may read a file

Every file has permissions. chmod 600 .env means “owner may read and write; everyone else, nothing”. The manual applies it to .env because that file holds your tokens — on a multi-user system it's the difference between a config file and a leak.

⑥ Reading an error without panic

Checkpoint

You can say what sudo, apt, a venv and chmod 600 each do in one sentence — and you know errors are read bottom-up. That's genuinely the whole survival kit.

07

Getting unstuck & disaster recovery

read oncepanic antidote

The unstick ritual (in order, every time)

  1. Read the last line of the output, out loud if needed. It usually names the problem in plain-ish English.
  2. Retreat to the last passed checkpoint. Whatever broke lives between there and here — usually one command, often one character.
  3. Check the caption. Was that command meant for the cockpit or the server? (This is the #1 cause.)
  4. Search or ask with the exact text. Paste the verbatim error into a search engine, into Claude, or — once it's running — into your own bot. Never paraphrase an error.
  5. Still stuck after 20 minutes? Walk away for ten. This is a real technique, not a platitude.

Disaster table

DisasterRoute back in
Locked out of SSH (firewall mistake, key chaos)Hetzner: server page → >_ Console — a browser terminal that ignores SSH entirely. Laptop: it's in your house — open the lid and log in on its own keyboard.
Forgot the server passwordHetzner: server page → Rescue → Reset root password. Laptop: log in locally as agent and run passwd; if the login itself is forgotten, honestly — reinstall (GS 04, 45 min) and restore from git.
Laptop's IP changed (ssh suddenly times out at home)On the laptop: hostname -I for the new number; then do GS 05 · S4 so it never moves again.
Server feels haunted / half-brokensudo reboot, wait 60s, ssh back in. Turning it off and on again is legitimate systems administration.
Truly wrecked beyond repairSee below — this is the safety net that makes everything else low-stakes.

Why nothing here is ever truly lost

Your agent's entire identity is one folder: ~/agent — the code, the .env secrets, the memory/ brain, every project. The field manual already put it under git. Add one habit and total destruction becomes a 30-minute inconvenience — run this from your cockpit every week or two:

your laptop — the weekly parachute
scp -r agent@YOUR_SERVER_IP:~/agent/memory  ~/agent-backup/
scp    agent@YOUR_SERVER_IP:~/agent/.env     ~/agent-backup/
# memory = the brain · .env = the keys · agent.py lives in this guide anyway

Worst case, ever: new server (GS 03 or GS 04) → field manual Parts 3–5 → copy those two things back → the agent wakes with its memory intact, asking what's next. On Hetzner, a snapshot shortcuts even that.

Checkpoint — final

You know the ritual, the doors back in, and that the blast radius of any mistake is 30 minutes. That knowledge is what "knowing servers" mostly is. Class dismissed — back to the field manual.