Setup GOWA (WhatsApp REST API) di VPS Serta Domainnya
Pada tutorial kali ini setup GOWA (WhatsApp REST API) di VPS serta domainnya. Reponya adalah ini https://github.com/aldinokemal/go-whatsapp-web-multidevice. WhatsApp REST API with support for UI, Webhooks, and MCP. Built with Golang for efficient memory use. Requirements Pastikan sudah terinstall Docker dan Docker Compose Apache SSL Let’s Encrypt Konfigurasi Buat folder baru dengan nama gowa-tool Di dalam gowa-tool folder, buat file docker-compose.yml dan masukkan code berikut services: whatsapp: image: aldinokemal2104/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000 - APP_DEBUG=true - APP_OS=Chrome - APP_ACCOUNT_VALIDATION=true - WHATSAPP_WEBHOOK=https://webhook.site/xxx - WHATSAPP_WEBHOOK_SECRET=super-secret-key volumes: whatsapp: Run sudo docker compose up -d Setup Domain untuk GOWA Buat file baru di /etc/apache2/sites-available dengan nama gowa.example.com.conf <VirtualHost *:80> ServerName gowa.example.com </VirtualHost> Kemudian aktifkan virtual host dan restart Apache sudo a2ensite gowa.example.com.conf sudo systemctl restart apache2 Buat SSL untuk gowa.example.com dengan run ini sudo certbot --non-interactive \ -m [email protected] \ --agree-tos \ --no-eff-email \ --apache \ -d gowa.example.com \ --redirect Edit konfigurasi setelah membuat SSL selesai (port 443) filenya ada /etc/apache2/sites-available/gowa.example.com-le-ssl.conf <IfModule mod_ssl.c> <VirtualHost *:443> ServerName gowa.example.com SSLCertificateFile /etc/letsencrypt/live/gowa.example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/gowa.example.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf ProxyPreserveHost On RequestHeader set X-Forwarded-Proto "https" ProxyTimeout 600 ProxyBadHeader Ignore ProxyPass / http://127.0.0.1:3000/ ProxyPassReverse / http://127.0.0.1:3000/ RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L] ProxyPass /socket.io/ ws://127.0.0.1:3000/socket.io/ ProxyPassReverse /socket.io/ ws://127.0.0.1:3000/socket.io/ </VirtualHost> </IfModule> Kemudian restart apache sudo systemctl restart apache2 Selesai Buka browser dan masukkan domain gowa.example.com