How to Set Up a Spare Laptop as a Debian Home Server

by · Sunday. Mar 8, 2026

How to Set Up a Spare Laptop as a Debian Home Server

Old laptop → home server (base setup)

I’m repurposing an old laptop as a local-only server. The goal is simple: a stable box on my LAN that can run Jellyfin, audiobookshelf, Immich, and a yt-dlp workflow later.

This is the boring foundation post. No dashboards yet, no shiny app screenshots, just the parts that make every later service easier to run: a clean Debian install, SSH access, a predictable folder layout, shared permissions, and laptop power settings that do not fight the idea of a server.

I’m keeping this server LAN-only for now. That means no public domain, no exposed ports, and no reverse proxy yet. The first milestone is much smaller: if I can close the laptop lid, SSH into it, and reliably read/write files under /srv/media/, the base layer is good enough to build on.

What this solves

  • Turns an unused laptop into a stable LAN server.
  • Sets up SSH access without keeping password login around.
  • Creates predictable storage and permissions for later apps.
  • Keeps the laptop awake when the lid is closed.

1. Install Debian

  1. Install Debian with a minimal profile.
  2. Set the hostname.
  3. Create a normal (non-root) user for administration.
  4. Reboot and log in.

I chose Debian because it is predictable and boring in the best way. Most self-hosted services document Debian or Ubuntu first, and the defaults are conservative enough that I do not feel like I am chasing distribution-specific quirks before I have even installed an app. Debian’s own installation guide is the reference I’d use if I had to repeat this from scratch.

After the first boot, I check the machine name and IP address from the laptop itself:

hostnamectl
ip addr

The IP address is what I use for the next few posts: http://<server-ip>:8096 for Jellyfin, :2283 for Immich, and so on. Later I might add local DNS, but early on I prefer fewer moving parts.


2. Update the system

sudo apt update
sudo apt upgrade
sudo apt autoremove
sudo apt install powertop vim

This gets the base system current before I start adding services. I also install vim because I’m comfortable with it and powertop because laptops are usually tuned for interactive use, not sitting quietly on a shelf all day.

If you are copying this setup, check that upgrades finished cleanly before going further:

sudo apt update
sudo apt list --upgradable

An empty or short list here is a good sign. If a kernel update came in, I reboot before continuing so I am not debugging services on a half-updated machine.

3. Set up SSH

I start with password authentication to get my SSH key onto the server. From my main computer, I connect once using a password and use scp to copy my public key over. Then I verify that key login works from my main computer. Once the key works, I disable password authentication.

The flow looks like this from my main computer:

ssh-copy-id <user>@<server-ip>
ssh <user>@<server-ip>

Once key-based login works, I edit the SSH daemon config:

sudo vim /etc/ssh/sshd_config

The exact file can vary depending on distro defaults, but the settings I care about are:

PasswordAuthentication no
PermitRootLogin no

Then I validate and reload SSH:

sudo sshd -t
sudo systemctl reload ssh

I keep my existing SSH session open while testing a second login in another terminal. That way, if I typo the config, I still have a way back in. The OpenSSH project documents these options in sshd_config, which is worth checking before blindly pasting hardening snippets from random blog posts.

4. Make lid close not suspend

I want to close the lid and have the screen turn off without putting the server to sleep.

I edit:

sudo vim /etc/systemd/logind.conf

and add the following lines:

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

Then I restart systemd-logind:

sudo systemctl restart systemd-logind

This can terminate local desktop sessions, so I only do it after I’m sure SSH works. After restarting, I close the lid for a minute, reopen it, and confirm the machine is still reachable:

ssh <user>@<server-ip> uptime

The relevant systemd settings are documented in logind.conf. For a laptop server, this is one of the most important little changes: without it, a perfectly good server becomes unavailable the moment the lid closes.

5. Folder organization

All media on this server goes under one root folder: /srv/media/.

sudo mkdir -p /srv/media

I use a shared group called media so permissions stay simple and consistent.

sudo groupadd -f media
sudo usermod -aG media "$USER"
sudo chgrp -R media /srv/media

I also set the setgid bit on the media directory so new files inherit the media group:

sudo chmod 2775 /srv/media

Then I log out and back in so the new group membership applies. To verify it, I run:

id
touch /srv/media/test-file
ls -lah /srv/media/test-file
rm /srv/media/test-file

This matters later. Jellyfin, Audiobookshelf, Immich import paths, and yt-dlp downloads all become simpler when the directory structure and permissions are boring. I do not want every new service to become a permissions archaeology project.

6. Powertop autotune on boot

I run powertop --auto-tune to apply a bunch of power-saving toggles (until reboot). Since this laptop is going to sit idle a lot, I make it automatic by running it at startup.

sudo powertop --auto-tune

Then I create a systemd service at /etc/systemd/system/powertop.service:

[Unit]
Description=Powertop auto-tune
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/powertop --auto-tune
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

and enable it:

sudo systemctl enable --now powertop.service

I check the service once after enabling it:

systemctl status powertop.service

Powertop tuning is not magic, and some devices behave differently after aggressive power saving. If Wi-Fi, USB storage, or another peripheral starts acting flaky, I would disable this service first and test again. The ArchWiki’s Power management notes are useful background even on Debian because they explain the trade-offs behind many of these toggles.

7. A quick base-server checklist

Before installing Jellyfin in the next post, I want the laptop to pass a short checklist:

  • I can SSH in using a key, not a password.
  • The laptop stays awake with the lid closed.
  • /srv/media/ exists and my user can create files there.
  • The media group appears when I run id.
  • powertop.service is enabled or intentionally disabled.
  • I know the server’s local IP address.

That checklist is intentionally plain. When a later service fails, I want to know the base system is not the reason.

Next Steps

  1. Install Jellyfin
  2. Install audiobookshelf
  3. Install Immich
  4. Set up yt-dlp downloads