This guide explains how to deploy the ExcaliDraw AI Agent using Docker and Docker Compose.
- Docker Engine 20.10+
- Docker Compose 2.0+
- At least 1GB RAM available
- (Optional) NVIDIA GPU for Ollama with GPU support
git clone <repository-url>
cd ExcalidrawToolCopy the Docker Compose environment template and configure it:
cp .env.docker-compose .envEdit .env and set at minimum:
VITE_ANTHROPIC_API_KEY- Your Anthropic API key (required if using Anthropic)
# Using Docker Compose
docker-compose up -d
# Or use the Makefile
make upThe application will be available at: http://localhost:8080
Full configuration with optional services (Ollama, N8N, Redis).
Features:
- Excalidraw AI Agent app
- Optional Ollama service (commented by default)
- Optional N8N service (commented by default)
- Optional Redis service (commented by default)
- Health checks enabled
- Volume persistence for data
Production-optimized configuration.
Features:
- Only essential services
- Always restart policy
- Resource limits
- Log rotation
- Health checks
- Optimized for cloud deployment
All environment variables are documented in .env.docker-compose. Key variables:
VITE_ANTHROPIC_API_KEY- Anthropic API key (or configure Ollama)
VITE_AI_PROVIDER- AI provider to use (anthropic or ollama)VITE_AI_TEMPERATURE- Controls AI response randomnessVITE_N8N_WEBHOOK_URL- N8N webhook URL for integration- See
.env.docker-composefor full list
- Set your API key in
.env:
VITE_ANTHROPIC_API_KEY=sk-ant-xxxxx- Start the service:
docker-compose up -d-
Uncomment the Ollama service in
docker-compose.yml -
Start all services:
docker-compose up -d- Pull a model in the Ollama container:
docker-compose exec ollama ollama pull llama3.2-
Configure environment variables for production
-
Deploy using the production configuration:
make deployOr manually:
docker-compose -f docker-compose.prod.yml --env-file .env up -dmake help # Show all available commands
make build # Build Docker image
make up # Start services
make down # Stop services
make restart # Restart services
make logs # View logs
make clean # Remove containers and volumes
make deploy # Deploy to production# Build and start
docker-compose up -d
# View logs
docker-compose logs -f excalidraw-app
# Stop services
docker-compose down
# Restart services
docker-compose restart
# Remove everything (including volumes)
docker-compose down -vThe application can be deployed to any cloud platform that supports Docker Compose:
- Push image to ECR
- Create ECS task definition
- Deploy using ECS CLI or Console
gcloud run deploy excalidraw-agent \
--image gcr.io/PROJECT_ID/excalidraw-agent:latest \
--platform managed \
--region REGION \
--allow-unauthenticated \
--set-env-vars VITE_ANTHROPIC_API_KEY=$API_KEYaz container create \
--resource-group excalidraw-rg \
--name excalidraw-agent \
--image excalidraw-agent:latest \
--dns-name-label excalidraw-agent \
--ports 80 80doctl apps create \
--name excalidraw-agent \
--region nyc \
--spec excalidraw-agentWhen deploying to a cloud platform, update the N8N callback URL:
# In .env or cloud environment variables
VITE_N8N_CALLBACK_URL=https://your-domain.com/api/n8n/callbackFor production, consider:
- Using a backend proxy to hide the API key
- Using secrets management (AWS Secrets Manager, etc.)
- Enabling HTTPS/TLS
The application includes a health check endpoint:
curl http://localhost:8080/healthResponse: healthy
# Check logs
docker-compose logs excalidraw-app
# Check container status
docker-compose ps- Verify the API key is set correctly in
.env - Check Docker logs for authentication errors
- Ensure the key has the required permissions
Change the exposed port in docker-compose.yml:
ports:
- "8080:80" # Change 8080 to your preferred port- Verify Ollama service is running:
docker-compose ps - Check base URL matches service name:
http://ollama:11434 - Ensure Ollama model is pulled:
docker-compose exec ollama ollama list
Data is persisted in named volumes:
# List volumes
docker volume ls | grep excalidraw
# Remove volumes (WARNING: deletes data)
docker-compose down -v
# Backup volumes
docker run --rm -v excalidraw-ollama-data:/data -v $(pwd):/backup alpine tar czf /backup/ollama-backup.tar.gz /data# Pull latest changes
git pull
# Rebuild and restart
docker-compose up -d --build- API Key Management: Never commit
.envfiles with real API keys - HTTPS: Use a reverse proxy (nginx, traefik) for production
- CORS: Configure CORS appropriately for your domain
- Rate Limiting: Implement rate limiting for API endpoints
- Secrets: Use cloud secrets management in production
For issues or questions:
- Check logs:
docker-compose logs -f - Verify environment variables in
.env - Ensure all required services are running