Chapter 1 · Lesson 1 of 19
Server basics

What is a VPS (virtual private server)?

A VPS (virtual private server) is a rented virtual machine with its own operating system, address and root access, running on a provider's hardware.

By the end you will

Explain what a VPS is, what you get and what you are responsible for.

Time
8 min
Level
Beginner
Check
4 questions

What a VPS gives you

A VPS is a slice of the provider machine that you control like your own computer: you connect over the network, you install your apps, and the updates and security are your job.
  1. The provider carves a slice of CPU, memory and disk out of one real machine.
  2. You log in to the slice like it is your own computer, with its own address.
  3. Updates, firewall and security of everything above the hardware are your job.
  4. You choose what to install and run on it.
  5. Your apps answer requests at the address of the VPS.
Static diagram
  1. Provider hardwarea sliceYour VPS
  2. Youlog in as rootYour VPS
  3. Youupdate and secureYour VPS
  4. Your VPSinstallYour apps
  5. Your appsserveYou

A VPS, or virtual private server, is a virtual machine you rent from a provider and control like your own computer, with its own operating system, IP address and root access. Say you built a small app on your laptop and want it online all day, even when the laptop is closed. You could host it on a platform that runs it for you, or you could rent a computer in a datacenter and run it yourself. That rented computer is a VPS. Knowing what you actually get, and what becomes your job, saves you from surprises at 2 a.m.

A short history#

Providers began selling virtual machines on shared hardware in the 2000s, as a cheaper step between shared hosting and a whole physical server. Cloud platforms later made them quick to create and delete, so renting one by the month is now routine.

How it works#

A provider owns large physical machines in a datacenter. Software called a hypervisor splits one physical machine into several virtual machines. Each virtual machine gets a fixed share of CPU, memory and disk, its own operating system and its own network address. That virtual machine is your VPS. From the inside it looks like a normal computer: you log in, install packages and run programs.

Because the machines share hardware, the provider isolates them from each other. Your processes cannot see another customer’s processes, and you cannot see theirs. What you do not control is the physical host: you cannot choose its neighbours, and a host problem can affect you even when your own server is healthy.

You reach your VPS over the network, almost always with SSH. The provider gives you a public IP address (IPv4, and often IPv6 too) and either a root password or a place to upload your SSH public key. Everything else is up to you.

LayerWho looks after it
Physical hardware, power, networkThe provider
Hypervisor and host machineThe provider
Operating system, updates, firewallYou
Your apps, data and backupsYou

A worked example: you create a server in the provider dashboard and pick Ubuntu and a small plan. Within a minute the dashboard shows an IP address such as 203.0.113.10. You run ssh root@203.0.113.10, and the provider’s machine answers as if it were a physical computer. You run apt update, install a web server and open the IP in a browser. Nothing in that chain involved you touching hardware, but every step after the first login was yours to secure.

VPS compared with the alternatives#

OptionYou controlEffortTypical use
Shared hostingA folder and some settingsLowA simple website
VPSThe whole operating systemMediumYour own apps and databases
Dedicated serverThe whole physical machineMedium to highHeavy, steady workloads
Managed platformYour code onlyLowApps where you want no server work

What you get#

  • An operating system you choose, usually a Linux such as Ubuntu or Debian.
  • Root access, so you can install any software.
  • A public IPv4 address, so other computers can reach it. IPv6 may be offered as well.
  • A fixed amount of CPU, memory and disk.
  • Usually a web console and a way to reboot or rebuild the machine from the provider’s dashboard.

What you are responsible for#

You keep it updated, secure and backed up. A provider runs the hardware, and everything above the operating system is yours. A new VPS is on the public internet within minutes, and automated scanners try common passwords against SSH almost immediately. The first things to do are covered in the next lessons: key based login, a non-root user and a firewall.

Backups deserve a special mention. A provider snapshot feature, where offered, is often an optional paid extra and lives with the same provider. Do not assume your data is safe just because the server is rented.

When a VPS is a good fit#

  • You want to run your own apps, databases or a self-hosted platform.
  • You want predictable cost instead of per-request pricing.
  • You want to learn how servers work.

When not to use it#

A VPS is a poor fit when you do not want to handle updates and security at all. A managed platform trades some control for less work. It is also a poor fit for a single static page, where simple static hosting costs less effort, and for workloads that must survive the loss of a whole machine without any setup from you.

Common misconceptions#

  • A VPS is not automatically backed up. Backups are a separate feature, if offered, and you should test them.
  • A VPS is not secure by default. It is reachable from the internet as soon as it boots.
  • A VPS is not a dedicated server. The physical host is shared with other customers.
  • More RAM does not fix a slow disk or a bad query. Measure before you upgrade.

Check it worked#

After you log in to a VPS, ask the machine what it is:

bash
hostnamectl

What you should see: a block of lines including the operating system name, the kernel version and a Virtualization: line that names the hypervisor technology, for example kvm. Some container based VPS offerings show a different value, which is fine. Next, check your resources:

bash
nproc
free -h

What you should see: the number of CPU cores, and a memory table whose total matches the plan you rented, give or take a little the system reserves.

Edge cases and gotchas#

  • A VPS is not the same as a container. Some cheap plans are container based and share the host kernel, so you cannot load your own kernel modules or change some kernel settings. Check with hostnamectl, and read the plan details if you need Docker features or custom kernels.
  • CPU architecture can differ. Most plans are x86_64 (amd64), but some providers sell ARM servers. A Docker image built only for amd64 will not run on ARM. Check with uname -m.
  • Your IP address may be shared or reused. A fresh address can have a history, for example a past tenant who sent spam. If mail or an API refuses you, ask whether the address is on a blocklist.
  • IPv6 may be on while your firewall only covers IPv4. A service you thought was hidden can be reachable over IPv6. Check rules for both families.
  • Low memory plans run out quickly. When the kernel runs out of memory it kills a process, often your database. Watch free -h and consider swap on small servers.
  • Deleting the server deletes the disk. Destroying a VPS in the dashboard normally removes its storage and, on many providers, its IP address. Back up before you rebuild or delete.

Troubleshooting#

SymptomLikely causeFix
Connection timed out when you SSHWrong IP, server off, or a firewall dropping port 22Check the IP and power state in the dashboard, then check firewall rules
Connection refusedThe server is up but nothing listens on port 22Use the web console and check that the SSH service is running
Permission denied (publickey)Your key is not installed on the serverAdd your public key via the console or log in with the password once and copy the key
The server is slow and apps are killedOut of memoryCheck free -h, stop heavy programs, add swap or upgrade the plan
Disk full and nothing can writeLogs, images or backups filled the diskFind large folders with du, clean what you recognize
Provider says the host is under maintenancePhysical host workWait, or ask the provider about moving the VPS to another host
Ping works but the website does not loadNothing listens on port 80 or 443, or a firewall blocks itCheck ss -ltnp for a listener and the firewall rules
Host key verification failed.The server was rebuilt and its host key changedRemove the old entry with ssh-keygen -R 203.0.113.10 after confirming the rebuild was yours

Real-world scenario#

You rent a small VPS to host a side project. The first login as root works, and you immediately notice in sudo journalctl -u ssh -n 20 a row of failed logins from addresses you do not know. Nothing is wrong: these are automated scans that every public server gets.

You add an SSH key, create a normal user with sudo rights, turn on the firewall and enable automatic security updates. That takes about half an hour. A week later the provider announces maintenance on the physical host and your server reboots. Because your app is a service that starts at boot, it comes back by itself, and the only trace is a gap in your uptime graph.

The lesson from the story: the server is yours to harden and keep alive, and the setup you do on day one decides how boring the next year is.

Quick reference#

TaskCommand
Show OS and virtualizationhostnamectl
Show CPU coresnproc
Show memoryfree -h
Show CPU architectureuname -m
Show public listening portsss -ltn

Security and safety notes#

  • Never leave the root password as the only protection on a public server. Move to SSH keys.
  • Keep a copy of important data off the server. A VPS can be lost to a mistake, a failed disk or an account problem.

Next#

Once you have one, learn how to log in with SSH keys.

Check what you learned4 questions
1What do you get with a VPS that shared hosting does not give?
2Who is responsible for updates and security on a VPS?
3Which is a good reason to use a VPS?
4Your VPS stops answering SSH after a firewall change. What is the usual way back in?

Frequently asked questions

What is the difference between a VPS and shared hosting?

Shared hosting gives you a folder on a machine many sites share, with no control over the operating system. A VPS gives you a whole virtual machine where you install what you want.

How much RAM does a small VPS need?

A single small site or a few containers run on 1 to 2 GB of RAM. Databases, builds and many apps need more, so size it to what you run.

Can I get locked out of my own VPS?

Yes. A bad firewall rule or SSH setting can cut you off. Most providers offer a web console that works without the network, so you can log in and fix it.

Is a VPS the same as a dedicated server?

No. A dedicated server is a whole physical machine for you. A VPS is a virtual machine that shares a physical host with other customers.

View MD Edit
Share
Helpful?
Progress is saved in this browser only.

Keep going: guides and tutorials

View MD Edit
Share
Helpful?
Run this on your own server

Levelrail deploys apps from git with health-checked releases and one-click rollback.

docker pull ghcr.io/glincker/levelrail:latest Install Levelrail From GLINR Studios