Renting & Setting Up a VPS
So far you have read about virtualization and the cloud as ideas. Now it is time to make it real. In this page you will rent an actual Linux server that lives in a data center somewhere on the internet, and you will connect to it from your own laptop. This is the moment DevOps stops being theory: you get a machine that is yours to break, fix, and learn on, for the price of a couple of coffees a month.
What is a VPS?
A VPS (Virtual Private Server) is a virtual machine (a software-simulated computer) that a hosting company runs on their hardware and rents to you. You get your own slice of a powerful physical server: your own CPU share, your own memory (RAM), your own disk, and your own IP address (the unique number that identifies your server on the internet). To you it feels exactly like a dedicated computer that you can log into and control completely.
It is called private because, even though the physical machine is shared with other customers, your server is isolated from theirs. They cannot see your files and you cannot see theirs.
When to use a VPS: learning Linux, hosting a website or API, running a small database, or any side project. It gives you full root access (complete administrator control) so you can install anything.
When NOT to use one: if you only need to host static files, a managed service (like a static site host) is simpler. And if you have never used Linux before, expect a learning curve — but that is exactly why you are here.
Choosing a provider
For your first server, pick a provider with a clean dashboard and predictable flat pricing. Here is a quick comparison of three popular, beginner-friendly choices.
| Provider | Cheapest plan (2026) | Strengths | Good for |
|---|---|---|---|
| DigitalOcean | ~$4/month | Simplest UI, huge tutorial library | Absolute beginners |
| Hetzner | ~€4/month | Best price-to-power, EU data centers | Value seekers |
| Linode (Akamai) | ~$5/month | Reliable, good docs | General use |
All three give you a single-CPU, ~1 GB RAM, ~25 GB disk server for a few dollars a month — more than enough to learn on. Billing is usually hourly, capped at the monthly price, so you can create a server, experiment, destroy it, and pay only cents.
Tip: A server is billed even while it is powered off, because the disk and IP are still reserved for you. To actually stop paying, you must destroy (delete) the server, not just shut it down.
Step 1 — Create an SSH key (do this first)
SSH (Secure Shell) is the encrypted protocol you use to log into a Linux server from a terminal. The most secure way to log in is with an SSH key pair: two matching files, a private key that stays secret on your laptop, and a public key that you give to the server. This is far safer than a password, which can be guessed or brute-forced.
On your own machine (Linux, macOS, or Windows with WSL or Git Bash), generate a key pair:
ssh-keygen -t ed25519 -C "[email protected]"
Press Enter to accept the default location (~/.ssh/id_ed25519) and optionally set a passphrase for extra protection. Now print your public key so you can copy it:
cat ~/.ssh/id_ed25519.pub
Output:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9kQ... [email protected]
Copy that entire line. You will paste it into the provider’s dashboard in the next step.
Security gotcha: Never share or upload the file without the
.pubextension (id_ed25519). That is your private key — anyone who has it can log into your server. Only the.pubfile is meant to be shared.
Step 2 — Create the VPS
The exact buttons differ per provider, but the flow is the same. On DigitalOcean, for example:
- Click Create → Droplet (DigitalOcean calls its VPS a “Droplet”).
- Under Choose an image, select Ubuntu 24.04 (LTS). LTS means “Long-Term Support” — it gets security updates for years, which is what you want for a server.
- Under Choose Size, pick the cheapest Basic / Regular plan.
- Under Choose a region, pick the data center closest to you (or to your users) for lower latency.
- Under Authentication, choose SSH Key, click New SSH Key, and paste the public key you copied. This is the important part — adding the key here means the server is ready for key-based login the moment it boots.
- Give it a hostname (e.g.
my-first-server) and click Create.
After about 30 seconds the server is running.
Step 3 — Get the IP address
Back on the dashboard, your new server will show a public IPv4 address — four numbers separated by dots, like 203.0.113.42. Copy it. This is the address you connect to.
Step 4 — Connect over SSH
On a brand-new Ubuntu server, the default administrator account is called root. Connect like this, replacing the IP with yours:
ssh [email protected]
The very first time, SSH asks you to confirm the server’s fingerprint — type yes:
Output:
The authenticity of host '203.0.113.42' can't be established.
ED25519 key fingerprint is SHA256:Xr3...
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '203.0.113.42' (ED25519) to the list of known hosts.
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-31-generic x86_64)
root@my-first-server:~#
That root@my-first-server:~# prompt means you are inside your own cloud server. You are now controlling a real Linux machine over the internet.
Step 5 — First commands
Confirm where you are and bring the system up to date:
hostnamectl
sudo apt update && sudo apt upgrade -y
apt is Ubuntu’s package manager (the tool that installs and updates software). apt update refreshes the list of available packages; apt upgrade -y installs all pending security and bug-fix updates, answering “yes” automatically.
Output:
Static hostname: my-first-server
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-31-generic
Architecture: x86-64
...
Reading package lists... Done
Building dependency tree... Done
... 12 upgraded, 0 newly installed, 0 to remove ...
When you are done exploring, type exit (or press Ctrl+D) to disconnect. The server keeps running until you destroy it.
Best practices
- Always add your SSH key at creation time — it avoids ever needing a root password and is the single biggest security win for a new server.
- Run
apt update && apt upgradeimmediately on every fresh server to close known vulnerabilities before they can be exploited. - Pick the nearest region to your users to reduce latency, but keep data-residency laws (like GDPR in the EU) in mind.
- Set a passphrase on your SSH private key so a stolen laptop does not equal a stolen server.
- Destroy, don’t just power off, servers you no longer need — powered-off servers still cost money.
- Note your server’s IP and credentials somewhere safe (a password manager), since you will reuse them constantly.
- Treat the cheap plan as disposable — the whole point of a few-dollar VPS is that you can break it, destroy it, and rebuild in minutes while you learn.