Prerequisites
Before you begin, ensure you have:- Docker Engine 20.10 or later
- Docker Compose 2.0 or later (optional, for multi-service deployment)
- At least 2GB RAM available
- Ports 8080 (API), 5432 (PostgreSQL), and 6379 (Redis) available
Quick Start with Docker
Single Container Deployment
For testing or development, you can run Evolution API in a single container:http://localhost:8080.
Docker Compose Deployment
The recommended way to deploy Evolution API is using Docker Compose, which sets up all required services.Complete Setup
1
Create project directory
Create a directory for your Evolution API deployment:
2
Create docker-compose.yaml
Create a
docker-compose.yaml file with the following content:docker-compose.yaml
3
Create environment file
Create a
.env file with your configuration:.env
4
Start services
Start all services using Docker Compose:This will start:
- Evolution API (port 8080)
- Evolution Manager UI (port 3000)
- PostgreSQL database (internal)
- Redis cache (internal)
5
Verify deployment
Check that all containers are running:You should see all services with status “Up”.
6
Access the application
- API:
http://localhost:8080 - Manager UI:
http://localhost:3000
Service Configuration
Evolution API Service
The main API service configuration:string
The Docker image to use. Options:
evoapicloud/evolution-api:latest- Latest stable versionevoapicloud/evolution-api:v2.3.1- Specific versionevoapicloud/evolution-api:develop- Development version
string
Port mapping in format
host:container.Examples:"8080:8080"- Expose on all interfaces"127.0.0.1:8080:8080"- Expose only on localhost"9090:8080"- Expose on host port 9090
array
Volume mounts for persistent data:
evolution_instances:/evolution/instances- Instance data and QR codes./custom-data:/evolution/custom- Mount custom directory (optional)
PostgreSQL Service
Database configuration with performance optimizations:The
max_connections=1000 setting allows Evolution API to handle many concurrent WhatsApp instances.Redis Service
Cache configuration with persistence:--appendonly yes flag enables AOF persistence for data durability.
Volume Management
Evolution API uses Docker volumes for persistent storage:Backup Volumes
Create backups of your volumes:Restore Volumes
Restore from backups:Network Configuration
Theevolution-net bridge network connects all services:
- Database:
evolution-postgres:5432 - Redis:
evolution-redis:6379 - API:
evolution_api:8080
Custom Network
For integration with other services (e.g., reverse proxy):Dockerfile Reference
Evolution API uses a multi-stage build process:- Uses Node.js 24 Alpine for minimal image size
- Installs required system dependencies (ffmpeg for audio conversion)
- Builds TypeScript source code
- Creates optimized production image
- Runs database migrations on startup
Environment Variables
Key environment variables for Docker deployment:.env
Production Considerations
Resource Limits
Set resource limits for containers:Health Checks
Add health checks to monitor service status:Restart Policies
Configure automatic restart on failure:Troubleshooting
Container fails to start
Container fails to start
Check container logs:Common issues:
- Missing environment variables in
.env - Port conflicts (8080, 5432, or 6379 already in use)
- Database connection errors
Database connection errors
Database connection errors
Verify database is running and accessible:Check connection URI format in
.env:High memory usage
High memory usage
Monitor container resource usage:Optimize by:
- Setting resource limits
- Reducing number of concurrent instances
- Enabling Redis cache to reduce database load
- Increasing server RAM
Port conflicts
Port conflicts
If ports are already in use, change them in Find processes using ports:
docker-compose.yaml:Useful Commands
Next Steps
Environment Variables
Complete guide to all configuration options
Database Setup
Configure PostgreSQL or MySQL for production