Yes, a VPS can host a website, and the setup is about forty minutes: a non-root user, a firewall, nginx, a DNS record and a certificate. What the tutorials skip is the second half of the deal. A VPS is unmanaged. The operating system updates, the certificate renewals, the backups, the log rotation and the security of the box are yours from the moment it boots, and they stay yours for as long as the site is up. This post covers both halves, so you can decide with the full price in view.
The forum answer to this question is a single word, yes, followed by twenty replies about which control panel to install. The tutorial answer is an nginx config with no mention of what happens the week after. Both are right and both are incomplete. Here is the setup, done properly, and then the maintenance list, written down so that nobody discovers it at 2am.
Table of contents
- What a VPS gives you that shared hosting does not
- The setup, start to finish
- The maintenance you signed up for
- When a VPS is the right call
- When it is not
- How this fits the rest of the stack
- FAQ
What a VPS gives you that shared hosting does not
A VPS is a slice of a physical server with its own operating system, its own IP address and root access. Compared with shared hosting, where you get a folder and a control panel on a machine you share with hundreds of other sites, the differences are real.
- You choose the software. Any web server, any language runtime, any database. Shared hosting gives you PHP and whatever the panel supports.
- Your resources are yours. The CPU and RAM on the plan are allocated to you. A noisy neighbour on shared hosting can slow your site; on a VPS they cannot.
- You can run more than a website. A background worker, a cron job, a small API, a private tool. Shared hosting cannot run a process that stays up.
- You can host many sites. One nginx serving ten domains, each with its own certificate, is a normal VPS configuration.
The price of all that is the word unmanaged. Nobody is watching the box but you.
The setup, start to finish
This assumes a fresh Ubuntu VPS and a static site or a PHP site. The sequence matters: the firewall goes up before the web server, and the certificate comes last because it needs DNS to resolve first.
1. Stop using root. Create a user, give it sudo, copy your SSH key to it, and disable password login.
adduser deploy
usermod -aG sudo deploy
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy
# then in /etc/ssh/sshd_config: PasswordAuthentication no
systemctl restart ssh
2. Firewall. Allow SSH, HTTP and HTTPS. Nothing else, until something needs it.
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
3. Install nginx and point it at your site. One server block per domain, files under /var/www.
server {
listen 80;
server_name example.com www.example.com;
root /var/www/example.com;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Save it as /etc/nginx/sites-available/example.com, symlink it into sites-enabled, run nginx -t, and reload.
4. DNS. At your registrar, create an A record for example.com and for www pointing at the VPS IP. Wait for it to resolve; the certificate step will fail if you do not.
5. Certificate. Certbot with the nginx plugin issues the certificate and rewrites the server block to redirect HTTP to HTTPS.
apt install certbot python3-certbot-nginx
certbot --nginx -d example.com -d www.example.com
Certbot installs a renewal timer. Check it exists with systemctl list-timers, because a certificate that silently expires in ninety days is the most common VPS outage there is.
6. Deploy. For a static site, rsync the build output into /var/www. For a PHP site, install php-fpm and add a location block that passes .php requests to the socket. For a Node or Python app, run it under systemd on a local port and have nginx proxy_pass to it.
The maintenance you signed up for
Here is the list that the setup tutorials leave out. Every item is small. Together they are the actual cost of a VPS.
- Operating system updates. Weekly at least. Enable unattended-upgrades for security patches, and plan a reboot for kernel updates. A box that has not been updated in six months is a box someone else will eventually administer.
- Certificate renewal. Automated by the timer, until the day the timer is broken by a config change. Check it monthly, or set up monitoring that alerts you thirty days before expiry.
- Backups. The VPS provider’s snapshot is a start. It is not a backup until you have restored from it once. Copy the site and any database dump off the box on a schedule.
- Log rotation. nginx logs grow without limit. logrotate is installed by default on Ubuntu; make sure it covers your custom log paths.
- Disk space. The one that takes sites down quietly. A full disk stops nginx writing logs, stops the database writing anything, and produces errors that look like everything except a full disk.
- Security. fail2ban for SSH, no unused services listening, no database on a public port. Check what is listening with ss -tlnp once in a while and make sure you recognise everything.
- The reboot you did not schedule. Providers migrate hosts. Your services need to come back on their own, which means every process runs under systemd with Restart=always, not from a terminal you closed.
None of this is hard. All of it has to happen, and it happens whether or not you have time that week.
When a VPS is the right call
A VPS earns its keep in a few specific situations.
- You are running several sites and small services and want them on one box under one bill.
- You need software the managed hosts do not run: an unusual runtime, a specific database, a self-hosted tool with odd requirements.
- You want to learn how servers work, and the site is a low-stakes place to learn.
- You need full control of the network layer: custom ports, a VPN endpoint, a mail server.
In those cases the maintenance list is the job, not an overhead, and a VPS is the honest tool for it.
When it is not
For a single website, a portfolio, a business site, or a blog, the VPS is doing the job of a static host or a managed WordPress plan with a maintenance burden added. The site does not benefit from root access. It benefits from someone else handling the updates, certificates and backups.
The managed version of the same site on RunxBuild is a static site built from the repository with 120GB of bandwidth included, or managed WordPress from $3 a month with a file manager and a database browser in the dashboard. Custom domains and certificates are handled; there is no timer to check. For the app case, a web service on a $6 Basic plan runs the process with logs and rollback, and a managed Postgres sits beside it on a private network.
The price is close to a small VPS. The difference is that the Saturday stays yours.
How this fits the rest of the stack
If you are weighing the two, price the managed version honestly first: the site, the service if there is one, the database and the bandwidth, together in the RunxBuild hosting calculator. Then compare that number to the VPS plan plus the hours from the maintenance list. Either answer is fine; the point is to choose with both columns filled in. For the managed path, static sites on RunxBuild shows the build-from-repository flow, and the dashboard is where the domain gets pointed.
Useful related references:
- VPS Compare: How to Read the Specs Before the Price, and When the Comparison Is the Wrong One
- VPS Price: What Drives It, and the Line Items That Are Not On It
- Deploy Next.js to a VPS: The Full Path, and What It Costs You Afterwards
- Static sites on RunxBuild
FAQ
Can I host a website on a VPS?
Yes. A VPS runs any web server you install. The setup is a user, a firewall, nginx, a DNS record and a certificate, and takes under an hour. The ongoing part is updates, renewals, backups and monitoring, which are yours to run.
Is a VPS better than shared hosting for a website?
It is more capable: your own resources, any software, many sites on one box. It is not better for a single simple site, because the extra capability comes with the maintenance of an unmanaged server. For one business site, managed hosting is usually the better trade.
How many websites can a VPS host?
As many as the CPU and RAM allow. nginx with one server block per domain handles dozens of low-traffic static sites on a small plan. Sites with PHP or a database each need their own share of memory, so the count drops quickly for dynamic sites.
Do I need a control panel on a VPS?
No. A panel adds a web interface and its own attack surface, and it hides what the server is doing. For one or two sites, editing nginx config directly is simpler and easier to debug. Panels earn their place when non-technical people need to manage sites on the box.
What is the difference between a VPS and managed hosting?
Both run your site. On a VPS you install and maintain the operating system, web server, certificates and backups. On managed hosting the provider does that and you deploy the site from a repository or a dashboard. The VPS costs less in money and more in hours.