A VPS, a bare metal server and a public cloud instance can all run the same Linux application, but they differ in who shares the hardware, how predictable performance is, how fast you can scale and how the bill is calculated. This guide explains how each model works, compares them side by side, shows how to measure the differences yourself with a few commands on Ubuntu 24.04, and ends with a practical framework for choosing.
The three models in short
VPS (virtual private server): a virtual machine on a physical host shared with other customers. A hypervisor, usually KVM, gives each VPS its own kernel, vCPUs, RAM, disk and IP addresses. You get root access and a fixed monthly price for a fixed size, and you can resize without reinstalling.
Bare metal (dedicated server): an entire physical server for one customer, with no hypervisor between your operating system and the hardware. You get every CPU core, all the RAM, direct access to NVMe drives and network cards, and no other tenant competing for them.
Public cloud: virtual machines (and managed services such as databases, object storage and load balancers) from a large provider, billed by the second or hour and driven through an API. Technically a cloud instance is also a VM; the difference is the operating model: elastic capacity, many regions, managed building blocks and usage-based pricing that includes data transfer.
Side-by-side comparison
| VPS | Bare metal | Public cloud | |
|---|---|---|---|
| Hardware | Shared host, isolated VM | Dedicated physical server | Shared host, isolated VM |
| Performance consistency | Good; can vary with neighbors (CPU steal) | Highest and fully predictable | Good; depends on instance family |
| Provisioning time | Seconds to minutes | Minutes to hours | Seconds |
| Scaling | Resize vertically, add more VPS | Order more servers | Horizontal autoscaling via API |
| Pricing | Flat monthly or hourly, bandwidth usually included | Flat monthly, lowest cost per core at high utilization | Per second or hour, egress and extras billed separately |
| Cost predictability | High | High | Lower; depends on usage |
| Control | Root in the VM | Full, including BIOS/IPMI, RAID and kernel modules | Root in the VM, limited by provider services |
| Hardware access (GPU, SR-IOV, nested KVM) | Limited | Full | Available on specific instance types |
| Operations burden | OS and application | OS, application and hardware monitoring | OS, application and cloud architecture |
| Best for | Websites, APIs, small databases, dev/test | Databases, virtualization hosts, high-traffic and latency-sensitive services | Spiky or unpredictable load, heavy use of managed services |
How to tell what you are running on
On any Linux server you can check whether the OS runs inside a virtual machine. On Ubuntu 24.04, systemd-detect-virt is installed by default:
systemd-detect-virt
On a KVM-based VPS or cloud instance:
kvm
On bare metal:
none
lscpu gives the same information along with the CPU model:
lscpu | grep -E 'Model name|Hypervisor vendor|^CPU\(s\)'
CPU(s): 4
Model name: AMD EPYC 9454 48-Core Processor
Hypervisor vendor: KVM
A bare metal server has no Hypervisor vendor line.
Measuring the differences
Specifications on a pricing page do not tell you how a server behaves under load. These three checks take a few minutes and let you compare a VPS, a bare metal server and a cloud instance with real numbers. Install the tools first:
sudo apt update
sudo apt install sysstat sysbench fio
CPU steal time
On a virtual machine, steal time is the percentage of time a vCPU was ready to run but the hypervisor gave the physical CPU to another VM. It is the clearest sign of a noisy neighbor or an overcommitted host. Sample it for 10 seconds:
vmstat 1 10
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 3012456 61224 512300 0 0 2 8 120 210 3 1 96 0 0
...
The st column is steal time. Values that stay at 0 or 1 are normal. Sustained values above roughly 5 while your server is busy mean you are not getting the CPU you pay for. On bare metal it is always 0. mpstat -P ALL 1 5 (from sysstat) shows the same metric per core as %steal.
CPU throughput
sysbench runs a repeatable CPU benchmark across all cores:
sysbench cpu --threads="$(nproc)" --time=30 run
CPU speed:
events per second: 18450.32
...
Compare events per second between servers with the same number of threads, and run it several times at different hours: large swings on a VM point to contention.
Disk I/O
Random 4 KiB reads are what databases do most, and where local NVMe on bare metal is far ahead of network-attached cloud volumes. Run a 30-second test against a 1 GiB file with fio, bypassing the page cache:
fio --name=randread --filename=/var/tmp/fio.test --size=1G --rw=randread --bs=4k \
--ioengine=libaio --iodepth=32 --direct=1 --runtime=30 --time_based --group_reporting
read: IOPS=182k, BW=711MiB/s (746MB/s)(20.8GiB/30001msec)
...
lat (usec): min=41, max=2210, avg=174.60, stdev=31.22
Look at IOPS and the average and maximum latency. Remove the test file afterwards:
rm /var/tmp/fio.test
For network throughput, run iperf3 -s on one server and iperf3 -c your_server_ip on another in the same region (install with sudo apt install iperf3).
Cost: what actually drives the bill
- VPS: you pay for a size, whether you use it or not. Bandwidth is usually bundled, so the monthly cost is easy to forecast. It is the cheapest option for small and medium workloads that run all the time.
- Bare metal: the monthly price is higher, but you get every core and all the RAM with no virtualization overhead. For workloads that keep a server busy around the clock, the cost per usable core and per GB of RAM is typically the lowest of the three.
- Public cloud: on-demand prices are the highest per unit of compute, and data transfer out of the provider (egress), storage IOPS, load balancers and managed services are billed separately. It becomes cost-effective when load is highly variable, because you can scale down to almost nothing, or when managed services save more engineering time than they cost. Reserved or committed-use discounts lower the price but also lower the flexibility.
A useful rule: if a machine will run at high utilization 24/7 for a year or more, fixed-price VPS or bare metal is almost always cheaper. If it runs a few hours a day or its load changes by an order of magnitude, elastic cloud pricing can win.
Which one should you choose?
Choose a VPS when:
- You run websites, APIs, small to medium databases, CI runners, VPNs or staging environments.
- You want root access and predictable monthly costs without managing hardware.
- You need to start small and resize as you grow.
Choose bare metal when:
- Performance must be consistent: busy databases, game servers, real-time or latency-sensitive services.
- You need all the resources of a large machine, or hardware features such as NVMe in RAID, GPUs or running your own hypervisor (KVM, Proxmox) with nested workloads.
- Utilization is high and steady, so the lower cost per core pays off.
- Compliance requires single-tenant hardware.
Choose public cloud when:
- Traffic is unpredictable or seasonal and you need to autoscale in minutes.
- You rely heavily on managed services (serverless functions, managed queues, global object storage) that would be expensive to operate yourself.
- You need a presence in many regions at once.
Many teams combine them: bare metal for databases and steady compute, VPS for web front ends and supporting services, and cloud only for burst capacity or specific managed services. Providers such as CubePath offer both VPS and bare metal in the same locations, which keeps latency between the two tiers low and makes moving a workload from one to the other straightforward.
Migrating between models
Moving between a VPS, bare metal and the cloud is mostly the same process regardless of direction:
- Automate the server build (Ansible, cloud-init, Docker images) so the target is reproducible instead of copied by hand.
- Benchmark the target with the commands above before moving anything.
- Replicate data (database replication,
rsyncfor files) while the old server is still in production. - Lower the DNS TTL a day in advance, switch over, and keep the old server running until you have verified traffic and backups on the new one.
Conclusion
A VPS gives you isolated, affordable servers with predictable pricing; bare metal gives you the full, consistent performance of dedicated hardware; public cloud gives you elasticity and managed services at a higher and less predictable cost. Measure steal time, CPU and disk performance on real candidates instead of relying on specifications, and let utilization patterns decide. As next steps, benchmark your current server with sysbench and fio, review a month of CPU and bandwidth usage, and estimate the cost of the same workload on each model.
