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

# Docker Swarm

> Production deployment with Docker Swarm

Docker Swarm is the default deployment target. For a Kubernetes cluster, see [Kubernetes](/0.7/deployment/kubernetes).

## Prerequisites

### 1. Initialize Docker Swarm

On the manager node:

```bash theme={null}
docker swarm init
```

### 2. Join worker nodes (optional)

On each worker node, run the join command provided by `docker swarm init`:

```bash theme={null}
docker swarm join --token <token> <manager-ip>:2377
```

## Registry authentication

Registry authentication is zero-touch. The CLI fetches the registry token itself on every deploy and hands fresh credentials to Swarm. You do not install a credential helper, run `docker login`, or manage expiring tokens by hand on any node.

## Deployment

Deploy the stack:

```bash theme={null}
2501 infra deploy
```

For CI/CD pipelines, add `--yes`. In `--yes` mode the CLI auto-fixes everything it can, then aborts with an actionable list if a human-required value (such as an LLM API key or the external `DATABASE_URL`) is still missing.

Run an interactive `2501 infra deploy` to upgrade: the CLI lists published releases newest-first and self-updates its own binary to match the version you pick before deploying. For all deployment options, run `2501 infra deploy -h`.

## Post-deployment

Verify the services are healthy:

```bash theme={null}
curl http://localhost:1337/health    # Engine
curl http://localhost:3000/health    # Command Center
docker stack services 2501
```

If you run `2501 infra deploy` without `--yes`, the CLI interactively prompts you to create your first tenant, organization, and admin user. In `--yes` mode, create them afterward with `2501 infra tenant create`, `2501 infra org create`, and `2501 infra user create` (use `-h` on each for details).
