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

# Quickstart

> Install k7, prepare your node, start the API, and run your first sandbox

Katakate (k7) lets you run secure, lightweight VM sandboxes backed by Kata Containers and Firecracker, orchestrated with Kubernetes. This Quickstart gets you from zero to a working sandbox via CLI and Python SDK.

<Note>
  If you already installed k7 previously, consider running `make uninstall` before reinstalling to avoid stale cached files in a previous `.deb`.
</Note>

## Requirements

* Linux (amd64) host with hardware virtualization (KVM)
  * Check: `ls /dev/kvm` should exist
  * Cloud guidance: AWS `.metal`, GCP (enable nested virtualization), Azure D/Ev series; typical VPS often lack KVM
* One raw, unformatted disk for thin‑pool provisioning (recommended for many sandboxes)
* Docker with Compose plugin (for the API)
  * Install Docker: `curl -fsSL https://get.docker.com | sh`
* Ansible for the installer (Ubuntu):

```bash theme={null}
sudo add-apt-repository universe -y
sudo apt update
sudo apt install -y ansible
```

* Python 3.10+ on the client for the SDK

<Info>
  Tested setup example: Hetzner Robot instance, Ubuntu 24.04 (x86\_64), with an extra empty NVMe disk (for the thin‑pool). See the detailed setup guide (PDF): <a href="/tutorials/k7_hetzner_node_setup.pdf" target="_blank" rel="noopener noreferrer">k7\_hetzner\_node\_setup.pdf</a>.
</Info>

## Install the CLI (APT)

Install the `k7` CLI on the node(s) that will host the VM sandboxes:

```bash theme={null}
sudo add-apt-repository ppa:katakate.org/k7
sudo apt update
sudo apt install k7
```

## Install K7 on your node(s)

This installs and wires up Kubernetes (K3s), Kata, Firecracker, Jailer, and the devmapper snapshotter with thin‑pool provisioning:

```bash theme={null}
k7 install
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-install.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=4a8f770e3ce0238b6a4b4da54a44c144" alt="Example output: k7 install" width="2160" height="154" data-path="images/ex-install.png" />

<Check>
  You should see "Installation completed successfully!" when done. Add `-v` for verbose output.
</Check>

## Start the API and manage keys

### Start the API

```bash theme={null}
k7 start-api
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-start-api.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=25a6b1019e298f0d15d32f2d67e11223" alt="Example: k7 start-api" width="2026" height="554" data-path="images/ex-start-api.png" />

### Check API status

```bash theme={null}
k7 api-status
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-api-status.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=e118176dd55a39352e285141173ff0b5" alt="Example: k7 api-status" width="2026" height="702" data-path="images/ex-api-status.png" />

### Get the public endpoint

```bash theme={null}
k7 get-api-endpoint
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-get-api-endpoint.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=d21f4d560a93146a6a46ad5b20775408" alt="Example: k7 get-api-endpoint" width="2160" height="56" data-path="images/ex-get-api-endpoint.png" />

### Generate an API key

```bash theme={null}
k7 generate-api-key mykey
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-generate-api-key.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=29b6e8e2493aa466eb2e7da79c6dd458" alt="Example: k7 generate-api-key" width="2026" height="198" data-path="images/ex-generate-api-key.png" />

### Stop the API

```bash theme={null}
k7 stop-api
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-stop-api.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=510872ecd20147703b6dbb517d202a0d" alt="Example: k7 stop-api" width="2026" height="250" data-path="images/ex-stop-api.png" />

<Info>
  * Ensure your user is in the `docker` group to manage the API containers.
  * API keys are stored at `/etc/k7/api_keys.json` by default. Authentication accepts `X-API-Key` header or `Authorization: Bearer <token>`.
</Info>

## Create your first sandbox via CLI

Example `k7.yaml`:

```yaml theme={null}
name: demo
image: alpine:3.20
namespace: default
env_file: /root/secrets.env
limits:
  cpu: "100m"
  memory: "128Mi"
before_script: |
  # Installing curl. Egress open during before_script, then restricted (empty whitelist) afterwards
  apk add curl
  echo $ENV_VAR_1
egress_whitelist: []
```

### Create a sandbox

```bash theme={null}
# Uses k7.yaml in the current directory by default
k7 create
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-create.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=10afbf1e16f8a107caabd773fa5916fe" alt="Example: k7 create" width="2026" height="838" data-path="images/ex-create.png" />

### Shell into your sandbox

```bash theme={null}
k7 shell demo
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-shell.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=37bc055b03a36266ba7fd6b8a48e9d6e" alt="Example: k7 shell" width="2026" height="60" data-path="images/ex-shell.png" />

### List sandboxes

```bash theme={null}
k7 list
```

<img src="https://mintcdn.com/katakate/bjbza9A0c_9YJjue/images/ex-list.png?fit=max&auto=format&n=bjbza9A0c_9YJjue&q=85&s=bc4eb80d3f836c271b293b1ac08bd3ca" alt="Example: k7 list" width="2026" height="1190" data-path="images/ex-list.png" />

### Delete a sandbox

```bash theme={null}
k7 delete my-sandbox-123
```

### Delete all sandboxes

```bash theme={null}
k7 delete-all
```

### Prerequisites for the SDK

```bash theme={null}
# Ensure the API is running and you have an endpoint and API key
k7 start-api
k7 get-api-endpoint
k7 generate-api-key my-key
```

## Create your first sandbox via Python SDK

Install the SDK on your client machine:

```bash theme={null}
pip install katakate
```

Use the synchronous client:

```python theme={null}
from katakate import Client

k7 = Client(endpoint="https://<your-endpoint>", api_key="<your-key>")

# Create sandbox
sb = k7.create({
    "name": "my-sandbox",
    "image": "alpine:latest"
})

# Execute code
result = sb.exec('echo "Hello World"')
print(result["stdout"])  # or just print(sb.exec("echo hi"))

# List and cleanup
print(k7.list())
sb.delete()
```

Async variant:

```python theme={null}
import asyncio
from katakate import AsyncClient

async def main():
    k7 = AsyncClient(endpoint="https://<your-endpoint>", api_key="<your-key>")
    print(await k7.list())
    await k7.aclose()

asyncio.run(main())
```

## Next steps

* Explore the CLI guide: `/guides/cli`
* Explore the Python SDK guide: `/guides/python-sdk`
* Integrate with the REST API: `/api/introduction`
