---
title: Virtual servers
description: Create a Linux server with root access over SSH, start, stop, resize, rebuild and delete it, and see how it's billed and how many you can have.
section: Servers
order: 1
---

A virtual server is a Linux machine of your own with root access over SSH, for software that doesn't fit a service, a database or a bucket. Each server belongs to a project and an environment and appears on the project's canvas, and **Virtual servers** in the sidebar lists every server in your organisation.

> [!NOTE]
> The host that will run servers in Ghana is still being verified, so a server's region reads **Ghana, provider pending verification**. While the dashboard shows a **Mock engine** label, servers are simulated and nothing runs on a real machine.

## Create a server

1. Open **Virtual servers** and choose **Create server**.
2. Give it a **Name** and choose its **Project**.
3. Choose an **Image**, which is Ubuntu 24.04 LTS, Ubuntu 22.04 LTS, Debian 13 or Debian 12.
4. Choose a **Size**. The dialog shows each size's monthly price.
5. Under **SSH keys**, keep ticked the keys that may sign in as root. Every saved key starts ticked, a server needs at least one, and **Add a key** saves a new one. See [SSH keys](/docs/ssh-keys).
6. To run a script on first boot, choose **Add cloud-init user data** and paste it, up to 32 KiB.
7. Choose **Create server**.

The server usually takes about a minute to boot. Dekka stores the user data encrypted and never shows it again, and rebuilding the server uses it again.

| Size | vCPU | Memory | Disk |
| --- | --- | --- | --- |
| `s-1vcpu-1gb` | 1 | 1 GiB | 25 GB |
| `s-1vcpu-2gb` | 1 | 2 GiB | 50 GB |
| `s-2vcpu-4gb` | 2 | 4 GiB | 80 GB |
| `s-4vcpu-8gb` | 4 | 8 GiB | 160 GB |

The catalogue also lists `s-8vcpu-16gb`, which can't be chosen until the host has the capacity. `GET /v1/catalog/servers` returns every size and image with its price.

To create a server with the API, send the size, the image and between one and ten SSH key IDs from `GET /v1/orgs/{org_id}/ssh-keys` to `POST /v1/projects/{project_id}/servers`. `hostname` is optional and defaults to the name.

```bash
curl https://api.dekka.cloud/v1/projects/$PROJECT_ID/servers \
  -H "Authorization: Bearer $DEKKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "web-1",
    "size_id": "s-1vcpu-1gb",
    "image_id": "ubuntu-24.04",
    "ssh_key_ids": ["<ssh-key-id>"],
    "user_data": "#cloud-config\npackages:\n  - nginx\n"
  }'
```

## Connect with SSH

Once the server is running, its page shows the command under **Connect**, along with its IPv4 and IPv6 addresses. Sign in as root with one of the keys you chose when you created it.

```bash
ssh root@<ipv4>
```

## What do the states mean?

| In the dashboard | `state` | Meaning |
| --- | --- | --- |
| Creating | `provisioning` | The server is booting for the first time, or again after a rebuild |
| Running | `running` | The server is up |
| Stopping | `stopping` | The server is shutting down |
| Stopped | `stopped` | The server is off and keeps its disk, and it's still billed |
| Rebooting | `rebooting` | The server is restarting |
| Failed | `failed` | An operation failed, and **Details** shows why |
| Deleting | `deleting` | The server and its disk are being deleted |

A server shut down from inside, with `poweroff` for example, moves to **Stopped** by itself. A server runs one operation at a time, and asking for another while one is in progress answers 409 `operation_in_progress`.

## Start, stop or reboot a server

Use **Start**, **Stop** and **Reboot** at the top of the server's page, or `POST /v1/servers/{id}/actions/{action}` with `start`, `stop` or `reboot`. Stop and reboot need a running server, and start needs a stopped one, which the API also allows for a failed server. Anything else answers 409 `invalid_state`.

## Resize a server

Stop the server, then choose a size under **Resize** and choose **Resize**. A server that isn't stopped answers 409 `server_not_stopped`. The disk can grow with a larger size but never shrinks, so only sizes with at least as much disk are offered, and the API answers 422 `disk_shrink_not_supported` for a smaller one.

The server stays stopped afterwards, so start it when you're ready. Moving to a size that costs more checks your organisation's [spend limit](/docs/billing#what-happens-at-the-spend-limit), and hours after the resize finishes are billed at the new size's price. The API resizes with `POST /v1/servers/{id}/resize` and a `size_id`.

## Rebuild a server

Rebuilding wipes the disk and installs a fresh image, keeping the server's addresses, size, SSH keys and user data. Under **Danger zone**, choose **Rebuild**, pick the image, type the server's name and choose **Wipe and rebuild**. A server can be rebuilt while it's running, stopped or failed.

The API rebuilds with `POST /v1/servers/{id}/rebuild`, an `image_id` and the server's name as `confirm`, and answers 422 `confirmation_required` without it. User data can't be changed after creation, so to use different user data, create a new server.

## Delete a server

Under **Danger zone**, choose **Delete server**, type its name and choose **Delete server**. Dekka deletes the server and everything on its disk, and billing stops after the hour the delete finishes in. The API deletes with `DELETE /v1/servers/{id}?confirm=<name>`.

> [!WARNING]
> Dekka doesn't back up a server's disk yet, and rebuilding or deleting a server erases it for good. Keep anything you can't lose somewhere else, such as [object storage](/docs/object-storage) or a [PostgreSQL](/docs/postgresql) database.

## How is a server billed?

A server is billed for every started hour from the hour it first boots until the hour it's deleted, including while it's stopped, because a stopped server still holds its disk and reserved capacity. The hourly price is the size's monthly price divided by 730, so a server created and deleted within the same hour costs one hour, and a 31-day month bills 744 hours. A server whose first boot fails isn't billed.

Server hours aren't part of any plan's allowance, and they appear on the invoice as lines such as "Server web-1 (s-1vcpu-1gb)". The prices are pilot prices and may change before launch.

## How many servers can I have?

| Plan | Servers |
| --- | --- |
| Free | None |
| Starter | 1 |
| Growth | 3 |

Every server that isn't deleted counts, including stopped ones, and creating one past the limit answers 403 `entitlement_exceeded`. Creating a server also checks your organisation's hard spend limit. Forked environments, such as pull request previews, leave servers out, so a preview never starts a machine that's billed by the hour.
