How I Turned an Old Laptop Into a Headless Linux Server
Repurposing a 2011 gaming laptop into an always-on home server running Linux Mint — closed lid, no monitor, SSH access from anywhere
Ingredients
- An old laptop you’re not using — mine was an old gaming laptop from 2011 (4GB RAM, 128GB SSD) (free, already owned)
- Linux Mint 22.1 — beginner-friendly Linux distro with great hardware support (free)
- A USB drive (8GB+) — to flash the installer (free, already owned)
- balenaEtcher — tool for writing the Linux ISO to the USB drive (free)
- Your home router — to assign the server a static local IP address (already own)
- A Mac or PC to SSH from — any modern machine with a terminal (already own)
The Problem: Automation Needs a Home
After building a few automated systems on my Mac — Garmin health recaps, website monitoring, AI batch jobs — I ran into the same wall: my Mac has to be awake for any of it to work. Sleep mode, lid close, a reboot for an update — any of it kills the cron jobs. I was waking up to missed recap emails more often than I wanted.
What I wanted was a machine that just… runs. Always on. Always connected. Something I could SSH into from anywhere, offload all my scheduled jobs to, and forget about. A home server.
I had an old gaming laptop from 2011 sitting in a closet. Small form factor, barely bigger than a MacBook Air, and it still works fine. The GPU is ancient, but for running Python scripts and shell jobs overnight, it’s overkill. The hardware was free. The OS was free. The whole project cost me an afternoon.
Session 1: Installing Linux Mint and Going Headless
Pace: Methodical. OS installs have a lot of waiting. The configuration work was quick once the system was up.
Why Linux Mint?
I didn’t want to fight the operating system — I wanted to use it. Linux Mint is the most beginner-friendly Linux distribution available. It looks like a normal desktop, has a real package manager, and its hardware compatibility is excellent even for older machines. Ubuntu would have worked too, but Mint has slightly less friction out of the box.
For a headless server (no monitor, no desktop), a lot of guides recommend Ubuntu Server. I chose the full Mint desktop install anyway — I wanted the option to plug in a monitor and navigate normally if something went wrong. Once configured, the desktop just sits unused in the background. No real downside.
Phase 1: Flash the Installer
Downloaded the Linux Mint 22.1 ISO (~2.7GB), opened balenaEtcher, selected the ISO, selected the USB drive, clicked Flash. About 8 minutes. Plug the USB into the laptop, boot to the BIOS (F2 on mine), set the boot order to USB first, save and exit.
🔧 Developer section: Boot order change
- Restart the laptop and immediately hold
F2to enter BIOS setup - Find the Boot tab, drag USB to the top of the boot priority list
- Save changes (F10) and exit — the laptop boots from the USB into the Mint live environment
From there, the Mint installer is a guided wizard. Chose "Erase disk and install Linux Mint," set a username and password, let it install. Took about 20 minutes. Rebooted, removed the USB, and was looking at a Linux Mint desktop.
Phase 2: Keep It Running with the Lid Closed
By default, closing a laptop lid suspends the machine. That defeats the purpose of a home server. One config file change fixes it:
🔧 Developer section: Lid close behavior
- Edit
/etc/systemd/logind.conf— find the line#HandleLidSwitch=suspend - Uncomment it and change it to
HandleLidSwitch=ignore - Also set
HandleLidSwitchExternalPower=ignorefor when plugged in - Restart the service:
sudo systemctl restart systemd-logind
Closed the lid. The machine kept running. That’s the whole trick for "headless" — it’s not a special mode, it’s just telling the OS to ignore the lid sensor.
Also disable auto-suspend in Power Settings (System Settings → Power Management → set suspend to "Never"). The logind.conf handles the lid, but the desktop power manager has its own idle sleep timer that can override it.
Phase 3: Install SSH Server
SSH (Secure Shell) is what lets me connect to the server from my Mac — I type a command in Terminal, it opens a session on the laptop as if I were sitting in front of it. Linux Mint doesn’t come with an SSH server running by default, but installing it takes 30 seconds:
🔧 Developer section: SSH server setup
sudo apt update && sudo apt install openssh-server -y- SSH starts automatically and enables itself on boot
- Verify it’s running:
sudo systemctl status ssh→ should showactive (running) - Find the LAN IP:
hostname -I→ note the 192.168.x.x address
First SSH test from my Mac: ssh username@[your-lan-ip] — use the IP from hostname -I. It prompted for the password I set during install. Typed it. Got a shell prompt on the laptop. Done.
Phase 4: Static IP via the Router
Dynamic IPs change. If the router assigns a new IP to the laptop overnight, my SSH config breaks. The fix: tell the router to always give the laptop the same IP. This is called a DHCP reservation (or "static IP") and every home router supports it.
🔧 Developer section: DHCP reservation (Google Wifi / Nest)
- Open the Google Home app → Wifi → Devices
- Find the laptop (it shows up by hostname)
- Tap the device → Reserved IP → assign your chosen static IP
- Restart the laptop to pick up the reserved IP
- Verify:
hostname -Ishould show the exact IP you reserved
Now the IP never changes. Every SSH connection I make from my Mac goes to the same address, every time.
Session 2: SSH Config and Remote Access from Anywhere
Pace: Fast. SSH config is mostly just editing one file and copying a key.
SSH Key Authentication
Typing a password every time I SSH in gets old fast. SSH keys replace passwords with a cryptographic key pair — a private key that stays on my Mac, and a public key that lives on the server. Once set up, I connect with no password prompt at all.
🔧 Developer section: SSH key setup
- Generate a key on the Mac (if you don’t have one already):
ssh-keygen -t ed25519 - Copy the public key to the server:
ssh-copy-id username@[your-lan-ip] - Test:
ssh username@[your-lan-ip]— should log in without a password prompt
SSH Alias in ~/.ssh/config
Typing the full IP every time is fine but not ergonomic. A few-line config entry cuts it down to a single alias:
🔧 Developer section: ~/.ssh/config entry
- Open
~/.ssh/configon your Mac (create it if it doesn’t exist) - Add:
Host homeserverHostName [your-lan-ip]User yourusernameIdentityFile ~/.ssh/id_ed25519 - Now:
ssh homeserver— one word, connects instantly
The SSH alias works instantly when you’re on the same WiFi. From outside your home network (a coffee shop, traveling), you’ll need either a VPN or port forwarding on your router. I handled this with port knocking — covered in the next post.
Setting the Hostname
The default hostname after install was something generic. I changed it to something short and recognizable — easy to remember at a glance in terminal prompts:
🔧 Developer section: Change hostname
sudo hostnamectl set-hostname your-hostname- Edit
/etc/hosts— replace the old hostname with your new one on the127.0.1.1line - Reboot to apply everywhere
Final Output
A fully operational home Linux server that:
- Runs 24/7 — lid closed, never sleeps, always on the network
- Has a fixed LAN IP — DHCP reserved, never changes
- Accepts SSH connections — passwordless, key-based, one command from my Mac
- Ready for automation — cron, systemd services, Python scripts, whatever I put on it
One command from the Mac. The server responds instantly — lid closed, in another room.
What went fast
- Linux Mint install — genuinely beginner-friendly, wizard-based, no command line needed for the base install
- SSH server — one apt install command, starts automatically, just works
- DHCP reservation — 2 minutes in the Google Home app, no router config files to edit
- SSH key setup —
ssh-keygen+ssh-copy-id, two commands
What needed patience
- Lid close behavior —
logind.confis the right fix, but the desktop power manager has a separate idle sleep setting that overrides it. Had to disable both before closing the lid confidently. - BIOS boot order — every laptop is different. Mine uses F2 for BIOS; other machines use F12, Del, or Esc. If the USB doesn’t boot, you’re searching for the right key.
- First SSH connection — host key verification prompt looks alarming the first time ("authenticity of host can’t be established"). It’s normal. Type yes and move on.
The hardware cost $0 (it was collecting dust). The OS cost $0. The total investment was an afternoon and a USB drive I already owned. The return is a machine that runs every script, job, and service I throw at it — indefinitely, without asking.
Once it was running, the obvious next question was: how do I make it secure? Especially for SSH access from outside the home network. That’s the next post.