Guides · Reboot and uptime · updated 3 Dec 2026
How to make pm2 apps start automatically after a reboot (pm2 startup and pm2 save)
pm2 keeps your Node.js apps running, but it does not start itself at boot, and after a reboot it restores only the list you saved. You need both: the startup unit and a saved list.
Generate the startup unit
Run it as the user that owns the apps, not root. pm2 prints a sudo command: copy and run it.
pm2 startup systemd # run the command it prints, for example: sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u USER --hp /home/USERSave the current list
Repeat after every change: new app, renamed app, deleted app.
pm2 saveVerify the unit
Both should say enabled.
systemctl is-enabled pm2-USER systemctl status pm2-USER --no-pager | head -n 5Test without rebooting
Kill the pm2 daemon and restore from the saved list.
pm2 kill pm2 resurrect pm2 list
Common mistakes
- Running pm2 startup as root while the apps belong to another user.
- Upgrading Node.js: re-run pm2 startup so the unit uses the new node path, and pm2 update.
- Forgetting pm2 save after pm2 delete: the deleted app comes back after the reboot.
How to undo it
pm2 unstartup systemd removes the unit. A bad saved list is replaced by fixing the apps and running pm2 save again.
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.