Skip to main content

Overview

Docker Compose provides the fastest way to deploy Skyvern with all required services. This guide covers installation, configuration, and management of a Docker-based Skyvern deployment.

Prerequisites

  • Docker Desktop or Docker Engine 20.10+
  • Docker Compose v2.0+
  • 8GB+ RAM available
  • 50GB+ free disk space

Quick Start

# Install Skyvern
pip install skyvern

# Run quickstart wizard
skyvern quickstart
When prompted, choose “Docker Compose” for the full containerized setup.

Option 2: Manual Docker Compose

# Clone the repository
git clone https://github.com/skyvern-ai/skyvern.git
cd skyvern

# Configure environment variables
cp .env.example .env
# Edit .env with your LLM provider credentials

# Start all services
docker compose up -d
Access the UI at http://localhost:8080

Docker Compose Configuration

The docker-compose.yml defines three services:

Services Overview

services:
  postgres:      # PostgreSQL database
  skyvern:       # Backend API and automation engine
  skyvern-ui:    # Web interface

Service Details

PostgreSQL Service

postgres:
  image: postgres:14-alpine
  restart: always
  volumes:
    - ./postgres-data:/var/lib/postgresql/data
  environment:
    - PGDATA=/var/lib/postgresql/data/pgdata
    - POSTGRES_USER=skyvern
    - POSTGRES_PASSWORD=skyvern
    - POSTGRES_DB=skyvern
  healthcheck:
    test: ["CMD-SHELL", "pg_isready -U skyvern"]
    interval: 5s
    timeout: 5s
    retries: 5
Key Configuration:
  • Data Persistence: ./postgres-data stores database files
  • Health Checks: Ensures database is ready before starting dependent services
  • Default Credentials: Change in production deployments

Skyvern Backend Service

skyvern:
  image: public.ecr.aws/skyvern/skyvern:latest
  restart: on-failure
  env_file:
    - .env
  ports:
    - 8000:8000  # API endpoint
    - 9222:9222  # CDP browser forwarding
  volumes:
    - ./artifacts:/data/artifacts
    - ./videos:/data/videos
    - ./har:/data/har
    - ./log:/data/log
    - ./.streamlit:/app/.streamlit
  environment:
    - DATABASE_STRING=postgresql+psycopg://skyvern:skyvern@postgres:5432/skyvern
    - BROWSER_TYPE=chromium-headful
    - ENABLE_CODE_BLOCK=true
  depends_on:
    postgres:
      condition: service_healthy
Key Configuration:
  • Volumes: Persist artifacts, videos, and logs on host
  • Database Connection: Uses internal Docker network (postgres:5432)
  • Browser Mode: chromium-headful for visibility (use chromium-headless for production)
  • Health Check: Validates .streamlit/secrets.toml exists

Skyvern UI Service

skyvern-ui:
  image: public.ecr.aws/skyvern/skyvern-ui:latest
  restart: on-failure
  ports:
    - 8080:8080  # Web UI
    - 9090:9090  # Artifact API
  volumes:
    - ./artifacts:/data/artifacts
    - ./videos:/data/videos
    - ./har:/data/har
    - ./.streamlit:/app/.streamlit
  env_file:
    - skyvern-frontend/.env
  depends_on:
    skyvern:
      condition: service_healthy

Environment Configuration

Create a .env file in the project root with your LLM provider settings:
# Environment
ENV=local

# LLM Provider (choose one)
ENABLE_OPENAI=true
OPENAI_API_KEY=your_openai_key
LLM_KEY=OPENAI_GPT4O

# Database (default for Docker Compose)
DATABASE_STRING=postgresql+psycopg://skyvern:skyvern@postgres:5432/skyvern

# Browser Configuration
BROWSER_TYPE=chromium-headful
MAX_STEPS_PER_RUN=50

# Logging
LOG_LEVEL=INFO
For complete environment variable reference, see Environment Variables

LLM Configuration in Docker Compose

The docker-compose.yml includes commented examples for all supported LLM providers:

OpenAI

environment:
  - ENABLE_OPENAI=true
  - LLM_KEY=OPENAI_GPT4O
  - OPENAI_API_KEY=<your_openai_key>

Anthropic

environment:
  - ENABLE_ANTHROPIC=true
  - LLM_KEY=ANTHROPIC_CLAUDE3.5_SONNET
  - ANTHROPIC_API_KEY=<your_anthropic_key>

Azure OpenAI

environment:
  - ENABLE_AZURE=true
  - LLM_KEY=AZURE_OPENAI
  - AZURE_DEPLOYMENT=<your_deployment>
  - AZURE_API_KEY=<your_key>
  - AZURE_API_BASE=https://yourname.openai.azure.com/
  - AZURE_API_VERSION=2024-08-01-preview

AWS Bedrock

environment:
  - ENABLE_BEDROCK=true
  - LLM_KEY=BEDROCK_ANTHROPIC_CLAUDE3.5_SONNET
  - AWS_REGION=us-west-2
  - AWS_ACCESS_KEY_ID=<your_key>
  - AWS_SECRET_ACCESS_KEY=<your_secret>

Local LLM with Ollama

environment:
  - LLM_KEY=OLLAMA
  - ENABLE_OLLAMA=true
  - OLLAMA_MODEL=qwen2.5:7b-instruct
  - OLLAMA_SERVER_URL=http://host.docker.internal:11434
  - OLLAMA_SUPPORTS_VISION=false

Browser Configuration Options

Chromium Headful (Development)

environment:
  - BROWSER_TYPE=chromium-headful
Best for: Development, debugging, visual monitoring

Chromium Headless (Production)

environment:
  - BROWSER_TYPE=chromium-headless
Best for: Production deployments, lower resource usage

CDP Connect (Use Your Own Browser)

environment:
  - BROWSER_TYPE=cdp-connect
  - BROWSER_REMOTE_DEBUGGING_URL=http://host.docker.internal:9222/
Start Chrome with remote debugging: macOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 \
  --user-data-dir="/Users/yourusername/chrome-cdp-profile" \
  --no-first-run --no-default-browser-check
Windows:
"C:\Program Files\Google\Chrome\Application\chrome.exe" \
  --remote-debugging-port=9222 \
  --user-data-dir="C:\chrome-cdp-profile" \
  --no-first-run --no-default-browser-check

Volume Mounts

Data is persisted in the following directories:
volumes:
  - ./postgres-data:/var/lib/postgresql/data  # Database
  - ./artifacts:/data/artifacts                # Screenshots, files
  - ./videos:/data/videos                      # Session recordings
  - ./har:/data/har                            # Network logs
  - ./log:/data/log                            # Application logs
  - ./.streamlit:/app/.streamlit               # UI config

Common Docker Compose Commands

Start Services

# Start all services in background
docker compose up -d

# Start with logs visible
docker compose up

# Start specific service
docker compose up -d skyvern

Monitor Services

# View logs
docker compose logs -f

# View logs for specific service
docker compose logs -f skyvern

# Check service status
docker compose ps

Manage Services

# Stop all services
docker compose down

# Stop and remove volumes (⚠️ deletes data)
docker compose down -v

# Restart a service
docker compose restart skyvern

# Rebuild and restart
docker compose up -d --build

Update to Latest Version

# Pull latest images
docker compose pull

# Restart with new images
docker compose up -d

Remote Server Deployment

If deploying on a remote server, update the frontend environment variables:
skyvern-ui:
  environment:
    - VITE_WSS_BASE_URL=ws://your-server-ip:8000/api/v1
    - VITE_API_BASE_URL=http://your-server-ip:8000/api/v1
    - VITE_ARTIFACT_API_BASE_URL=http://your-server-ip:9090
For domain-based deployment:
environment:
  - VITE_WSS_BASE_URL=wss://api.yourdomain.com/api/v1
  - VITE_API_BASE_URL=https://api.yourdomain.com/api/v1
  - VITE_ARTIFACT_API_BASE_URL=https://artifact.yourdomain.com

External Database Connection

To use an external PostgreSQL database:
  1. Remove or comment out the postgres service
  2. Update the database connection string:
skyvern:
  environment:
    - DATABASE_STRING=postgresql+psycopg://user:password@external-host:5432/skyvern

Troubleshooting

Service Won’t Start

# Check service logs
docker compose logs skyvern

# Check health status
docker compose ps

Database Connection Issues

# Verify PostgreSQL is healthy
docker compose ps postgres

# Test database connection
docker compose exec postgres pg_isready -U skyvern

Port Conflicts

If ports 8000, 8080, or 5432 are already in use, modify the port mappings:
ports:
  - 8001:8000  # Map to different host port

Permission Issues

# Fix volume permissions
sudo chown -R $(whoami):$(whoami) ./artifacts ./videos ./har ./log

Docker Image Information

Official Images

  • Backend: public.ecr.aws/skyvern/skyvern:latest
  • Frontend: public.ecr.aws/skyvern/skyvern-ui:latest

Building Custom Images

The included Dockerfile defines the backend image:
FROM python:3.11-slim-bookworm
WORKDIR /app

# Install dependencies
RUN pip install --upgrade pip setuptools wheel
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install Playwright browsers
RUN playwright install-deps
RUN playwright install

# Install Node.js and Bitwarden CLI
RUN apt-get install -y nodejs npm
RUN npm install -g @bitwarden/[email protected]

# Copy application
COPY . /app

ENV PYTHONPATH="/app"
ENV VIDEO_PATH=/data/videos
ENV HAR_PATH=/data/har
ENV LOG_PATH=/data/log
ENV ARTIFACT_STORAGE_PATH=/data/artifacts

CMD ["/bin/bash", "/app/entrypoint-skyvern.sh"]
Build custom image:
docker build -t my-skyvern:latest .
Update docker-compose.yml:
skyvern:
  image: my-skyvern:latest
  build: .

Next Steps

LLM Configuration

Configure your LLM provider

Storage Configuration

Set up S3 or Azure Blob Storage

Environment Variables

Complete configuration reference

Kubernetes Deployment

Scale with Kubernetes

Build docs developers (and LLMs) love