Files
wehub-resource-sync 4ce4204b6c
CI / Lint (push) Failing after 2s
CI / Build (push) Has been skipped
SDK CI / PHP SDK (push) Failing after 1s
Split PHP SDK / PHP SDK tests (push) Failing after 1s
CI / Test (push) Failing after 1s
CI / Dashboard (push) Failing after 0s
SDK CI / JavaScript SDK (push) Failing after 0s
SDK CI / Python SDK (push) Failing after 2s
SDK CI / Java SDK (push) Failing after 1s
Split PHP SDK / Mirror sdk/php -> rmyndharis/openwa-php (push) Has been skipped
CI / Test (PostgreSQL migrations) (push) Failing after 7m47s
CI / Docker Build (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:24:08 +08:00

3.7 KiB

Panduan Deployment Docker OpenWA

Panduan ini menjelaskan cara melakukan deployment OpenWA (WhatsApp API Gateway) menggunakan Docker dan Docker Compose.


🚀 Persyaratan Sistem

Sebelum memulai, pastikan server Anda sudah terinstal:

  • Docker (versi 20.10+)
  • Docker Compose (versi 2.0+)

📁 Struktur Konfigurasi

OpenWA menggunakan fitur Profiles di Docker Compose untuk mempermudah orkestrasi layanan tambahan (database, cache, dll) sesuai kebutuhan infrastruktur Anda.

Layanan Utama (Core)

  • openwa-api: Server backend utama REST API OpenWA, sekaligus menyajikan Dashboard web (React UI) pada port yang sama.

Layanan Tambahan (Optional Profiles)

  • postgres: Database PostgreSQL (bawaan docker).
  • redis: Caching layer untuk performa tinggi.
  • minio: Penyimpanan berkas media yang kompatibel dengan Amazon S3.

Langkah Cepat (Development)

Untuk kebutuhan uji coba lokal dengan database bawaan SQLite dan penyimpanan lokal:

# 1. Clone repositori hasil fork Anda
git clone git@github.com:jimmimohtar/OpenWA.git
cd OpenWA

# 2. Jalankan docker compose khusus development
docker compose -f docker-compose.dev.yml up -d

Aplikasi dapat diakses di (Dashboard sudah menyatu dengan API pada port yang sama):

  • Dashboard UI: http://localhost:2785
  • Swagger Docs: http://localhost:2785/api/docs

🏭 Deployment Produksi

1. File Environment (.env)

Salin file .env.example menjadi .env lalu sesuaikan konfigurasi kunci keamanan Anda:

cp .env.example .env

Pastikan untuk mengubah nilai rahasia berikut di dalam .env:

  • API_MASTER_KEY: Kunci keamanan untuk autentikasi API.
  • DATABASE_PASSWORD: Sandi untuk database PostgreSQL (jika dipakai).

2. Memilih Skenario Deployment (Docker Profiles)

Dashboard sudah menyatu ke dalam image API dan disajikan oleh NestJS pada port API (2785), jadi tidak ada lagi profil/container with-dashboard terpisah.

Skenario A: Produksi Minimalis (SQLite + Dashboard)

Cocok untuk VPS resource kecil (RAM 1GB - 2GB):

docker compose up -d

Skenario B: Produksi Menengah (PostgreSQL + Dashboard)

Cocok untuk keandalan data lebih tinggi:

docker compose --profile postgres up -d

Skenario C: Full Stack (PostgreSQL + Redis + S3 MinIO)

Cocok untuk skala enterprise dengan multi-sesi aktif:

docker compose --profile full up -d

⚙️ Variabel Lingkungan Penting (Environment Variables)

Berikut variabel penting yang bisa disesuaikan di .env:

Nama Variabel Nilai Default Deskripsi
API_PORT 2785 Port REST API sekaligus Dashboard UI (disajikan oleh NestJS).
DATABASE_TYPE sqlite Jenis database yang digunakan (sqlite atau postgres).
DATABASE_NAME /app/data/openwa.sqlite Lokasi database SQLite atau nama database PostgreSQL.
ENGINE_TYPE whatsapp-web.js Driver/mesin engine WhatsApp yang digunakan (whatsapp-web.js default, berbasis Chromium; atau baileys, tanpa browser).
SERVE_DASHBOARD true Sajikan Dashboard UI dari port API yang sama. Set false untuk menonaktifkan penyajian static files.
PUPPETEER_HEADLESS true Menjalankan browser WhatsApp secara tersembunyi (hanya berlaku untuk engine whatsapp-web.js).

🔍 Pemeriksaan Status & Diagnostik

Memeriksa apakah kontainer berjalan lancar:

docker compose ps

Melihat log aktivitas sistem OpenWA:

docker compose logs -f openwa-api

Melakukan pembersihan/berhenti:

docker compose down

🤝 Kontribusi

Jika Anda menemukan kendala saat setup menggunakan Docker, silakan ajukan Issue atau Pull Request di repositori ini.