How to update a VPS safely
VPS updates should be boring. Back up first, update packages deliberately, restart services, check the site, and keep a rollback path.
1. Back up and check free space
Run or confirm a fresh backup before patching. Check disk space so package caches, logs, or database files don't fill the server during updates.
df -h
free -m
sudo apt update
2. Apply package updates
sudo apt update
sudo apt list --upgradable
sudo apt -y upgrade
sudo reboot
For production sites, schedule updates during a quiet window and avoid stacking OS updates, PHP upgrades, database upgrades, and application releases at the same time.
3. Verify services after restart
systemctl --failed
systemctl status nginx
systemctl status php*-fpm
curl -I https://example.com
4. Watch the server after updates
Monitor CPU, memory, disk, HTTP status, logs, and backup jobs after updates. Some failures appear minutes later when cron, queue workers, or cache warmers run.
Official sources checked
Used for production update and backup context.
Used for monitoring verification context.