PromptsDrop
TemplateJun 11, 2026·3 uses

Self-Hosted WhatsApp AI Agent Stack

One docker-compose file that runs n8n, Evolution API, Postgres and Redis locally. No Ngrok, no paid tunnels.

n8nEvolution APIDocker
docker-compose.yml
version: '3.8'

services:
  
  postgres:
    image: postgres:15-alpine
    container_name: evolution_postgres
    restart: always
    environment:
      POSTGRES_USER: evolution
      POSTGRES_PASSWORD: evolutionpassword
      POSTGRES_DB: evolution
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    container_name: evolution_redis
    restart: always
    ports:
      - "6379:6379"

  evolution-api:
    image: atendai/evolution-api:latest
    container_name: evolution_api
    restart: always
    ports:
      - "8080:8080"
    environment:
      - SERVER_URL=http://localhost:8080
      - AUTHENTICATION_API_KEY=supersecretapikey
      - DATABASE_ENABLED=true
      - DATABASE_PROVIDER=postgresql
      - DATABASE_CONNECTION_URI=postgresql://evolution:evolutionpassword@postgres:5432/evolution?schema=public
      - CACHE_REDIS_ENABLED=true
      - CACHE_REDIS_URI=redis://redis:6379
      - CONFIG_SESSION_PHONE_VERSION=2.3000.1032750324
    depends_on:
      - postgres
      - redis
    volumes:
      - evolution_instances:/evolution/instances
      - evolution_store:/evolution/store

  n8n:
    image: docker.n8n.io/n8nio/n8n:latest
    container_name: n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_SECURE_COOKIE=false
    volumes:
      - n8n_data:/home/node/.local/share/n8n

volumes:
  postgres_data:
  evolution_instances:
  evolution_store:
  n8n_data:

Everything runs on Docker's internal network, so n8n reaches Evolution API at http://evolution_api:8080 and Evolution API sends webhooks to http://n8n:5678. Fast, private and free.

How to run it

  1. Install Docker Desktop.
  2. Save the file above as docker-compose.yml in an empty folder.
  3. Run docker compose up -d.
  4. Open Evolution Manager at http://localhost:8080/manager, create an instance and scan the QR code with WhatsApp.
  5. Open n8n at http://localhost:5678 and point the instance webhook to your n8n workflow.

Change POSTGRES_PASSWORD and AUTHENTICATION_API_KEY before exposing this anywhere outside your machine.

In the video

The workflow listens for messages that start with !bot, cleans the text and uses an AI Agent with memory to translate and reply in the same chat.

More drops like this