loc bengaluru, ist | local --:-- srijanshukla18@gmail.com →
[post]/you-a-junior-infra-techie/vps-vs-vm-vs-containers

vps vs vm vs containers

/ 3 min read· infra

VPS, VM, and containers get used interchangeably. They solve the same problem - packing more workloads onto fewer machines - at different abstraction levels. The breakdown I give juniors.

People use VPS, VM, and containers interchangeably all the time. They shouldn’t.

All three are ways to slice up a big physical server so you aren’t wasting a whole bare-metal box on one small app, just at different levels.

VPS (Virtual Private Server)

VPS is really a product/marketing term, not a separate technology. When you rent a $5 droplet on DigitalOcean or Linode, that’s a VPS. Under the hood they are just running a VM (usually KVM) for you.

Why do people call it a VPS instead of a VM? Mostly coz VPS providers pack a ton of customers onto the same physical host and oversell the CPU/bandwidth, whereas cloud VMs (like EC2 dedicated/standard instances) give you stricter guarantees and cloud networking around it.

VM (Virtual Machine)

Hardware-level virtualization. You have a physical server, a hypervisor (KVM, Xen, VMware), and each VM runs its own full guest OS and its own Linux/Windows kernel.

  • Isolation is strong: since each VM has its own kernel, a process crashing or exploiting the kernel in VM #1 doesn’t touch VM #2.
  • Heavy: every VM is booting a full OS, eating RAM and disk just to exist, and takes tens of seconds or minutes to boot.

Containers

OS-level virtualization. Instead of virtualizing the hardware and running 10 kernels, all containers on a host share the exact same Linux kernel.

A container is literally just a normal Linux process that has been put in a box using two kernel features:

  • namespaces -> controls what the process can see (its own filesystem root, its own process IDs, its own network interface)
  • cgroups -> controls how much the process can use (CPU quota, RAM limit)

Because there is no guest OS to boot, a container starts in milliseconds (as fast as starting a normal binary) and has almost zero memory overhead. The tradeoff is weaker isolation - if there is a kernel vulnerability, all containers on that node share the same kernel.

How it works in prod today

Almost nobody runs containers directly on bare metal, and almost nobody deploys one app per VM anymore.

What everyone actually does (EKS, GKE, etc.):

  • You rent VMs (EC2 nodes) for the strong hardware/kernel isolation boundary
  • And you pack containers (Kubernetes pods) inside those VMs for fast deploys and high density.

And then in between VMs and containers you have microVMs like Firecracker (what AWS Lambda and Fargate use under the hood) - which boots a stripped-down real VM kernel in ~100ms so you get VM-level security with container-like startup speed.

Quick summary:

  • VPS = the rented server product
  • VM = virtualized hardware (own kernel, heavy, strong isolation)
  • Container = isolated Linux process via namespaces + cgroups (shared kernel, super fast, lighter isolation)