---
title: "Cube quickstart"
description: "Deploy an image as a Cube, change it, look at its log and roll it back, with the glac command line, the Python SDK or the console."
---

> Documentation Index
> Fetch the complete documentation index at: https://glac.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cube quickstart

You need a project's API key in `GLAC_API_KEY`, and `glac` or the Python SDK installed: [get started](/docs/quickstart/) says how. Cubes are deployed with the command line or the API; the console shows how each one stands.

The example runs the web server that Python carries, on port 8000, from a public image.

## With the command line

Deploy the image as an app called `hello`. `glac deploy` waits until the version is ready and has the traffic, then prints the app's address:

```bash
glac deploy public.ecr.aws/docker/library/python:3.12-alpine --name hello --port 8000 \
  --start-command '["python3", "-m", "http.server", "8000"]'
```

Open the address it printed in a browser, or with `curl`. The first request wakes an instance in a few milliseconds.

Look at the app and its log:

```bash
glac cube get hello                    # its address, the version that has the traffic, its scale
glac cube logs hello --since 10m       # what it printed, a line per request, what the platform did
```

Change it. A change of what a version is made of (here an environment variable) deploys a new version, and waits for it:

```bash
glac cube update hello -e GREETING=hi
glac cube versions hello               # version 2 has the traffic now
```

Send the traffic back to version 1, then delete the app:

```bash
glac cube rollback hello 1
glac cube rm hello
```

Every command takes `--json` and then prints what the API returned. `glac help cube deploy` lists every option; the [command line page](/docs/cli/) has the rest.

## With the Python SDK

```python
from glac import Glac

glac = Glac()  # GLAC_API_KEY and GLAC_API_URL
app = glac.cube.deploy(
    "public.ecr.aws/docker/library/python:3.12-alpine",
    name="hello",
    port=8000,
    start_command=["python3", "-m", "http.server", "8000"],
)
print(app.url)                        # its address

app.deploy(env={"GREETING": "hi"})    # version 2, waited for until it has the traffic
app.rollback(1)                       # the traffic goes back to version 1
for line in app.logs():               # every line of the days the plan keeps, then it stops
    print(line)
app.delete()
```

A version that does not come up raises `DeployError`, with the image's own last words, and the traffic stays where it was. See the [Python SDK page](/docs/sdks/python/).

## In the console

Open the [console](https://console.glac.ai/console/), pick the project, and choose **Cube** under Compute. Each app shows its address, the version that has the traffic, the one being deployed, its versions, and the last lines of its log. The page only shows: deploy, scale and roll back with the command line or the API.

## Next

- [Deploys and versions](/docs/cube/versions/): what makes a new version, and rollbacks.
- [Instances and scaling](/docs/cube/instances/): `--min-instances`, `--max-instances`, `--concurrency`, `--sleep-after-ms` and regions.
- [Addresses and protocols](/docs/cube/addresses/): your own domain, private apps.

Source: https://glac.ai/docs/cube/quickstart/index.mdx
