This is an old revision of the document!
Installing the Whatsapp Bridge
su - conduwuit mkdir mautrix-whatsapp cd mautrix-whatsapp wget -O mautrix-whatsapp.zip 'https://mau.dev/mautrix/whatsapp/-/jobs/artifacts/main/download?job=build%20amd64' unzip mautrix-whatsapp.zip
Generate config and edit:
./mautrix-whatsapp -e mv config.yaml /data/conduwuit/mautrix-whatsapp-config.yaml
edit it…
network: displayname_template: "{{or .FullName .BusinessName .PushName .Phone}} (WA)" # This is very important to have usernames instead of phone numbers! database: type: sqlite3-fk-wal uri: file:/data/conduwuit/mautrix-whatsapp.db?_txlock=immediate homeserver: address: https://chat.mydomain.com domain: chat.mydomain.com permissions: # this is probably not needed, but anyway... "*": "relaybot" # non-local users can only see messages "chat.mydomain.com": "full" # full access to all local users "@myself:chat.mydomain.com": "admin" # who can admin the bot backfill: enabled: true # to populate chats with older messages encryption: # Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms. allow: true + double puppeting
Note that backfill is disabled by default, you need to enable it to see older messages. Also note that messages cannot be backfilled for already created rooms, so don't forget to enable backfill before the first start!
Generate the appservice files:
./mautrix-whatsapp -c /data/conduwuit/mautrix-whatsapp-config.yaml -g
This step will create a registration.yaml file that you need to perform the registration of the bridge as an appservice in Conduwuit. Conduwuit is different from Synapse (the most common Matrix server) because the appservice must be registered from the admin chat with the following command:
!admin appservices register << shift+enter >> ``` << shift+enter >> id: whatsapp [ ... copy the content of the appservice.yaml .. ] ``` << enter >>
When you see « shift enter » you need to press those two keys in order to create a new line in the same command. The three ``` (backthicks) are the markdown token to create a code block.
The chat should reply with a message like:
Appservice registered with ID: whatsapp
More details on registering the appservice can be found here.
The whatsappbot user should have been created automatically.
Good! Now you can run the bridge:
/data/daemon/mautrix-whatsapp/mautrix-whatsapp -c /data/conduwuit/mautrix-whatsapp-config.yaml
If all is well, your bridge should be up and running now.
To login into whatsapp you need to:
- Start a chat with whatsappbot:chat.mydomain.com
- type “login qr”
- Scan the QR code with your whatsapp on your phone.
You could install whatsapp on a Android Virtual Emulator, but it's discouraged and could lead to a ban of your account.
Note: if your usernames do not get popupated, you should do a search username in the whatsappbot chat.
Autostart
Since i use OpenRC, simply drop the following script to /etc/init.d:
- /etc/init.d/conduwuit-whatsapp
#!/sbin/openrc-run # Copyright 2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 name="conduwuit whatsapp bridge" description="Conduwuit whatsapp Matrix Bridge" pidfile="/run/conduwuit-whatsapp.pid" command_background=true command="/data/daemons/conduwuit/mautrix-whatsapp/mautrix-whatsapp" command_args="/data/conduwuit/mautrix-whatsapp-config.yaml" command_user="conduwuit:conduwuit" output_log="/var/log/conduwuit/conduwuit-whatsapp.log" output_err="/var/log/conduwuit/conduwuit-whatsapp.log" start_pre() { cd /data/daemons/conduwuit/mautrix-whatsapp } depend() { need net }
Make it executable and add to the proper runlevel:
chmod +x /etc/init.d/conduwuit-whatsapp rc-update add conduwuit-whatsapp default