Quickstart Guide
Quickstart Guide
Section titled “Quickstart Guide”This guide will walk you through setting up Evolution API Lite using Docker and sending your first WhatsApp message. You’ll have a working instance in under 10 minutes.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- Docker and Docker Compose installed
- A text editor for configuration files
- Basic familiarity with REST APIs and cURL commands
Step 1: Download and Configure
Section titled “Step 1: Download and Configure”-
Clone or Download the Project
Terminal window git clone https://github.com/EvolutionAPI/evolution-api.gitcd evolution-apiOr download the
docker-compose.yamland.env.examplefiles directly. -
Create Environment Configuration
Copy the example environment file and configure it:
Terminal window cp .env.example .envOpen the
.envfile and update these essential settings:Terminal window # Server ConfigurationSERVER_URL=http://localhost:8080# Database Configuration (using the default PostgreSQL setup)DATABASE_PROVIDER=postgresqlDATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution?schema=public'# Authentication - Change this to a secure API keyAUTHENTICATION_API_KEY=your-secure-api-key-here# Enable QR Code generationQRCODE_LIMIT=30
Step 2: Start the Services
Section titled “Step 2: Start the Services”Launch all services using Docker Compose:
docker-compose up -dThis command starts:
- Evolution API Lite on port 8080
- PostgreSQL database on port 5432
- Redis cache on port 6379
Verify the services are running:
docker-compose psYou should see all three containers in the “Up” state.
Step 3: Create Your First Instance
Section titled “Step 3: Create Your First Instance”Now create a WhatsApp instance using the API:
curl -X POST http://localhost:8080/instance/create \ -H "Content-Type: application/json" \ -H "apikey: your-secure-api-key-here" \ -d '{ "instanceName": "my-first-instance", "integration": "WHATSAPP_BAILEYS", "qrcode": true }'const response = await fetch('http://localhost:8080/instance/create', { method: 'POST', headers: { 'Content-Type': 'application/json', apikey: 'your-secure-api-key-here' }, body: JSON.stringify({ instanceName: 'my-first-instance', integration: 'WHATSAPP_BAILEYS', qrcode: true })})
const data = await response.json()console.log(data)The response will include:
- Instance details (name, ID, status)
- A QR code (base64 encoded)
- Authentication hash for this specific instance
Step 4: Connect to WhatsApp
Section titled “Step 4: Connect to WhatsApp”- Get the QR Code
- The API response includes a QR code in base64 format. You can:
- Decode and display it using an online base64 → image converter
- Use a QR code terminal tool to display it directly in your terminal
- Or check the Docker logs for a terminal-rendered QR code:
docker-compose logs -f api- Scan with WhatsApp
- Open WhatsApp on your phone
- Go to Settings → Linked Devices
- Tap “Link a Device”
- Scan the QR code displayed from the API response
- Verify Connection
Check your instance connection status:
curl -X GET http://localhost:8080/instance/my-first-instance/connectionState \ -H "apikey: your-secure-api-key-here"You should see “state”: “open” when successfully connected.
Step 5: Send Your First Message
Section titled “Step 5: Send Your First Message”Now send a text message to verify everything works:
curl -X POST http://localhost:8080/message/my-first-instance/sendText \ -H "Content-Type: application/json" \ -H "apikey: your-secure-api-key-here" \ -d '{ "number": "5511999999999", "text": "Hello from Evolution API Lite! 🚀" }'const response = await fetch('http://localhost:8080/message/my-first-instance/sendText', { method: 'POST', headers: { 'Content-Type': 'application/json', apikey: 'your-secure-api-key-here' }, body: JSON.stringify({ number: '5511999999999', text: 'Hello from Evolution API Lite! 🚀' })})
const result = await response.json()console.log(result)Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”QR Code Not Generating
Section titled “QR Code Not Generating”- Ensure qrcode: true is set in the instance creation request
- Check Docker logs: docker-compose logs api
- Verify the instance was created successfully
Connection Fails After Scanning
Section titled “Connection Fails After Scanning”- Wait 10-15 seconds after scanning before checking connection status
- Ensure your phone has a stable internet connection
- Try restarting the instance:
POST /instance/{instanceName}/restart
API Key Authentication Errors
Section titled “API Key Authentication Errors”- Verify the API key matches exactly between .env and your requests
- Ensure the apikey header is included in all requests
- Check that there are no extra spaces or characters in the key
Database Connection Issues
Section titled “Database Connection Issues”- Verify PostgreSQL container is running: docker-compose ps
- Check database logs: docker-compose logs postgres
- Ensure the DATABASE_CONNECTION_URI in .env is correct
Getting Help
Section titled “Getting Help”If you encounter issues: