mirror of https://github.com/mautrix/docs.git
1.2 KiB
1.2 KiB
WhatsApp bridge setup with systemd
- Create a user for the bridge:
$ sudo adduser --system mautrix-whatsapp --home /opt/mautrix-whatsapp
- Set up the bridge with the normal setup. Make sure you use that user and home directory for the bridge.
- Create a systemd service file at
/etc/systemd/system/mautrix-whatsapp.service
:[Unit] Description=mautrix-whatsapp bridge [Service] Type=exec User=mautrix-whatsapp WorkingDirectory=/opt/mautrix-whatsapp ExecStart=/opt/mautrix-whatsapp/mautrix-whatsapp Restart=on-failure RestartSec=30s # Optional hardening to improve security ReadWritePaths=/opt/mautrix-whatsapp NoNewPrivileges=yes MemoryDenyWriteExecute=true PrivateDevices=yes PrivateTmp=yes ProtectHome=yes ProtectSystem=strict ProtectControlGroups=true RestrictSUIDSGID=true RestrictRealtime=true LockPersonality=true ProtectKernelLogs=true ProtectKernelTunables=true ProtectHostname=true ProtectKernelModules=true PrivateUsers=true ProtectClock=true SystemCallArchitectures=native SystemCallErrorNumber=EPERM SystemCallFilter=@system-service [Install] WantedBy=multi-user.target