> ## Documentation Index
> Fetch the complete documentation index at: https://datum-4926dda5-docs-compute-and-vpc-guides.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Compute quickstart

> Deploy a public container image to Dallas and reach it through Datum's ALB, then clean up.

In this quickstart, you deploy a small web server from a public container image to the Dallas location, reach it through Datum's Application Load Balancer (ALB), and then delete it.

The quickstart uses the `general-purpose` runtime class, which runs standard container images without changes, and the public `docker.io/traefik/whoami` image, which replies to each request with details about the request.

<Note>
  Compute is in preview, and the `v1alpha` API can change. Your project needs approved access to Compute before you can deploy, and Datum reviews access requests manually.
</Note>

## Before you begin

* Create a Datum Cloud account, an organization, and a project. For more information, see [Account setup](/platform/setup).
* Install `datumctl` and run `datumctl login`. For more information, see the [datumctl quickstart](/datumctl/quickstart).
* Make sure that you have permission to create compute and networking resources in the project, for example, through the **Compute Admin** and **Network Admin** roles.
* Install `curl` to test the URL.

## Set up your project

Complete these steps once for each project that runs Compute workloads. Other Compute guides assume that you've completed them.

<Steps>
  <Step title="Select your project">
    Compute commands run against a project. To make your project the active context, run the following command:

    ```bash theme={null}
    datumctl ctx use ORG_ID/PROJECT_ID
    ```

    Replace the following:

    * `ORG_ID`: the ID of your organization.
    * `PROJECT_ID`: the ID of your project.

    To pick a project from a list instead, run `datumctl ctx use` with no arguments.
  </Step>

  <Step title="Install the compute plugin">
    The `compute` commands come from a plugin in the official Datum catalog. To install the plugin, run the following command:

    ```bash theme={null}
    datumctl plugin install compute
    ```

    For more information about plugins, see [Using plugins](/datumctl/plugins/using-plugins).
  </Step>

  <Step title="Request access to Compute">
    To request access for your project and wait for a decision, run the following command:

    ```bash theme={null}
    datumctl compute access request --wait
    ```

    Datum approves requests manually, so the wait can outlast the command's default 30-minute timeout. If the command times out, run `datumctl compute access` to check the state of your request. Continue when the status is `Active`.
  </Step>
</Steps>

## Deploy and publish a workload

<Steps>
  <Step title="Deploy the workload">
    To deploy the image to Dallas (`us-central-1`) and publish it on a public URL, run the following command:

    ```bash theme={null}
    datumctl compute deploy hello \
      --image=docker.io/traefik/whoami:v1.11 \
      --runtime-class=general-purpose \
      --location=us-central-1 \
      --http-port=80
    ```

    The flags do the following:

    * `--image`: the container image to run. Compute requires the registry host in the image reference, such as `docker.io`.
    * `--runtime-class=general-purpose`: runs the image as a standard container in a lightweight virtual machine. Without this flag, Datum uses the `unikernel` class, which needs a specially packaged image.
    * `--location=us-central-1`: runs one Instance in Dallas.
    * `--http-port=80`: attaches Datum's [ALB](/alb/overview) to the workload and publishes port `80` of the container on it.

    The command asks you two questions:

    1. The first time you deploy in a project, the command asks whether to create a network named `default`. Enter `y`.
    2. The command prints a plan and asks `Apply? (Y/n)`. Enter `y`.

    The command then creates the workload, waits for the Instance to start, and publishes the URL. The first deploy can take a few minutes. The output is similar to the following:

    ```text theme={null}
    Resolving workload "hello" in project PROJECT_ID...
      Network "default" does not exist in project PROJECT_ID.
      Create it now? (Y/n): y
      network/default created
      Placement "default": locations=[us-central-1], min=1
      Runtime class:       general-purpose
      Network:             default
      HTTP service:        port 80 → Datum-managed URL
                           Datum terminates TLS; serve plain HTTP on this port.
    Apply? (Y/n): y
      workload/hello created
    Saved workload.yaml
    Waiting for rollout. Ctrl-C to detach (rollout continues in background).

      PLACEMENT  LOCATION      UPDATED  READY  OLD  PHASE
      default    us-central-1  0        0      0    Pending
      default    us-central-1  1        0      0    Updating
      default    us-central-1  1        1      0    Done
    Rollout complete in DURATION.

    Publishing...
      Backends     1 healthy across us-central-1
      Edge         programmed
      Certificate  issued

      https://stark-raven-b7k2m.datumproxy.net
    ```

    The rollout table adds a row each time the location's progress changes, so your rows can differ. `DURATION` is how long the rollout took.

    The last line is the hostname of the ALB that `--http-port` attached to the workload. Your hostname is different. The command also saves the workload definition to `workload.yaml` in the current directory.
  </Step>

  <Step title="Send a request">
    To call your workload, run the following command:

    ```bash theme={null}
    curl WORKLOAD_URL
    ```

    Replace `WORKLOAD_URL` with the URL from the last line of the deploy output, such as `https://stark-raven-b7k2m.datumproxy.net`.

    The response lists the Instance's hostname and IP addresses, followed by the request that the Instance received. The request section is similar to the following:

    ```text theme={null}
    GET / HTTP/1.1
    Host: stark-raven-b7k2m.datumproxy.net
    User-Agent: curl/8.7.1
    Accept: */*
    ```

    If `curl` reports that it can't resolve the host, wait a minute and try again. A new hostname can take a few minutes to resolve.
  </Step>

  <Step title="See your workload and Instances">
    To list the workloads in your project, run the following command:

    ```bash theme={null}
    datumctl compute workloads
    ```

    The output is similar to the following:

    ```text theme={null}
    NAME    LOCATIONS      HEALTH      READY   UP-TO-DATE   PLACEMENTS   IMAGE                  AGE   URL
    hello   us-central-1   Available   1/1     1/1          default      traefik/whoami:v1.11   3m    https://stark-raven-b7k2m.datumproxy.net

    1 workloads — 1 Available, 0 Degraded, 0 Unavailable, 0 Unknown
    ```

    To list the workload's Instances, run the following command:

    ```bash theme={null}
    datumctl compute instances --workload=hello
    ```

    The output is similar to the following:

    ```text theme={null}
    NAME                           WORKLOAD   LOCATION       INTERNAL IP               TYPE      AGE   STATUS
    hello-default-us-central-1-0   hello      us-central-1   fd20:4a3b:91c2:1::1:0:2   sandbox   3m    Available

    1 instances — 1 Available, 0 Pending, 0 Failed
    ```

    The `INTERNAL IP` column shows the Instance's private IPv6 address on the `default` network.
  </Step>
</Steps>

## Clean up

To avoid using your project's compute quota, delete the resources that you created by following these steps:

1. To delete the workload, its Instance, and its ALB, run the following command:

   ```bash theme={null}
   datumctl compute destroy hello
   ```

2. Review the summary that the command prints.

3. Enter `y` to confirm. The command prints `workload/hello deleted.`

4. Optional: If you don't plan to deploy more workloads, delete the `default` network:

   ```bash theme={null}
   datumctl delete network default
   ```

## What's next

* To learn what else you can set on a container workload, see [Run a container image](/compute/containers).
* To package your own app as a fast-starting unikernel, see [Build and deploy a unikernel](/compute/unikernels).
* To run in more locations or with more Instances, see [Placement and scaling](/compute/placement-and-scaling).
* To serve the workload on your own domain, see [Publish a workload](/compute/publish-workloads).
