Self-hosted WhatsApp API with web dashboard for managing multiple sessions.
services:
wacap:
image: bangfkr/wacap:latest
container_name: wacap-app
ports:
- "3000:3000"
volumes:
- wacap-data:/app/data
environment:
- JWT_SECRET=your-secure-secret-key-here
restart: unless-stopped
volumes:
wacap-data:
docker-compose up -d
| Variable | Required | Default | Description |
|---|---|---|---|
JWT_SECRET | ✅ Yes | - | Secret key for JWT tokens |
HOST_PORT | No | 3000 | Host port to expose |
NODE_ENV | No | production | Environment mode |
FRONTEND_URL | No | - | CORS allowed origin |
SESSION_MAX_AGE_MS | No | 2592000000 | Max session age (30 days) |
SESSION_MAX_INACTIVE_MS | No | 604800000 | Max inactive time (7 days) |
Generate a Device Token from the dashboard, then use it in API requests:
curl -X POST "http://localhost:3000/api/send/text" \
-H "Content-Type: application/json" \
-H "X-Device-Token: YOUR_DEVICE_TOKEN" \
-d '{
"sessionId": "my-session",
"to": "628123456789",
"text": "Hello from API!"
}'
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/send/text | Send text message |
| POST | /api/send/media | Send image/video/document |
| POST | /api/send/location | Send location |
| POST | /api/send/contact | Send contact card |
| GET | /api/sessions | List sessions |
| POST | /api/sessions | Create session |
| DELETE | /api/sessions/:id | Delete session |
Configure webhooks per session to receive real-time events:
message.received - Incoming messagesmessage.sent - Outgoing messagessession.connected - Session connectedsession.disconnected - Session disconnectedsession.qr - QR code generatedtyping.start / typing.stop - Typing indicatorspresence.update - Online/offline statusAll data is stored in /app/data:
wacap.db - SQLite database (users, sessions, tokens)sessions/ - WhatsApp session credentialsMount a volume to persist data across container restarts.
MIT
Content type
Image
Digest
sha256:6c691ea0c…
Size
106.6 MB
Last updated
11 months ago
docker pull bangfkr/wacap