# Create a VM

> Launch a Firecracker microVM from the New VM form: pick a region, a size, an image and an SSH key, then connect over SSH once it is running.

- URL: https://flockvm.com/docs/vms/create
- Section: Virtual machines
- Last updated: 2026-11-10

A VM is one Firecracker microVM with its own kernel, disk and network address. You create it from the **New VM** page of the dashboard, and connect over SSH as soon as it is `running`.

## Before you start

You need three things:

- An organization with its [free trial](https://flockvm.com/docs/billing/trial) started, or its plan in good standing. There is no approval to wait for: an owner or admin starts the trial in **Settings → Billing**.
- An SSH key pair on your machine. See [SSH keys](https://flockvm.com/docs/vms/ssh-keys) if you don't have one.
- A role in the organization. **Owner**, **Admin** and **Member** can all create and run VMs. See [Members and roles](https://flockvm.com/docs/team/members).

> **Note: During the free trial.** The trial gives 25 hours of VM time, 2 VMs at once, small and default sizes, and at most 5 starts a minute, 25 an hour and 75 a day. Beyond a limit, **Launch VM** answers with the reason, such as `trial_vm_limit`. See [Free trial](https://flockvm.com/docs/billing/trial#when-a-limit-is-reached).
>
> Before the trial or the plan has started, the **New VM** form asks to start the free trial. A suspended organization sees "This organization is suspended. Contact the flockvm team." and cannot see or run any VM.

## Launch a VM

1. **Open New VM**

   Go to [flockvm.com/dashboard](https://flockvm.com/dashboard) and click **New VM** in the top right of the **Fleet** page, or in the sidebar.

2. **Pick a region and a size**

   **France** is selected. Pick a size card: `default` is selected when it fits. The **Estimated** panel on the right shows the hourly price.

3. **Keep or change the image**

   **Agent** is selected: it has the coding agent CLIs, the usual toolchains and Playwright. Pick **Minimal** for a small Ubuntu where you log in as `root`.

4. **Name it and choose a key**

   Keep the name `agent` or type your own. Pick one of your saved SSH keys, or paste a public key.

5. **Check the environment**

   The organization's default environment is selected. Pick another one, or **No environment**. See [Environments](https://flockvm.com/docs/vms/environments).

6. **Click Launch VM**

   The dashboard opens the VM's page. The status goes from `starting` to `running` once SSH answers.

![The New VM form: region, size, image, name and SSH key, with the estimated price on the right](https://flockvm.com/docs/screenshots/new-vm.webp "Pick a size, an image and an SSH key, then Launch VM.")

## The form, field by field

The form has four numbered sections and a summary panel.

### 01 Region

Where the VM runs: **France** (`gra`), the one region today. The other cards are marked **soon** and cannot be picked yet. See [Regions](https://flockvm.com/docs/vms/regions).

### 02 Size

Each card shows the size name, its vCPU, memory and disk, and its price per hour. During the [free trial](https://flockvm.com/docs/billing/trial), only `small` and `default` can be picked.

![The size picker of the New VM form](https://flockvm.com/docs/screenshots/new-vm-sizes.webp "A greyed-out card says why it does not fit right now.")

| Size      | vCPU | Memory | Disk   | Price per hour |
| --------- | ---- | ------ | ------ | -------------- |
| `small`   | 2    | 4 GB   | 50 GB  | $0.016         |
| `default` | 4    | 8 GB   | 50 GB  | $0.032         |
| `large`   | 8    | 16 GB  | 110 GB | $0.064         |
| `xlarge`  | 16   | 32 GB  | 250 GB | $0.18          |

The form selects `default`, or the first of `small`, `large` and `xlarge` that fits. A size that does not fit the host right now is greyed out with its reason, for example "Needs 16 GB RAM, 6 GB free right now. Pause or stop a VM to make room." A size whose disk is too small for the chosen image is greyed out too; every size above has room for both images. See [Sizes](https://flockvm.com/docs/vms/sizes) for how to choose.

### 03 Image

Two cards, one per image. Each shows the image's name, its id, who SSH logs in as, and what it contains.

| Card                                  | Image id             | SSH user | What it has                                                                                                                                                              |
| ------------------------------------- | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Agent** (`default` badge, selected) | `ubuntu-26.04-agent` | `user`   | Claude Code, Codex, opencode, Gemini CLI, Cursor Agent; Node.js 26 (24 and 22 through nvm), Python, Go, Rust, Java; Docker; Playwright with Chromium, Firefox and WebKit |
| **Minimal**                           | `ubuntu-26.04`       | `root`   | Ubuntu 26.04 with OpenSSH, Git, Node.js 22, Python 3, Docker and a few command-line tools                                                                                |

The image is fixed for the VM's life. If the host does not have an image yet, its card is marked **soon** and cannot be picked. Custom images (your own snapshots) are not available yet. See [Images](https://flockvm.com/docs/vms/images) for what each one contains.

### 04 Name and SSH key

`Name` (string, required, default `agent`): 1 to 40 characters among lowercase letters, digits and dashes (`a-z`, `0-9`, `-`). The form lowercases what you type and drops other characters. The name becomes the VM's hostname, without leading or trailing dashes. Two VMs may share a name: each one has its own id, such as `vm_7kq2m4`.

`SSH key` (saved key or public key, required): One public key, written on the VM's first boot to `/home/user/.ssh/authorized_keys` on the Agent image (and to root's too), or to `/root/.ssh/authorized_keys` on Minimal. The hint under the field names the file for the image you picked. If your account has saved keys, the form lists them and preselects the one you used last (or the newest). Pick **Paste another key** to paste a new one.

`Save this key to my account, for the next VMs` (checkbox, default `checked`): Shown when you paste a key. Once the VM exists, the key is added to your account settings, so the next VM offers it. A key that is already saved is not added twice.

The pasted key is checked as you type. It must be one line from a `.pub` file: `ssh-ed25519`, `ssh-rsa` or `ecdsa-sha2-nistp256/384/521`. Pasting a private key is refused with "That is a private key. Paste the .pub file instead, and keep this one secret."

```bash
# Print your public key, then paste the whole line
cat ~/.ssh/id_ed25519.pub
```

### Environment

`Environment` (select, default `the default environment`): The environment whose latest version the VM starts with: its variables, secret files and agent credentials, installed on first boot. The list shows your organization's environments, the default one first and selected. **No environment** puts nothing of your organization in the VM. See [Environments](https://flockvm.com/docs/vms/environments).

The VM keeps that version for its whole life: a later change to the environment only reaches new VMs.

### With the API

The [VMs API](https://flockvm.com/docs/api/vms#create-a-vm) creates the same VM with the same rules, and so do the [`flockvm` command-line tool](https://flockvm.com/docs/cli/commands#vm-create) and the [MCP server](https://flockvm.com/docs/mcp/tools#create_vm). Two fields of the request carry the environment:

`environment` (string, default `the organization's default environment`): The environment's id (`env_…`) or name, such as `staging`, or `"none"` for **No environment**. An unknown environment is refused with a `404` and no VM is created.

`env` (object of strings): Per-VM variables, such as `{"FEATURE_FLAG": "on"}`. They are merged over the environment's variables (the VM's value wins on the same key), and they are kept with `"none"` and with **Safe for third parties**. Same rules as the environment's variables: keys `[A-Za-z_][A-Za-z0-9_]*` without the `FLOCK_` prefix, values up to 32 KiB, 100 variables and 64 KiB in total. A key or value that breaks a rule is refused with a `400`, and the message never quotes the value.

```bash
curl https://flockvm.com/api/v1/vms \
  -H "Authorization: Bearer $FLOCKVM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "agent", "size": "default", "image": "ubuntu-26.04-agent", "ssh_key_id": "key_ada_laptop", "environment": "staging", "env": {"FEATURE_FLAG": "on"}}'
```

The VM then shows `"environment": {"id": "env_…", "name": "staging", "version": 3}`. A VM created before environments existed, or with **No environment**, shows `"environment": null`.

### Estimated

The panel on the right sums up the region, size, image (for example "Agent · ubuntu-26.04-agent") and key, and shows the price: "Billed per second while it runs. Paused and stopped VMs cost nothing." The **Launch VM ›** button is enabled once the name, the size, the image and the key are valid.

## What happens after Launch VM

1. flockvm checks that the size fits the host and that its disk is big enough for the image, then takes a copy of the image's disk and grows it to the size's disk.
2. The VM boots with status `starting`. Billing starts here.
3. On first boot, the guest generates its own SSH host keys, installs your public key (for `user` and `root` on the Agent image, for `root` on Minimal), and installs the environment's variables and secret files.
4. As soon as `sshd` answers, the status turns `running`, and flockvm removes the environment's values from the VM's metadata service. This takes about a second on the host in France (0.43 to 1.34 s, median about 1.1 s, over 12 VMs on the Agent image, measured on 2026-11-09 and 2026-11-10).

The VM page shows the SSH command in its **Connect** block, with the image's user:

**Agent image:**

```bash title="Agent image"
ssh -p 22001 user@HOST
```

**Minimal image:**

```bash title="Minimal image"
ssh -p 22001 root@HOST
```

Copy it from the page: the port and host are your VM's. Continue with [Connect over SSH](https://flockvm.com/docs/vms/ssh).

If the VM does not answer SSH within 120 seconds, it becomes `failed`, and the error shows at the top of the VM page. The **Console** shows how far the boot got. Click **Start** to boot it again, or **Delete** it. See [Lifecycle](https://flockvm.com/docs/vms/lifecycle#failed).

Your new VM also appears in the **Fleet** list, with its status, size, SSH command and cost so far.

![The Fleet page with several VMs in different states](https://flockvm.com/docs/screenshots/fleet.webp "Every VM of your organization, live.")

## When the host is full

The region is one host, shared by all its VMs. A size fits when that host has enough free memory and vCPU for it, a free network slot and enough disk. When it does not:

- Its card is greyed out with the reason, and the form says "`large` does not fit right now." under the price.
- If the host filled up between page load and your click, **Launch VM** returns the host's answer (for example "not enough memory on this host: 16384 MiB needed, 6144 MiB free for VMs") and the size cards refresh.

> **Tip: Make room.** Paused and stopped VMs free their memory and vCPU. Pause or stop a VM you are not using, or pick a smaller size. See [Limits](https://flockvm.com/docs/vms/limits#host-capacity).

If the dashboard could not read the host's capacity, it says so, shows every size, and the host refuses a size that does not fit when you click **Launch VM**.

## Every VM is logged

Creating a VM records a `vm.created` event in your organization's audit log, with the size, image, region and the fingerprint of the SSH key. See [Audit log](https://flockvm.com/docs/team/audit-log).

## Next steps

- [Connect over SSH](https://flockvm.com/docs/vms/ssh): The command, `~/.ssh/config`, file copies and port forwarding.
- [Lifecycle](https://flockvm.com/docs/vms/lifecycle): Pause, resume, stop, start and delete, and what each one bills.
- [Sizes](https://flockvm.com/docs/vms/sizes): vCPU, memory, disk and price per second of each size.
- [Environments](https://flockvm.com/docs/vms/environments): Variables, secret files and agent credentials in every new VM.
- [Run Claude Code](https://flockvm.com/docs/agents/claude-code): Put a coding agent in your new VM.
