This guide shows you how to run the WhatsApp-Nextcloud Bridge as a systemd service on Linux.
- Linux system with systemd
- Node.js 18 or higher installed
- Root or sudo access
Create a dedicated user for the bridge:
sudo useradd -r -s /bin/false whatsapp-bridgeClone and install the bridge:
sudo mkdir -p /opt/whatsapp-nextcloud-bridge
sudo git clone https://github.com/QuizzityMC/Whatsapp-Nextcloud-Bridge.git /opt/whatsapp-nextcloud-bridge
cd /opt/whatsapp-nextcloud-bridge
sudo npm install --productionCreate the configuration file:
sudo cp .env.example .env
sudo nano /opt/whatsapp-nextcloud-bridge/.envFill in your configuration values.
sudo chown -R whatsapp-bridge:whatsapp-bridge /opt/whatsapp-nextcloud-bridge
sudo chmod 600 /opt/whatsapp-nextcloud-bridge/.envsudo cp systemd/whatsapp-nextcloud-bridge.service /etc/systemd/system/
sudo systemctl daemon-reloadsudo systemctl start whatsapp-nextcloud-bridgeOn first run, you need to scan the QR code:
sudo journalctl -u whatsapp-nextcloud-bridge -fWait for the QR code to appear in the logs, then scan it with WhatsApp.
Once authenticated and working, enable the service to start on boot:
sudo systemctl enable whatsapp-nextcloud-bridgesudo systemctl status whatsapp-nextcloud-bridgesudo journalctl -u whatsapp-nextcloud-bridge -fsudo systemctl restart whatsapp-nextcloud-bridgesudo systemctl stop whatsapp-nextcloud-bridgesudo systemctl stop whatsapp-nextcloud-bridge
cd /opt/whatsapp-nextcloud-bridge
sudo git pull
sudo npm install --production
sudo systemctl start whatsapp-nextcloud-bridgeCheck the logs:
sudo journalctl -u whatsapp-nextcloud-bridge -n 50Ensure the service user owns the files:
sudo chown -R whatsapp-bridge:whatsapp-bridge /opt/whatsapp-nextcloud-bridgeRemove the session and re-authenticate:
sudo systemctl stop whatsapp-nextcloud-bridge
sudo rm -rf /opt/whatsapp-nextcloud-bridge/session
sudo systemctl start whatsapp-nextcloud-bridge
sudo journalctl -u whatsapp-nextcloud-bridge -fThen scan the QR code again.