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

# Docker Self-Hosting

> Deploy AutoClip on Linux, Intel Mac, or private servers using Docker Compose with persistent volumes and reverse proxy guidance.

Use Docker Compose to run AutoClip on Linux servers, Intel Macs, NAS devices, or any environment where you prefer a browser-accessible web interface.

**Prerequisites:** Docker Engine and Docker Compose v2 (`docker compose`), plus sufficient disk space for source footage, local models, caches, and rendered exports.

## Quick Start with Docker Compose

**1. Clone the Repository & Create .env**

```bash theme={null}
git clone https://github.com/zhouxiaoka/autoclip.git
cd autoclip
cp env.example .env
```

Edit `.env` to configure your default AI provider (or leave it for the Web Settings UI after startup):

```dotenv theme={null}
LLM_PROVIDER=dashscope
API_MODEL_NAME=qwen-plus
API_DASHSCOPE_API_KEY=your_api_key
```

**2. Prepare Bind-Mounted Directories**

Create the host directories and assign ownership to the container's `autoclip` user so SQLite writes and media uploads succeed cleanly on Linux:

```bash theme={null}
mkdir -p data logs uploads
docker compose build
docker compose run --rm --no-deps --user root --entrypoint sh autoclip \
  -c 'chown -R autoclip:autoclip /app/data /app/logs /app/uploads'
```

**3. Start the Stack**

```bash theme={null}
docker compose up -d
docker compose ps
```

## Default Service Endpoints

| Service | Default URL | Notes |
| :- | :- | :- |
| **Web Interface** | `http://localhost:3000` | Main AutoClip Studio & dashboard |
| **Backend API Docs** | `http://localhost:8000/docs` | Interactive OpenAPI documentation |
| **Health Check** | `http://localhost:8000/api/v1/health/` | Returns HTTP 200 when backend is ready |
| **Flower Monitor** | `http://localhost:5555` | Celery worker & queue monitor (trusted networks only) |

## Persistent Volumes & Backups

The default `docker-compose.yml` persists all state using bind mounts:

| Host Path | Container Path | Stored Data |
| :- | :- | :- |
| `./data` | `/app/data` | SQLite database, project metadata, rendered clips, and app settings |
| `./logs` | `/app/logs` | Application and worker logs |
| `./uploads` | `/app/uploads` | Uploaded source footage and transcripts |

To back up your instance safely, wait for active jobs to finish, stop the stack, and archive the bind mounts along with `.env`:

```bash theme={null}
docker compose stop
tar -czf "../autoclip-backup-$(date +%Y%m%d-%H%M%S).tar.gz" data logs uploads .env
docker compose start
```

> [!WARNING]
>
> Backups contain your `.env` file and saved provider API keys. Store archives securely and never commit them to a public repository.

## Environment Variables & Host Ollama

Key environment variables supported in `.env` (see `env.example` for the full list):

* `LLM_PROVIDER`: Active provider key (`openai`, `gemini`, `deepseek`, `minimax`, `dashscope`, `ollama`, etc.)
* `API_MODEL_NAME`: Default model name for highlight analysis
* `OPENAI_BASE_URL`: Custom base URL for OpenAI-compatible gateways or host Ollama

To connect containers to **Ollama running on your host machine**:

```dotenv theme={null}
LLM_PROVIDER=ollama
OPENAI_BASE_URL=http://host.docker.internal:11434/v1
API_MODEL_NAME=qwen2.5:7b
```

On Linux Docker Engine, add `extra_hosts` under both `autoclip` and `celery-worker` in `docker-compose.yml` so `host.docker.internal` resolves to the host gateway:

```yaml theme={null}
extra_hosts:
  - "host.docker.internal:host-gateway"
```

## Reverse Proxy & Security Tips

The default stack is designed for local or trusted-LAN use. If you expose AutoClip behind **Nginx**, **Caddy**, or **Traefik**:

* **Never expose Redis (`6379`) or Flower (`5555`)** to the public internet. Bind them to `127.0.0.1` or place them behind VPN/Zero-Trust authentication.
* **Increase upload body limits & timeouts**: Video uploads and long FFmpeg exports require generous proxy limits (for example `client_max_body_size 4G;` and extended `proxy_read_timeout` in Nginx).
* **Enable WebSocket pass-through**: Forward `Upgrade` and `Connection` headers so real-time progress updates stream smoothly to the browser.
* **Require authentication**: Place AutoClip behind Basic Auth, Authelia, Authentik, or Cloudflare Access when hosting on a public domain.

## Updating & Maintenance

```bash theme={null}
git pull --ff-only
docker compose up -d --build
```

Use `docker compose logs --tail=100 autoclip celery-worker` to inspect runtime logs at any time.


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