Archive / VPS / Maintenance
This guide explains how to keep a small VPS stable from a practical angle, focusing on the choices, tradeoffs, and next steps that actually matter once you want something that works in the real world.
A small VPS has limited resources. Stability isn't about having lots of RAM or CPU—it's about using what you have wisely and catching problems before they escalate.
This guide focuses on the minimal set of practices that keep a small VPS running reliably without adding operational complexity.
Practical note
The cheapest VPS can be stable if configured properly. The problem is rarely the hardware—it's usually missing basic maintenance.
Follow this list from day one:
Install Netdata or htop. Set email alerts for: RAM > 80%, disk < 20%, CPU > 90% for 5 minutes. If you can't receive alerts, at least check the graphs daily.
On Ubuntu: apt install unattended-upgrades. On CentOS: yum install yum-cron. Enable automatic security patches. Test non-security updates weekly.
Configure systemd services with MemoryMax= and CPUQuota= to prevent one service from taking everything. For nginx: worker_processes auto; worker_connections 1024;
Even with 1GB RAM, add 1GB swap. It won't fix performance issues but prevents crashes during memory spikes. Use a swap file, not a partition, for flexibility.
fallocate -l 1G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile
Ensure logrotate is configured and running. Check /etc/logrotate.conf and the daily cron job. Verify old logs are compressed or deleted.
Schedule a weekly reboot during low traffic. This clears memory leaks and resets any stuck processes. Use systemctl enable --now cron and add a weekly reboot cron.
No system is 100% stable. Prepare for failure:
If you can't rebuild within an hour, your recovery plan is insufficient.
Start with the checklist above. Implement monitoring first—you can't improve what you don't measure.
Then set up automated backups and test your restore process. A stable system that you can't recover from a crash is still a risk.
If you need more detailed setup guides for specific services (nginx, MySQL, Docker), those are available in the VPS section.
Common causes include resource exhaustion (RAM/CPU), unpatched security updates, misconfigured services, runaway processes, and insufficient monitoring. Most stability issues are preventable with basic maintenance.
For a basic self-hosted setup with 2-3 services (web server, database, maybe a cron job), 1-2GB RAM is usually sufficient if configured properly. Add swap space as a safety buffer, but don't rely on it for normal operation.
Yes. Automate security updates, log rotation, and regular reboots if needed. Use a tool like unattended-upgrades on Ubuntu, and set up cron jobs for database optimization and log cleanup. Automation reduces human error.
Watch for: steadily increasing RAM usage without restarts, repeated service crashes, high disk I/O wait times, and disk space < 20% free. Set up basic monitoring (Netdata, htop, or a simple script) to catch trends before they become critical.
Affiliate disclosure: If you buy through our links, we may earn a commission at no extra cost to you.
Ready to get started? Check out Hostinger's plans.