What Is VPS Hosting? Benefits, Uses & Ubuntu Setup
Learn what VPS hosting is, how it compares with shared and dedicated hosting, and whether it fits your workload. This guide also covers a secure baseline setup for an unmanaged Ubuntu 24.04 LTS VPS.

VPS hosting sits between basic shared hosting and renting an entire physical server. If you want to know what is VPS hosting, the short answer is this: a virtual server with its own operating system and a fixed share of a physical machine's resources. It gives a growing website or application more control and isolation than shared hosting, without requiring you to manage dedicated hardware.
To decide whether a VPS fits your workload, budget and skills, you need to know how it works and what it does not provide.
What is VPS hosting?
VPS stands for Virtual Private Server. A hosting provider uses virtualization software, often called a hypervisor, to split one physical server into several virtual machines. Each virtual machine acts like an independent server. It runs its own operating system and can host its own applications and services.
The physical machine is often called a host node. A VPS runs as a virtual environment on that node. In other words, a VPS is not necessarily a separate physical box. It is a server created in software and accessed remotely over the internet.
"Private" describes logical separation, not exclusive ownership of the hardware. Several VPS customers may share the same physical server, but their environments stay isolated from one another. The level of resource allocation and isolation depends on the provider's platform and your plan. Check what CPU, memory and storage the plan includes, and how the provider enforces resource limits.
Two virtualization models are common, and they behave differently:
ModelExamplesWhat it means for youFull virtualization (type 1 hypervisor)KVM, Xen, VMware ESXiEach VPS runs its own kernel. You can upgrade the kernel, load modules and use any Linux distribution the provider offers.Container-based virtualizationLXC, OpenVZAll containers share the host node's kernel. Cheaper, but the provider fixes the kernel version, and isolation is weaker than with KVM.
If a plan does not state its virtualization type, ask. The type determines whether you can run Docker, load custom kernel modules, or use a distribution the provider does not officially support.
When people ask "what is a VPS in hosting?" or "what is a virtual private server VPS?", they usually mean this setup: shared physical infrastructure with individually controlled virtual servers on top. The provider supplies the hardware and virtualization platform. You manage the server itself, unless your plan includes management.
How does a VPS work?
The provider's physical server has processors, memory, storage and network connections. Virtualization software assigns portions of those resources to each virtual machine. Every VPS has its own operating system, users, files, software and configuration.
You usually connect to a Linux VPS over SSH, or to a Windows VPS through remote desktop. From there, you can install a web server, set up a database, deploy an application or run other services. The provider maintains the physical host, but you may still be responsible for updates, access controls and application security.
A VPS is more than a folder on a shared web server. It gives you a server environment to configure. It does not, however, come with every management or security service you might need.
When you first log in, confirm that the instance has the resources you paid for:
nproc # vCPU count
free -h # RAM and swap
df -h / # disk space on the root filesystem
vmstat 1 5 # the "st" (steal) column shows time taken by other tenants
Expected output: nproc and free -h should match the vCPU and RAM in your plan's specification. A 2 GB plan shows roughly 1.9Gi total, because the kernel reserves some memory. In vmstat, the st column should stay at or near 0. If it stays above a few percent, the host node is overloaded and your instance is waiting on other tenants.
Key benefits of VPS hosting
More predictable resources than basic shared hosting
On shared hosting, many websites share one server environment, and usage can swing from one account to another. A VPS plan allocates a fixed amount of CPU, RAM and storage. That makes capacity easier to plan. Performance still depends on the provider's infrastructure, your plan's limits and how you configure your application.
Read the plan closely. Some providers sell reserved CPU cores. Others sell burstable shares that can be throttled when the host is busy. Storage may be local NVMe or network-attached, and either type can have IOPS limits. For a database, those limits often matter more than the raw gigabytes.
Greater control over software and settings
A VPS usually gives you administrative or root access. You can choose software versions, change server settings and install services that a basic shared plan does not allow. That flexibility helps with custom applications. It also means you need to know how to maintain the environment.
Isolation from other customers
Each VPS has its own operating system and environment, separate from other VPS instances on the same host. That separation can limit the effect of another customer's configuration or workload, compared with conventional shared hosting. It is not a guarantee against every infrastructure problem. A physical host failure or a provider network outage can still affect several virtual servers at once.
Room to grow
When your site or application outgrows its plan, you may be able to move to a larger VPS allocation or a different hosting setup. The process varies by provider. It may require a restart, a migration or a plan change, so check it before you count on scaling up without downtime.
A middle ground on cost and responsibility
A VPS gives you more control than many shared plans, and it costs less than renting a whole physical server. The trade-off is more operational work, unless you choose a managed service. Weighing cost, control and maintenance against each other is the core of deciding whether a VPS suits you.
VPS vs shared, dedicated and cloud hosting
Hosting typeHow it worksIsolationOften suitsShared hostingMultiple websites share a hosting environment and its resources.Process-level; same OS and often the same user pool.Small sites with modest needs and minimal server administration.VPS hostingA virtual machine runs on a physical host shared with other virtual machines.Separate OS per VM (KVM) or a separate container on a shared kernel (LXC/OpenVZ).Websites or applications that need more control and a defined resource allocation.Dedicated hostingOne customer rents or uses an entire physical server.Full physical separation.Workloads that need full control of a server or specific hardware.Cloud hostingWorkloads run on infrastructure delivered through a cloud platform. Designs and billing models vary.Varies by service (VM, container, managed platform).Applications that need cloud services, flexible infrastructure or distributed deployment.
These categories overlap. A VPS may run on a cloud provider's infrastructure, and dedicated servers may also be offered through a cloud platform. Compare the actual plan, its resource model, the management scope and the recovery options. Don't rely on the label alone.
Common VPS hosting use cases
Business websites and online stores
A business website may move to a VPS when it needs more configuration control or has outgrown its current host. A VPS can also run a content management system or an online store, as long as the server has enough resources and you maintain it properly. For WordPress, compare the requirements of your theme, plugins, traffic and backup plan before you pick a plan. Ritik Barnwal's WordPress VPS hosting is one option to evaluate against your current setup.
Applications, APIs and development environments
Developers use VPS environments to run web applications, APIs, customer portals, and test or staging systems. Administrative access helps when an application needs a specific runtime, web server or deployment configuration. A VPS can give you a consistent server for testing. It does not replace a full development pipeline or production monitoring.
Databases and background services
Some teams run databases, queues or scheduled jobs on a VPS. Whether that works depends on the workload's memory, storage, backup and availability requirements. Running a database on the same VPS as your application keeps a small deployment simple. But both services then share the instance's resources, and a single failure can take down both.
Remote tools and private services
A VPS can host internal tools, a remote development environment or other services that need to be reachable over the internet. Restrict access where you can, use strong authentication and keep exposed services patched. A VPS is public-facing infrastructure, even when the service on it is meant only for private use.
Managed vs unmanaged VPS
On an unmanaged VPS, you usually handle operating system updates, server configuration, firewall rules, application deployment, monitoring and backups. Providers draw these lines differently, so read the service scope carefully.
A managed VPS typically includes some provider help with server administration. "Managed," however, has no universal meaning. Confirm whether the plan covers updates, security configuration, monitoring, troubleshooting, backups or application support. Also check whether that support applies outside business hours.
If you want help with administration, compare the service scope of managed VPS hosting against what your team can handle in-house. A managed plan can take over routine work. You still need to understand what stays your responsibility.
How to decide whether a VPS is right for you
Work through these steps to assess your needs:
List what you plan to run. Include websites, databases, APIs, background tasks and development tools.
Estimate resource needs. Look at current CPU, memory and storage use, then add expected growth. Don't pick a plan based only on a headline specification.
Decide how much control you need. If you need a custom software stack or server-level configuration, a VPS may suit you better than basic shared hosting.
Assess your administration capacity. Decide who will handle updates, security, monitoring and recovery. If nobody on your team can do this, compare managed options.
Check the provider's terms. Review resource limits, backup arrangements, support scope, the upgrade process and server location. If your users are in India, a nearby server may reduce network latency. Actual performance still depends on routing and each user's connection.
Plan for failure and migration. Keep independent backups where they make sense, test restoring them, and know how you would move to another plan or provider.
Baseline setup for a new Linux VPS (Ubuntu 24.04 LTS)
The steps below take a freshly provisioned, unmanaged Ubuntu 24.04 LTS server from root with a password to a patched, key-only, firewalled baseline. Commands assume you are logged in as root unless noted otherwise. Run local commands on your own machine.
Prerequisites
A VPS running Ubuntu 24.04 LTS (Noble Numbat) with root access. Other releases use different package versions, so don't mix instructions.
The server's public IPv4 address, referred to here as
YOUR_SERVER_IP.An SSH key pair on your local machine. If you don't have one, create it:
ssh-keygen -t ed25519 -C "you@laptop"
Access to the provider's web console or VNC. This is your way back in if a firewall or SSH change locks you out.
A DNS
Arecord foryour_domainpointing atYOUR_SERVER_IP. You only need this for the TLS step.
1. Connect and confirm the OS
ssh root@YOUR_SERVER_IP
cat /etc/os-release
uname -r
Expected output: VERSION="24.04.x LTS (Noble Numbat)" and a 6.8.x kernel. If your release differs, stop and adjust the package names before you continue.
2. Patch the system
apt update
NEEDRESTART_MODE=a apt -y upgrade
apt -y autoremove
Ubuntu 24.04 ships needrestart, which can stop scripted upgrades with an interactive prompt. NEEDRESTART_MODE=a answers that prompt automatically.
Check that nothing is left pending:
apt list --upgradable
Expected output: Listing... Done, with no package lines after it.
3. Create a non-root sudo user
adduser deploy
usermod -aG sudo deploy
adduser asks for a password and a full name. Then verify the group membership:
id deploy
Expected output includes groups=1000(deploy),27(sudo). On Ubuntu, the administrative group is sudo, not wheel.
4. Install your SSH key and test sudo
From your local machine:
ssh-copy-id -i ~/.ssh/id_ed25519.pub deploy@YOUR_SERVER_IP
Then confirm the new account works before you change anything else:
ssh deploy@YOUR_SERVER_IP
sudo -v
Expected: you log in without a password prompt, and sudo -v asks for deploy's password once and then returns silently.
5. Harden the SSH daemon
First, inspect the existing drop-in files. Cloud images often include /etc/ssh/sshd_config.d/50-cloud-init.conf, which can turn password authentication back on:
grep -r . /etc/ssh/sshd_config.d/
OpenSSH uses the first value it finds for each keyword. Ubuntu's /etc/ssh/sshd_config includes the drop-in directory near the top, and files load in lexical order. A 00- prefix therefore overrides 50-cloud-init.conf:
tee /etc/ssh/sshd_config.d/00-hardening.conf >/dev/null <<'EOF'
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
LoginGraceTime 30
AllowUsers deploy
EOF
Validate the syntax and the effective values before you restart anything:
sshd -t && echo "config OK"
sshd -T | grep -Ei '^(permitrootlogin|passwordauthentication|kbdinteractiveauthentication|pubkeyauthentication|allowusers)'
Expected: config OK, then permitrootlogin no, passwordauthentication no, kbdinteractiveauthentication no, pubkeyauthentication yes and allowusers deploy.
Apply the change:
systemctl restart ssh
systemctl is-active ssh
Expected: active.
Warning
Keep your current session open. In a new terminal, test a second connection (ssh deploy@YOUR_SERVER_IP) before you close it. If you also change Port, allow the new port in the firewall and in the provider's security group first, or you will lose access.
6. Enable a host firewall
Warning
Enabling a firewall over SSH can lock you out if the SSH rule is missing. Allow SSH before you enable UFW, and keep the provider console open in a browser tab.
ufw default deny incoming
ufw default allow outgoing
ufw allow OpenSSH
ufw --force enable
ufw status verbose
Expected output:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp (OpenSSH) ALLOW IN Anywhere
22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6)
Open other ports only when a service needs them. Where possible, limit them to known addresses:
ufw allow from YOUR_HOME_IP to any port 22 proto tcp
7. Add fail2ban
apt -y install fail2ban
tee /etc/fail2ban/jail.local >/dev/null <<'EOF'
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
backend = systemd
[sshd]
enabled = true
EOF
systemctl enable --now fail2ban
backend = systemd reads the journal directly. That works even on minimal images where /var/log/auth.log does not exist. If you changed the SSH port, add port = 2222 under [sshd].
Verify the setup:
fail2ban-client status
fail2ban-client status sshd
Expected: the sshd jail appears, with Currently banned: 0. Once traffic arrives, Total failed should be above zero.
8. Enable unattended security updates
apt -y install unattended-upgrades
tee /etc/apt/apt.conf.d/20auto-upgrades >/dev/null <<'EOF'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";
EOF
Verify:
systemctl is-enabled unattended-upgrades
unattended-upgrade --dry-run --debug 2>&1 | tail -n 5
Expected: enabled, and a dry run that finishes without errors.
Unattended upgrades do not reboot the server. Kernel and libc updates take effect only after a restart, so check for that periodically:
test -f /var/run/reboot-required && cat /var/run/reboot-required
9. Add swap on small instances
Instances with 1–2 GB of RAM benefit from swap as a safety net for short memory spikes:
fallocate -l 2G /swapfile || dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
fallocate fails on copy-on-write filesystems such as Btrfs. The dd fallback covers that case.
Verify:
swapon --show
free -h
Expected: /swapfile file 2G 0B 2G and a matching Swap: line in free -h. Reboot once later to confirm that /etc/fstab mounts the swap file automatically.
10. Set the timezone and confirm time sync
timedatectl set-timezone Asia/Kolkata
timedatectl
Expected: System clock synchronized: yes and NTP service: active. Accurate time matters for TLS certificates, log correlation and TOTP-based logins.
11. Install and verify a web server
apt -y install nginx
systemctl enable --now nginx
systemctl is-active nginx
curl -sI http://YOUR_SERVER_IP | head -n 1
Expected: active and HTTP/1.1 200 OK.
Create a server block for your_domain:
mkdir -p /var/www/your_domain/html
chown -R deploy:deploy /var/www/your_domain/html
# /etc/nginx/sites-available/your_domain
server {
listen 80;
listen [::]:80;
server_name your_domain www.your_domain;
root /var/www/your_domain/html;
index index.html;
access_log /var/log/nginx/your_domain.access.log;
error_log /var/log/nginx/your_domain.error.log;
location / {
try_files $uri $uri/ =404;
}
}
Enable the block and test the configuration before you reload:
ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx
Expected: nginx: configuration file /etc/nginx/nginx.conf test is successful.
When DNS resolves to YOUR_SERVER_IP, open HTTP and HTTPS and issue a certificate:
ufw allow 'Nginx Full'
apt -y install certbot python3-certbot-nginx
certbot --nginx -d your_domain -d www.your_domain
certbot renew --dry-run
Expected: the dry run reports Congratulations, all simulated renewals succeeded.
12. Back up and test a restore
A provider snapshot is convenient, but it usually lives with the same provider and under the same account. Keep at least one copy you control.
install -d -m 700 /var/backups/etc
tar -czf /var/backups/etc/etc-$(date +%F).tar.gz /etc
tar -tzf /var/backups/etc/etc-$(date +%F).tar.gz | head -n 3
Expected: the archive lists paths such as etc/hostname. Then copy it off the server from your local machine:
rsync -avz -e ssh deploy@YOUR_SERVER_IP:/var/backups/etc/ ./vps-backups/
Finally, prove the archive restores. Don't just assume it does:
mkdir -p /tmp/restore-test
tar -xzf /var/backups/etc/etc-$(date +%F).tar.gz -C /tmp/restore-test
ls /tmp/restore-test/etc | head
Warning
Never run rm -rf on a path you haven't just listed with ls. When you clean up test restores, delete only the directory you created, for example rm -rf /tmp/restore-test.
Limitations to keep in mind
A VPS is not automatically fast, secure or highly available. Poor configuration, insufficient resources or an unpatched operating system can cause problems on any hosting type. Virtualization isolates server environments, but it does not remove every risk that comes with shared physical infrastructure.
You are also responsible for understanding the backup and recovery arrangements. A backup helps only if you can restore it. A provider's snapshot or backup feature may cover different things, and keep data for a different period, than an independent backup. Confirm the details rather than assuming they are included.
Troubleshooting
Permission denied (publickey).
deploy@YOUR_SERVER_IP: Permission denied (publickey).
The server is not accepting your key. Diagnose from the client with ssh -v deploy@YOUR_SERVER_IP. Then check the server side through the provider console:
ls -ld /home/deploy /home/deploy/.ssh
ls -l /home/deploy/.ssh/authorized_keys
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy /home/deploy/.ssh
sshd -T | grep -i allowusers
AllowUsers deploy must match the login name exactly. ~/.ssh must not be writable by the group or by others, or sshd will ignore the key.
Connection refused or Connection timed out
ssh: connect to host YOUR_SERVER_IP port 22: Connection refused
"Refused" means nothing is listening on that port. "Timed out" usually means a firewall or provider security group is dropping packets.
systemctl status ssh --no-pager
ss -tlnp | grep ':22'
ufw status verbose
If sshd is down, start it with systemctl start ssh. If it is listening but you still time out, check the provider's firewall or security group rules for port 22.
Job for ssh.service failed because the control process exited with error code
A configuration error stops sshd from starting. Find the error instead of guessing:
sshd -t
journalctl -u ssh -n 50 --no-pager
Common causes include a typo in a drop-in file, a duplicate Port directive, and an AllowUsers line that names a user who doesn't exist. Fix the file, run sshd -t again, then run systemctl restart ssh.
Locked out after enabling UFW
Log in through the provider's web console or VNC, then allow SSH again:
ufw allow OpenSSH
ufw reload
ufw status verbose
If you can't reach the console, ufw disable restores access. Re-enable UFW as soon as you've fixed the rule.
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This is expected after a rebuild or reinstall, because the host key has changed. Remove the old key only if you know the server was rebuilt. Otherwise, the warning may mean someone is intercepting the connection.
ssh-keygen -R YOUR_SERVER_IP
ssh -o StrictHostKeyChecking=accept-new deploy@YOUR_SERVER_IP
E: Could not get lock /var/lib/dpkg/lock-frontend
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1234 (unattended-upgr)
Another package process is running. Wait for it to finish instead of deleting the lock file:
ps aux | grep -E '[a]pt|[d]pkg'
systemctl status unattended-upgrades --no-pager
Run your command again once that process exits. Deleting /var/lib/dpkg/lock* while dpkg is active can corrupt the package database.
nginx: [emerg] on nginx -t
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
Add the directive inside the http block of /etc/nginx/nginx.conf:
http {
server_names_hash_bucket_size 128;
}
Other common errors: duplicate default server means two server blocks use default_server on the same listen address. unknown directive means a required module is not installed. Always run nginx -t before systemctl reload nginx.
502 Bad Gateway
nginx is running, but it cannot reach the upstream application:
journalctl -u nginx -n 50 --no-pager
ss -tlnp | grep -E ':(3000|8000|8080)'
curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:3000
If curl fails, the application is down, or it listens on 127.0.0.1 at a different port from the one in proxy_pass. Start the service and make the ports match.
413 Request Entity Too Large
The upload is larger than nginx's default 1 MB body limit. Raise the limit in the relevant server or location block:
client_max_body_size 25m;
nginx -t && systemctl reload nginx
No space left on device
df -h
du -xh --max-depth=1 / 2>/dev/null | sort -h | tail -n 10
journalctl --disk-usage
Free up space safely with journalctl --vacuum-time=7d and apt clean. Don't delete files under /var/log or /var/lib until you know what they are. Removing the wrong file can break running services.
fail2ban: Failed to access socket path or Have not found any log file for sshd jail
Failed to access socket path: /var/run/fail2ban/fail2ban.sock
Either the service isn't running, or the jail can't find a log source:
systemctl status fail2ban --no-pager
fail2ban-client status
Confirm that backend = systemd is set in /etc/fail2ban/jail.local, then run systemctl restart fail2ban. On minimal images without rsyslog, there is no /var/log/auth.log. This setting works around that.
certbot: Could not bind to port 80 or DNS problem: NXDOMAIN
Problem binding to port 80: Could not bind to IPv4 or IPv6.
Either another service already listens on port 80, or the DNS record doesn't point at this server yet:
ss -tlnp | grep ':80'
dig +short your_domain
Stop the conflicting service, or use the nginx plugin (certbot --nginx) so certbot doesn't have to bind the port itself. dig must return YOUR_SERVER_IP before HTTP-01 validation can succeed.
Conclusion
A VPS is a virtual server on shared physical infrastructure. It gives you more control and isolation than basic shared hosting, and it also gives you more responsibility. If you want help with server administration, Ritik Barnwal's managed VPS hosting is one option to compare with a self-managed setup.
Frequently asked questions
What does VPS stand for?
VPS stands for Virtual Private Server. A provider uses virtualization software to create a virtual server with its own operating system and an allocated share of a physical machine's resources.
Does a VPS have its own physical server?
Not necessarily. Several VPS customers may share one physical server, while their virtual environments remain logically separate.
How is VPS hosting different from shared hosting?
A VPS runs its own virtual server environment and usually gives you more control over software and settings than basic shared hosting. Shared hosting places multiple websites in one hosting environment, while VPS isolation depends on the virtualization model.
Is a VPS managed or unmanaged?
A VPS may be managed or unmanaged, depending on the plan. On an unmanaged VPS, you usually handle updates, server configuration, firewall rules, monitoring and backups; managed services vary, so check what the provider covers.
Which Ubuntu version does the article's VPS setup use?
The setup is for Ubuntu 24.04 LTS (Noble Numbat) on a freshly provisioned, unmanaged server. The article says to expect a 6.8.x kernel and advises stopping if your release differs.
What should I check after first logging in to a VPS?
Check the vCPU count, memory, root filesystem disk space and CPU steal time with nproc, free -h, df -h / and vmstat 1 5. The article says the st column in vmstat should stay at or near 0; if it stays above a few percent, the host node may be overloaded.
Comments
Loading comments…


