Anime-Sanctuary

Install Debian 13 on a VPS or a dedicated server

Debian is the system you install, forget about, and that keeps running for years. Here is how to get it on a VPS, using the ready-made template from your hosting provider.

Course
Tutorial 6 of 35
Time
30 min to read
Tested with
Debian 13.7 (trixie); GnuPG 2.4.7, OpenSSH 10.0p2
What you will be able to do
  • Install Debian 13 on a VPS with the hosting provider's template.
  • Log in to it after checking the machine's fingerprint.
  • Check the version, the time, the disk and the available updates.
  • Find the no-template method (ISO image) in the fold-out box at the bottom.

Before you start: What is SSH?.

Contents
  1. The problem: a rented machine with no system
  2. Why Debian 13, and which way in
  3. Before you start
  4. 1. Reinstall with the Debian 13 template
  5. 2. Note the address and the user
  6. 3. Check the fingerprint, then log in
  7. 4. Check the installed version
  8. 5. The first checks
  9. If it fails
  10. Appendix: no template at your hosting provider?
  11. Sources
A stone staircase winding up a hillside, the path to your first server

The problem: a rented machine with no system

Installing Debian 13 on a VPS takes ten minutes if you pick the right path, and a whole evening if you pick the wrong one. You rented a machine, but it has no system yet. A reminder from VPS or dedicated server: which one to pick?: a VPS is a slice of a machine that you rent, and the hosting provider is the company that rents it.

This article gets you all the way to a Debian machine that answers your commands. The next one, Your first SSH connection, covers logging in from Windows, macOS or Linux, with the first settings. But first, which system should you install?

Why Debian 13, and which way in

Linux is a family of free operating systems, and Debian is one of the oldest. Debian 13, code name "trixie", is its current "stable" release, the one Debian recommends for servers because it rarely changes.

An operating system is the program that runs all the other programs on a machine. Debian is the kind you install and forget, which is exactly what you want from a server. It is also a safe bet for a beginner, because almost every tutorial on the web applies to it.

To install it, we take the shortest path: your hosting provider's template, a ready-installed system that the provider copies onto your machine in a few minutes.

It also gives you a ready-to-use account, often root, the all-powerful user of a Linux machine, and you will log in with it. No Debian 13 template at your provider? An appendix at the bottom explains the other way, in a box you can unfold. First, let's see what you need.

Before you start

You need three things:

  • an account with a hosting provider;
  • a rented machine, even an empty one;
  • a computer with a terminal.

If the word "SSH" means nothing to you, read What is SSH? first, because you are about to use it right away.

With all of that at hand, you can start the installation.

1Reinstall with the Debian 13 template

Open the customer area of your hosting provider, the dashboard behind a login where you manage your machine. Pick the "reinstall" (or "rebuild") action for your VPS, then the "Debian 13" template. Every provider has its own page with its own labels, but the action you want always means the same thing: rebuild the machine with a system of your choice. Here are the steps, in order.

  1. Open your machine's page in the customer area.
  2. Start the "reinstall" action.
  3. Pick the "Debian 13" (or "trixie") template, in 64-bit ("amd64" or "x86_64": two names for the same format, the one common processors use).
  4. Choose password as the login method. SSH keys, which are safer, come later.
  5. Note the password the provider gives you, or choose a long one, then confirm.

Before you confirm, check the machine name on screen one more time: that's the one that will be wiped. If the menu looks nothing like this, or two buttons leave you unsure, ask your provider's support instead of guessing. If the menu offers "Debian 12" and "Debian 13", take 13. Once confirmed, the provider shows "installation in progress", then "done". The machine restarts, which takes one to three minutes. Use that time to collect what you need to log in.

2Note the address and the user

Before you log in, grab three values in the customer area. They play the same roles as in the example from What is SSH?, only with your own values.

  • The IP address, the number that identifies a machine on the network, for example 203.0.113.10, is the address of your VPS.
  • The user is often root. Some templates give you debian instead, or a name of your choice.
  • The password is the one from the previous step.

Also look for a "fingerprint" line in the customer area or in the confirmation message: you will need it in the next step. If you can't find it, step 3 explains how to read it on the machine. With these values in your pocket, you can knock on the door.

3Check the fingerprint, then log in

The first login uses ssh, the program on your computer that talks to the rented server. It then asks you to confirm the machine's fingerprint. A reminder from What is SSH?: the fingerprint is a short string of characters, unique to this machine, like a human fingerprint. Comparing it with your provider's proves you are talking to your machine and not to an intruder.

Open a terminal on your computer (The terminal for beginners shows how, on Windows, macOS or Linux), then type the next command. Replace the user and the address with the ones you noted.

On your computer
ssh root@203.0.113.10

The program answers with a sentence like "The authenticity of host ... can't be established", followed by a line ED25519 key fingerprint is SHA256:.... Compare that line with your provider's. If they are identical, type yes and press Enter, then type your password. While you type it, nothing appears, not even dots: that is on purpose, and your keyboard isn't broken. Type it in full, then press Enter.

Your provider does not show the fingerprint? Open the remote console in the customer area, the virtual screen and keyboard that your provider offers (see VPS or dedicated server: which one to pick?), and ask the machine itself. The ssh-keygen -lf command prints the fingerprint of a key file.

On the server
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
Expected output
256 SHA256:J7SVxQS7TGXBz5Vi/yr3MC9Q6kizl66qzkGBgS7Uht4 root@mon-serveur (ED25519)

The two fingerprints must be identical, character for character. If they differ, type no, don't type your password, and tell your provider. Once you are logged in, the prompt changes and shows the machine name, like root@mon-serveur:~#. The # means root. You are in. The first settings for this session are covered in Your first SSH connection. Before that, let's check that the machine is the one you ordered.

4Check the installed version

The cat /etc/os-release command prints the Debian version that is installed. It reads a small file that describes the system, found on every Debian machine.

On the server
cat /etc/os-release
Expected output
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.7
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

The first line should say "Debian GNU/Linux 13 (trixie)". The point-release number (13.7) may be newer than the one in this article if you install later.

Next, uname -r prints the version of the kernel, the core of the system, the part that talks to the hardware. On Debian 13, the number starts with 6.12.

On the server
uname -r

The uname -r command prints a single line: the version number. Step 5 now adds three health checks.

5The first checks

Three checks take a minute: the time, the disk space and the available updates. Let's start with the time. If the clock is wrong, certificates (the ID cards of websites) and logs (the history the machine writes down) cause baffling failures.

On the server
date
Expected output
Wed Nov  4 23:09:42 UTC 2026

The date should be today's. The "UTC" time zone is the world's reference time, and it is normal on a server. Next, df -h / prints the disk space (disk free), with -h for sizes a human can read.

On the server
df -h /
Expected output
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  1.9G   17G   10% /

A fresh install uses little space. If the Use% column already shows more than 50%, something is wrong.

Finally, the updates. apt-get is Debian's software manager. Other articles write apt: it is the same family of tools, easier to read on screen. Here, apt-get update downloads the list of available packages without installing anything. A package is a program ready to install. You are root: type the command as it is.

On the server
apt-get update
Expected output
Get:1 http://deb.debian.org/debian trixie InRelease [140 kB]
Get:2 http://deb.debian.org/debian trixie-updates InRelease [47.3 kB]
Get:3 http://deb.debian.org/debian-security trixie-security InRelease [43.4 kB]
Get:4 http://deb.debian.org/debian trixie/main amd64 Packages [9678 kB]
Get:5 http://deb.debian.org/debian trixie-updates/main amd64 Packages [1108 B]
Get:6 http://deb.debian.org/debian-security trixie-security/main amd64 Packages [298 kB]
Fetched 10.2 MB in 1s (8012 kB/s)
Reading package lists...

The addresses and sizes vary with the provider: some run their own copy of the Debian repository, the server that stores all the packages. What matters is that no line starts with Err (error). To see what the update would change, without changing anything, add the -s option (simulate).

On the server
apt-get -s full-upgrade
Expected output
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  apt libapt-pkg7.0 tzdata
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Here three packages would be updated; on your machine, the list depends on the day. To really apply the update, run the same command without the -s option.

On the server
apt-get full-upgrade

If it asks "Do you want to continue?", answer y. Updates get the full treatment in Updates and packages with apt. Your machine is ready. All that's left: the problems you might hit, then an appendix for readers whose provider has no template.

If it fails

Three problems come up most often right after a reinstall.

  • The connection is refused (Connection refused) or an instant timeout right after the reinstall. The machine is still starting. Wait one to three minutes, then try again. If it still happens after ten minutes, open your provider's remote console to see how far it got.
  • The fingerprint changed: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!. After a reinstall the machine has a new fingerprint, but don't type yes just because of that. First check the new fingerprint with your provider (step 3). If it matches, delete the old one: your computer keeps it in its known_hosts file. Then log in again.
  • Password refused (Permission denied). Check the user (root or the one you noted in step 2; alice if you installed from an ISO image, as in the appendix below, where that name is chosen), then retype the password without a stray space. Some templates don't let root log in with a password: your provider's customer area will tell you.
On your computer
ssh-keygen -R 203.0.113.10
Expected output
# Host 203.0.113.10 found: line 1
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old

The ssh-keygen -R command removes the entry for the given address and keeps a copy of the old file under the name known_hosts.old. On your computer, that file is .ssh/known_hosts in your home folder.

Your machine now has Debian 13 and an SSH door that opens. You went through it once, just like in What is SSH?. All that's left is to log in properly and set up the basics. That's what this article covers: Your first SSH connection, the first thing to do on a new machine.

Appendix: no template at your hosting provider?

You have finished the main course: everything below is optional. The first box is for when your provider has no template, the second for a machine at home or for checking the image.

No template at your provider? Install from an ISO image

An ISO image is a file that holds the Debian installer, a bit like an installation DVD in file form. Go for the "netinst" version (network install), a 756 MB file that downloads the rest during the installation: you need an Internet connection. You can find it on the official netinst image page.

Most providers offer a remote console, the virtual screen and keyboard your provider offers (see VPS or dedicated server: which one to pick?), which lets you plug the image in like a virtual DVD. Look for "mount an ISO" in their help, then boot the machine from the image and pick "Install" (the text mode).

Eight screens come one after another. The exact text varies with the language: recognize each screen by its question, not by its words.

  1. Language and country. Pick your language and your country. The language you choose is used by the installer, then by the installed system.
  2. Keyboard. Pick the layout that matches your keyboard, for example "American English" (French keyboards are called AZERTY, after their first six letters). You can change it later.
  3. Network. The installer sets it up by itself: accept its values, unless your provider gives you settings to enter by hand. In that case, the provider gives you an address, a gateway (the router that leads to the Internet) and a DNS (the directory that turns site names into addresses). Choose a machine name: mon-serveur.
  4. Passwords. Leave the root password empty: that account is then disabled, and the first user gets sudo, the right to run administrator commands. Create that user: alice. Users, sudo and file permissions explains why.
  5. Partitioning. A partition is a slice of the disk. Choose "Guided - use entire disk", then "All files in one partition". Reread the summary, then "Finish partitioning and write changes to disk": this is where the disk gets erased.
  6. Software selection. Untick "Debian desktop environment", which is useless on a server. Tick "SSH server" and "standard system utilities". Without the SSH server, you could no longer log in.
  7. GRUB. GRUB is the program that starts the system. Say yes to installing it on the main disk.
  8. Finish. Remove the image in the remote console, then let the machine restart.

You then log in as alice, not as root. Redo steps 2 and 3 with that user.

On your computer
ssh alice@203.0.113.10

The prompt will be alice@mon-serveur:~$, with a $ instead of the #. In step 5, put sudo in front of apt-get update and apt-get full-upgrade. It lends alice administrator rights.

Going further: USB stick and image verification

For a machine at home, nobody mounts the image for you: you write it to a USB stick (1 GB or more, wiped completely). On Windows, macOS or Linux, balenaEtcher or USBImager do it in three clicks: the image, the stick, "write". Make sure you pick the stick and not your main disk, because everything on it will be lost. Then boot the machine from the stick (often with F12 or Esc) and follow the screens above.

Before installing, you can also check that the image is genuine. With each image, Debian publishes a list of checksums (file fingerprints: they change if a single byte changes) and the signature of that list. Two commands check them, sha256sum then gpg; they answer "OK" and "Good signature" when the image is good. This check is optional, and the exact commands, step by step, are on the Debian verification page.