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

# Run a Worker with Docker

> Deploy a Worker to an NVIDIA GPU server that supports Docker and connect it to Kastard.

> [!NOTE]
>
> If you use RunPod or Vast.ai, deploy a Worker using the template provided by Kastard.

Use this method to deploy a Worker directly to a Linux `amd64` NVIDIA GPU server that supports Docker.

## Requirements

* Docker Engine with Docker Compose 2.30 or later
* NVIDIA Container Toolkit
* An NVIDIA GPU driver that supports CUDA 13.0 or later
* A server address and TCP port that the computer running Kastard can reach

The default port is `5278`. If you connect over the internet, allow this port through the server firewall.

## 1. Download the Compose file

Create a directory for the Worker on the server and download the Compose file.

```bash theme={null}
mkdir -p kastard-worker
cd kastard-worker
curl -fLO https://raw.githubusercontent.com/somecatco/kastard/main/compose.yaml
```

## 2. Configure the Worker

Create a `.env` file in the same directory as the Compose file.

```env theme={null}
KASTARD_WORKER_IMAGE=docker.io/somecatco/kastard-worker-cu130:latest
KASTARD_PUBLIC_ADDRESS=REPLACE_ME:5278
```

* Set `KASTARD_WORKER_IMAGE` to the Worker image you want to use.

* Set `KASTARD_PUBLIC_ADDRESS` to the server IP address or domain and port that Kastard can reach.

* CUDA 13.0: `docker.io/somecatco/kastard-worker-cu130:latest`

The configuration above uses the CUDA 13.0 image. This image requires an NVIDIA GPU driver that supports CUDA 13.0 or later.

## 3. Start the Worker

```bash theme={null}
docker compose up --detach
```

The first start may take some time while Docker downloads the Worker image.

## 4. Find the connection details

```bash theme={null}
docker compose logs --follow worker
```

Find these two values in the logs.

```text theme={null}
Worker address: gpu.example.com:5278
Authentication code: ABCD-EFGH-JKLM-NPQR
```

## 5. Connect Kastard

1. Open `Connect` in Kastard.
2. Select `Other server`.
3. Enter the `Worker address` and `Authentication code` from the logs.
4. Select `Connect`.

## Manage the Worker

Pull the configured image and recreate the Worker.

```bash theme={null}
docker compose pull
docker compose up --detach
```

Stop the Worker and remove its container.

```bash theme={null}
docker compose down
```

Worker data, including models and Custom Nodes, remains in Docker volumes. Running `down --volumes` deletes this data.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.