⚡ WhatsApp Server Setup & Configuration
The WhatsApp Server is required to enable QR login, message sending, chatbot automation, and real-time communication.
Important: Without this server, WhatsApp features will NOT work.
1. Extract WhatsApp Server
Locate the file:
whatsapp_server.zip
Extract the file. After extraction, you will get:
whatsapp-server/
Move it to your server:
/home/whatsapp-server/ or /var/www/whatsapp-server/
Important: Do NOT place inside your Laravel project directory.
2. Configure Server (config.js)
Open file:
whatsapp-server/config.js
Update your configuration:
app_url must match your main domain:
https://yourdomain.com/
Update database credentials (must be same as Laravel):
- Database host
- Database name
- Database username
- Database password
Important: The database must be the SAME as your Laravel installation.
3. Install Dependencies
Open terminal and run:
cd whatsapp-server
npm install
4. Start Server
Run:
node app.js
Or (recommended):
pm2 start app.js -i max
Default server URL:
http://localhost:8000
5. Connect in Laravel
Go to:
Settings → API Integration → WhatsApp Unofficial
- Set Status = Enable
- Enter WhatsApp Server URL
Example:
http://yourdomain.com:8000/
Or (recommended):
https://ws.yourdomain.com
Click Save
6. Verify Setup
- Go to User Dashboard
- Add WhatsApp account
- Scan QR code
If QR appears → setup successful
Recommended Setup (No Port)
Instead of using:
http://yourdomain.com:8000/
Use:
https://ws.yourdomain.com
This method is more stable and avoids port blocking issues.
Troubleshooting
- QR not showing: Check server is running, check URL, restart server
- Cannot connect: Check firewall, port 8000, reverse proxy
- Disconnected: Use PM2, ensure stable server
Important Notes
- Node.js version must be 20 or higher
- Server must run 24/7
- Use same server as main application (recommended)
- Do NOT use localhost in production
Required Notice
You must complete all steps:
- Extract and run WhatsApp Server
- Configure config.js correctly
- Enable WhatsApp Unofficial API in Laravel
Missing any step will cause the system to NOT work properly.