SpeedCom WhatsApp API Installation Guide

Step 1: Prepare the Folder

  1. Create a folder for WhatsApp API:
    mkdir -p /opt/whatsapp
    cd /opt/whatsapp
  2. Create the docker-compose.yml file:
    nano docker-compose.yml
    Paste the following content:
    version: "3.9"
    
    services:
      postgres:
        image: postgres:14
        container_name: whatsapp_postgres
        environment:
          POSTGRES_USER: whatsapp
          POSTGRES_PASSWORD: strongpassword123
          POSTGRES_DB: whatsappdb
        volumes:
          - whatsapp_postgres_data:/var/lib/postgresql/data
        restart: always
    
      whatsapp:
        image: dimaskiddo/go-whatsapp-multidevice-rest:latest
        container_name: whatsapp_api
        depends_on:
          - postgres
        environment:
          HTTP_LISTEN_ADDRESS: "0.0.0.0"
          HTTP_LISTEN_PORT: "3000"
          DATABASE_DRIVER: "postgres"
          DATABASE_CONNECTION: "postgres://whatsapp:strongpassword123@postgres:5432/whatsappdb?sslmode=disable"
          WHATSAPP_SESSION_DIR: "/app/sessions"
          WHATSAPP_SESSION_AUTO_SAVE: "true"
        ports:
          - "3000:3000"
        volumes:
          - whatsapp_sessions:/app/sessions
        restart: always
    
    volumes:
      whatsapp_postgres_data:
      whatsapp_sessions:
  3. Create a .env file (optional but recommended):
    nano .env
    Paste:
    HTTP_LISTEN_ADDRESS=0.0.0.0
    HTTP_LISTEN_PORT=3000
    DATABASE_DRIVER=postgres
    DATABASE_CONNECTION=postgres://whatsapp:strongpassword123@postgres:5432/whatsappdb?sslmode=disable
    WHATSAPP_SESSION_DIR=/app/sessions
    WHATSAPP_SESSION_AUTO_SAVE=true
  4. Start the containers:
    docker compose up -d
  5. Check if the API is running:
    docker ps
    docker logs -f whatsapp_api
  6. Access WhatsApp API and QR login:
    http://YOUR_VPS_IP:3000/api/v1/whatsapp/docs/
    Scan the QR code with your WhatsApp account to start.
💡 Note: This setup uses PostgreSQL for database storage. It prevents errors like SQLITE_BUSY and allows multiple WhatsApp accounts to run smoothly.