---
title: DigitalOcean MicroVMs Quickstart (public)
description: Create a MicroVM from a container image, send it a request, run a command in it, and destroy it using doctl.
product: Microvms
url: https://docs.digitalocean.com/products/microvms/getting-started/quickstart/
last_updated: "2026-10-09"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# DigitalOcean MicroVMs Quickstart (public)

DigitalOcean MicroVMs are lightweight virtual machines that run a container image in an isolated kernel, pause automatically when idle, and resume on the next request with memory, files, and processes intact.

DigitalOcean MicroVMs run a container image in its own lightweight virtual machine and serve it over an authenticated HTTPS endpoint. This quickstart uses `doctl` to create a MicroVM that runs `nginx`, send it a request, run a command in it, and destroy it.

## Prerequisites

- [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md) v1.173.0 or later, and authenticate it with a [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md). If you use a custom-scoped token, grant it the `microvm` scopes listed in [Access Tokens and Scopes](https://docs.digitalocean.com/products/microvms/concepts/networking-access/index.html.md#access).
- Create a separate personal access token with only the `microvm:access` scope, and export it as the `DIGITALOCEAN_TOKEN` environment variable so you can send requests to the MicroVM’s endpoint with `curl`. Use this token only for endpoint requests.

## Create a MicroVM

Create a MicroVM in MKC1 that runs the public `nginx` image with 1 vCPU and 2 GiB of memory. `nginx` serves HTTP on port 80, so set `--http-port` to `80`:

```shell
doctl compute microvm create example-microvm \
  --oci-ref docker.io/library/nginx:latest \
  --region mkc1 \
  --cpu 1 \
  --memory 2048 \
  --http-port 80
```

The output includes the new MicroVM’s ID. The MicroVM’s state is `creating` until provisioning finishes. Check its state, replacing `<your-microvm-id>` with the MicroVM’s ID:

```shell
doctl compute microvm get <your-microvm-id>
```

When the state is `running`, the **Endpoint** column shows the MicroVM’s hostname.

## Send a Request to the MicroVM

Every request to a MicroVM’s endpoint needs a DigitalOcean API token in the `Authorization` header. Send a request to the `nginx` default page:

```shell
curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  "https://<your-microvm-id>.mkc1.microvm.ondigitalocean.com"
```

The response is the `nginx` welcome page. After 5 minutes with no traffic, the MicroVM pauses. The next request resumes it automatically.

## Run a Command in the MicroVM

Run `nginx -v` inside the MicroVM’s container. Put `--` before the command so `doctl` does not read the command’s flags as its own:

```shell
doctl compute microvm exec <your-microvm-id> -- nginx -v
```

## Destroy the MicroVM

Destroy the MicroVM to delete it and the data on its disk:

```shell
doctl compute microvm delete <your-microvm-id>
```

The command prompts for confirmation. To skip the prompt, add `--force`.

## Next Steps

- To use the Control Panel or the API instead of `doctl`, see [How to Create a MicroVM](https://docs.digitalocean.com/products/microvms/how-to/create/index.html.md).
- To capture a warmed-up MicroVM and start new MicroVMs from that state, see [How to Checkpoint a MicroVM](https://docs.digitalocean.com/products/microvms/how-to/checkpoint/index.html.md).
- To understand when MicroVMs pause, resume, and incur charges, see [MicroVM Lifecycle](https://docs.digitalocean.com/products/microvms/concepts/lifecycle/index.html.md).