Guides · Reboot and uptime · updated 3 Dec 2026
Linux reboot checklist: make sure every service, app and container comes back
A reboot exposes everything that only worked because nobody had restarted the machine: a service started by hand, a pm2 app that was never saved, a container without a restart policy, firewall rules held only in memory. Take a snapshot first, fix what would not return, reboot, and compare.
Take a snapshot of what is running
Save it somewhere that survives the reboot.
mkdir -p ~/before && cd ~/before systemctl list-units --type=service --state=running --no-legend --plain | awk '{print $1}' | sort > services.txt sudo ss -ltnp > ports.txt docker ps --format '{{.Names}}' | sort > containers.txt 2>/dev/null pm2 jlist > pm2.json 2>/dev/nullFind running services that are not enabled at boot
Anything running but disabled will stay down after the reboot. Enable it, or stop it if it should not run.
systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' > ~/before/disabled.txt comm -12 <(sort ~/before/disabled.txt) <(awk '{print $1".service"}' ~/before/services.txt | sed 's/.service.service/.service/') sudo systemctl enable NAMESave pm2 apps and enable the pm2 startup unit
pm2 restores only its saved list, and only if its own systemd unit is enabled.
pm2 save systemctl is-enabled pm2-$USER # enabled; if not: see the pm2 guideGive containers a restart policy
A container with policy no is left stopped after a reboot.
docker update --restart unless-stopped $(docker ps -q) sudo systemctl enable docker containerdCheck the firewall and disks
Rules that are not persistent disappear, and a disk mounted by hand is missing after boot, so apps write to the root disk instead.
sudo ufw status | head -n 3 # Status: active, and: systemctl is-enabled ufw sudo findmnt --verifyMake sure you can get in if it does not boot
Open the provider's web console (VNC or serial) before rebooting, and confirm you can log in there.
Reboot, then compare
Wait three minutes for services to settle, then compare with the snapshot.
sudo reboot # after it is back: comm -23 ~/before/services.txt <(systemctl list-units --type=service --state=running --no-legend --plain | awk '{print $1}' | sort)
Common mistakes
- Services started on demand by systemd (static units) are not enabled and are not a problem.
- pm2 save must be repeated after every change to the app list.
- A kernel update does not protect you until the reboot has happened.
How to undo it
A reboot cannot be undone, but a service that did not return can be started with sudo systemctl enable --now NAME, a pm2 list with pm2 resurrect, and a container with docker start NAME.
Sources
Commands are for Debian and Ubuntu unless noted. Test on a copy first and keep a backup: you are responsible for changes on your own systems.