Guide
How to host a website on a VPS
What a VPS actually gives you over shared hosting, what it takes to run one safely, and an honest test of whether you need one.
- A VPS gives you root access, but every security update, firewall rule, backup, and TLS renewal becomes your job.
- Most people leave shared hosting because of a traffic spike that hits the PHP process limit — caching fixes this without spending money on a VPS.
- A VPS only makes sense if you need persistent background processes, SSH access, custom software, or runtimes like Node or Python.
- The real cost of a VPS is your time spent on server maintenance. If you are not comfortable with command line tools, a managed VPS is the only sensible option.
A VPS is a virtual machine that you are now the administrator of. The selling point is root access. The reality is that root access means every security update, firewall rule, and TLS renewal is your problem.
The 508 error page is the page that usually sends people shopping for a VPS. You hit the process limit, your site goes down, and you assume you need a bigger machine. Often you do not.
What changes when you move to a VPS
On shared hosting, someone else patches the operating system, restarts the web server when it crashes, and watches for disk failures. On a VPS, that someone is you.
These are the jobs that become yours:
- Security updates. The OS vendor releases patches every few weeks. You apply them. If you do not, your machine gets compromised. This is not a one-time task. It is a recurring chore.
- Firewall. A fresh VPS has its SSH port open to the whole internet. Bots find it within minutes. You configure
iptablesorufwto block everything except the ports you actually use. - TLS certificates. Let’s Encrypt certificates expire every 90 days. You set up automatic renewal, or you manually replace them every three months. Miss the deadline and visitors see a security warning.
- Backups. Shared hosting providers typically keep snapshots. A VPS provider might offer a backup add-on, or they might not. If you do not arrange your own backups, a single accidental
rm -rfwipes your data. - Monitoring. When the web server stops serving pages, you need to know. You set up a monitoring service that checks your site every minute and sends you an alert. Otherwise your site could be down for hours before you notice.
Root access is the feature and the risk. You can install any software, change any config file, and run any command. You can also lock yourself out, delete system libraries, and open ports that get you hacked.
The honest test: do you actually need a VPS
You need a VPS if you need one of these things that shared hosting cannot provide:
- A persistent process that runs in the background, like a game server, a chat bot, or a queue worker
- SSH access to the server
- Custom software that is not available in the shared hosting control panel
- More than 25% of a CPU core or 256 MB of memory for a sustained period
- The ability to install Node, Python, Ruby, or Go runtimes
If none of those apply, a VPS is probably the wrong answer.
The hosting calculator can help you check whether your current usage actually exceeds what shared hosting offers. Most people who think they need a VPS are hitting a single limit, not all of them.
The limit that feels like a VPS problem but is not
The most common reason people leave shared hosting is the PHP process limit. When your site gets a traffic spike, the 10 concurrent PHP processes fill up, and visitors see a white screen or a 508 error. The natural reaction is to buy a VPS with more processes.
But there is a cheaper fix. Caching turns a dynamic PHP request into a static file. A cached page uses zero PHP processes. It uses zero MySQL connections. It uses almost no CPU.
The guide to hosting WordPress covers how to set up page caching. A properly cached WordPress site can serve 10 to 20 times the traffic on the same shared hosting plan because the PHP processes are only used when someone posts a comment or clears the cache.
The same logic applies to other CMS platforms. Caching moves the shared-hosting ceiling roughly tenfold and is free.
When shared hosting genuinely cannot work
Some problems are real. A long-running PHP script that takes more than 30 seconds will hit the maximum execution time exceeded error. If you are processing large files, generating PDFs, or running batch imports, shared hosting will time out. A VPS lets you raise the limit.
Outbound email is blocked on shared hosting. If your application needs to send transactional email through its own SMTP server, you need a VPS. (Using a third-party email service like SendGrid or Mailgun works fine from shared hosting, so check that first.)
Cron jobs are often limited on shared plans and blocked outright on most free tiers. If you need reliable scheduled tasks, a VPS is the clean answer.
The cost you do not see
A VPS costs more than the monthly bill. You pay in time.
Every hour spent patching the OS, debugging a misconfigured firewall, or restoring from a backup is an hour not spent on your actual work. If you run a business site, that time has a real cost.
Managed VPS plans exist from some providers. They handle the OS-level work while you keep root access. They cost more than an unmanaged VPS but less than the value of your time. If you are not comfortable with the command line, a managed VPS is the only sensible option.
Hosting a website on a VPS is not for everyone
If you have read this far and still think you need a VPS, start with the hosting calculator to confirm. Then research providers. Do not pick the cheapest one. Pick one with good documentation, a control panel that works, and support that answers within hours, not days.
If you realised that caching or a different shared hosting plan would solve your problem, implement that first. A VPS will still be there in six months if you outgrow shared hosting for real.
The VPS itself is not the hard part. The hard part is the work that comes after you rent it.