VPS vs Shared Hosting: Which to Choose for Your Site or Project

Shared hosting or VPS: access, resources, security and upkeep. How to tell when it is time to move.

· 7 min read

Cover: VPS or Hosting

Shared hosting is space on someone else's server, where the provider runs the server and you upload your site. A VPS is your own virtual server: you install everything yourself and you are responsible for all of it. The difference is who manages the server. On shared hosting that is usually the provider, on a VPS it is you.

For a single site on a ready-made CMS with no special requirements, shared hosting is usually enough. It takes less effort, and the provider typically looks after the system and the web server. You need a VPS when you want your own software, processes that run all the time (a bot, a database, a queue, a VPN), precise web server settings, or resources reserved for your machine. In return, you set up and secure the server yourself.

How the two options work

On shared hosting, one physical server usually hosts many sites from different customers. They typically run on a common operating system, and the provider sets limits on how much CPU, memory and how many processes one account can use. You get a control panel with a file manager, databases, email and domains. You usually can't see or change the system itself.

On a VPS (virtual private server), a physical server is split into isolated virtual machines. Each one has its own operating system with its own kernel, and you get all of it: administrator (root) access, any software, your own ports. The example below is real output from a working HIP VPS (it runs its own software besides the system): the system sees two processors and about 4 GB of memory (free shows 3.8 GiB), it has its own Linux kernel, and the virtualization is KVM.

$ nproc
2
$ free -h
               total        used        free      shared  buff/cache   available
Mem:           3.8Gi       1.3Gi       198Mi        20Mi       2.6Gi       2.5Gi
Swap:             0B          0B          0B
$ uname -r
6.8.0-149-generic
$ systemd-detect-virt
kvm

nproc shows how many CPU cores the system sees; free -h shows how much memory there is and how much of it is in use; uname -r shows the kernel version of the guest system, which you control; systemd-detect-virt shows how the server is virtualized. The system sees the number of cores and the amount of memory set by the plan, and on a VPS they are usually reserved for your machine. Still, you have to spend them carefully: memory is shared between all the programs on the server.

Side-by-side comparison

Below is the typical case; a specific provider may differ.

What we compareShared hostingVPS
Access to the systemOnly the panel and files; system settings are closedFull (root), SSH access, any settings
Your own softwareOnly what the provider allows (a set of PHP versions and databases)Anything: Docker, Node.js, databases, bots, VPN
ResourcesShared, with per-account limits; neighbors can affect youSet by the plan and usually reserved for your machine
SecurityThe provider usually looks after the system and its protectionUpdates, passwords and the firewall are on you
MaintenanceAlmost noneRequired: updates, backups, monitoring
Entry barrierLow: upload the site and it worksHigher: you need at least the basics of the command line
Growing loadYou run into plan limits and provider rulesYou change the server's parameters (the HIP panel has a "Scale" tab for this) or tune it for the job

One caveat: the exact terms depend on the provider. Some hosts give you SSH and let you run your own processes, others don't; some have strict limits, others soft ones. Before you choose, read the terms of the plan, not just its name.

What you get and what you give up

Shared hosting

  • There is nothing to set up: the provider usually looks after the system and the web server, and the panel is clear even to someone who has never opened a terminal.
  • But you usually can't install your own software or run a background process, there are limits on resources and processes, neighbors on the server can affect speed, and web server settings are restricted.

VPS

  • Full control and any software; resources are usually reserved for your machine; you can keep several projects on one server and tune them closely; you can reinstall the system for a given job (the data is deleted when you do).
  • But everything is on you: updates, security, backups, finding the cause of failures. Without experience it is easy to leave a server vulnerable, and a mistake in the SSH or firewall settings can lock you out. The HIP panel has the "Control" tab (soft and forced reboot) and "Console", so you can usually get in and fix things even without SSH.

Signs it is time for a VPS

You don't have to wait until the site stops opening. These are the signals that shared hosting is no longer enough:

  • you need a program that isn't available on the hosting: Docker, your own version of Node.js or Python, a queue, a database that isn't on the list;
  • the project needs a process that runs all the time: a bot, a parser, an agent, a VPN;
  • the site hits the limits on CPU, memory or number of processes, and the provider asks you to switch plans;
  • you need precise web server settings, your own firewall rules or non-standard ports;
  • you want the speed of your site not to depend on other people's projects;
  • you need a test server with the same software versions and settings as production.

If none of this is on your list, and your site is a blog or a small company site on a ready-made CMS, moving will more likely create work than solve a problem.

How much you need to know to run a VPS

Less than it seems, but not nothing. The minimum for a secure server usually looks like this:

  • connect over SSH: this is how you manage the server from a terminal;
  • add your key and only then turn off password login: a password can be guessed, a key can't; in the opposite order you risk losing access;
  • turn on the firewall and open only the ports you need, so unneeded services aren't visible from the internet;
  • install updates: they close the vulnerabilities that have been found;
  • set up backups in advance: once the server holds something you can't lose, you need backups before the first failure, not after.

Beyond that, it depends on the job: a WordPress site, a Node.js project, a database each have their own steps.

If you have no experience but you do have time, a VPS is a good way to learn: you can reinstall the server from scratch (the data is deleted when you do). If you have no time at all for administration, choose hosting where the provider runs the system. For more on the kinds of virtual servers, see VPS vs VDS and Cloud Server vs VPS.

FAQ

Which is better: shared hosting or a VPS?

It depends on the job. For a simple site on a ready-made CMS, shared hosting: less to worry about. For your own software, always-running processes and precise settings, a VPS. There is no "better" without a task.

Is a VPS faster than regular hosting?

Not necessarily. A VPS gives your machine dedicated resources and makes them predictable, but the speed of a site also depends on setup: cache, database, web server. On a badly configured VPS a site can run worse than on good shared hosting.

Can I move a site from shared hosting to a VPS?

Yes: you copy the files and the database, set up the web server and check the site before switching the domain. The main thing is to keep the page URLs.

Do I need to know Linux to use a VPS?

The basic commands, yes: connecting over SSH, working with files, installing packages. Without them you can't set up or secure the server.

What should I do if I locked myself out of my VPS?

It happens after a mistake in the SSH or firewall settings. The HIP panel has the "Control" tab (soft and forced reboot) and "Console": you can usually get in through the console and fix the settings. If that doesn't work, the remaining option is to contact support. A backup and careful config changes, one at a time, help you avoid this situation.

Takeaways

  • Shared hosting is a ready-made platform where the provider runs the system; a VPS is your own server where you configure everything.
  • For a simple site on a ready-made CMS, shared hosting is usually enough.
  • You need a VPS for your own software, always-running processes, precise settings and predictable resources.
  • In return you take on work: updates, security and backups are on you.
  • Terms differ between providers, so compare plans by what they allow, not by their names.