# On a VPS (DigitalOcean, Hetzner, Linode)

At the end, you have a VPS, a rented computer from a smaller cloud company, with Docker on it and a Terminal on it from your laptop. It is the cheapest path and has the fewest screens.

## At a glance

**Time:** 10 minutes, then [Any Linux computer with Docker](any-box.md).

**What you need:**

- An account with DigitalOcean, Hetzner or Linode
- About 5 to 25 dollars a month, depending on the company

**Steps:**

1. Make a key on your laptop
2. Rent the box
3. Connect and install Docker

## Steps

1. **On your laptop, in Terminal, make a key pair.** Press Enter at every question to accept the defaults.

   ```sh
   ssh-keygen -t ed25519
   ```

   You should see: `Your public key has been saved in …/.ssh/id_ed25519.pub`.

2. **Show the public half and copy the whole line it prints.**

   ```sh
   cat ~/.ssh/id_ed25519.pub
   ```

   You should see: one line starting `ssh-ed25519`.

   > The public half is the part you give the company. The file without `.pub` is the private half; it never leaves your laptop.

3. **In your company's control panel, create a new server** (DigitalOcean calls it a **Droplet**, Hetzner a **Server**, Linode a **Linode**) and fill it in:
   - **Location:** the one nearest your team.
   - **Image:** **Ubuntu 24.04**.
   - **Type or size:** a shared processor plan with **4 GB** of memory and at least **2** processors, on **x86** (Intel or AMD), not Arm.
   - **SSH key:** press **Add SSH key** and paste the line from step 2. Choose a key over a password.
   - **Firewall:** add one that allows **SSH (port 22)** in and nothing else (a **Cloud Firewall** on DigitalOcean and Linode, a **Firewall** on Hetzner). If your company lets you, set the SSH source to your own address.
4. **Create the server.**

   You should see: the server running after a minute, with its **IPv4 address**, four numbers with dots.

5. **Connect as the `root` user**, with the server's address in place of `<address>`.

   ```sh
   ssh root@<address>
   ```

   You should see: a question about the box's fingerprint. Type `yes` and press Enter. Then a prompt that starts `root@`.

6. **Install Docker with Docker's own script.**

   ```sh
   curl -fsSL https://get.docker.com | sh
   ```

   You should see: a few minutes of output.

## Check

Docker answers with `Docker Compose version v2.` followed by more numbers:

```sh
docker compose version
```

## Next

Your box is ready. Paste the command from the portal: [Any Linux computer with Docker](any-box.md).

## If something is off

- **SSH asks for a password.** The server was made without your key. Add the line from step 2 as its SSH key and connect again.
- **SSH stops connecting.** If you set the SSH source to your own address, your address changed; set it again.

## Doing it by hand

Once Docker answers, [By hand](by-hand.md) sets the runner up from files instead of the portal's line.
