| layout | default |
|---|---|
| title | Setup Guide |
| nav_order | 2 |
| description | Installation, configuration, and deployment guide |
| parent | Documentation |
This guide will help you get Wildcat up and running on your system.
- Node.js 16+ and npm
- MongoDB 4.4+ (local or cloud instance)
- WhatsApp mobile app for QR scanning
-
Clone the repository:
git clone https://github.com/NotoriousArnav/wildcat.git cd wildcat -
Install dependencies:
npm install
-
Configure environment variables:
Create a
.envfile in the root directory:# Server configuration HOST=0.0.0.0 PORT=3000 # MongoDB configuration MONGO_URL=mongodb://localhost:27017 DB_NAME=wildcat # Optional: Logging level LOG_LEVEL=info # Optional: Admin number to receive startup ping # ADMIN_NUMBER=1234567890@s.whatsapp.net # Auto‑connect restored accounts # AUTO_CONNECT_ON_START=true
-
Start MongoDB: Make sure MongoDB is running on your system.
-
Start the server:
npm start
The server will start on
http://localhost:3000
-
Create an account:
curl -X POST http://localhost:3000/accounts \ -H 'Content-Type: application/json' \ -d '{"id": "myaccount", "name": "My WhatsApp Account"}'
-
Get QR code:
curl http://localhost:3000/accounts/myaccount/status
-
Scan the QR code:
- Copy the
qrvalue from the response - Open WhatsApp on your phone
- Go to Settings > Linked Devices > Link a Device
- Scan the QR code
- Copy the
-
Verify connection:
curl http://localhost:3000/accounts/myaccount/status
Should show
"status": "connected"
Send a test message:
curl -X POST http://localhost:3000/accounts/myaccount/message/send \
-H 'Content-Type: application/json' \
-d '{
"to": "1234567890@s.whatsapp.net",
"message": "Hello from Wildcat API!"
}'A Dockerfile is provided to build a production image (includes ffmpeg for audio conversion).
- Build the image:
docker build -t wildcat:latest .- Run with local MongoDB (host network example):
docker run --name wildcat \
-p 3000:3000 \
-e HOST=0.0.0.0 \
-e PORT=3000 \
-e MONGO_URL="mongodb://host.docker.internal:27017" \
-e DB_NAME=wildcat \
-e AUTO_CONNECT_ON_START=true \
wildcat:latest- Run with a MongoDB container on the same network:
docker network create wildcat-net || true
docker run -d --name mongo --network wildcat-net -p 27017:27017 mongo:6
docker run --name wildcat --network wildcat-net -p 3000:3000 \
-e MONGO_URL="mongodb://mongo:27017" \
-e DB_NAME=wildcat \
-e AUTO_CONNECT_ON_START=true \
wildcat:latestHealth check: GET /ping should return { ok: true, pong: true }.
For development with auto-restart:
npm run dev- Server won't start: Check MongoDB connection and environment variables
- QR code not working: Ensure WhatsApp is updated and try regenerating
- Messages not sending: Verify account is connected and JID format is correct
- Set up webhooks for incoming messages
- Explore the full API in the API Reference
- Check out development guidelines