If you use Threema, you probably know of the "Threema Web" feature.
But did you know it's open source?
So what’s Threema Web?
It’s basically a web application, that connects with your phone and allows you to chat on your desktop through the browser. You can see all your chats in the browser as they appear on the phone.
I’m not a fan of the fact that Threema is closed source. But did you know that Threema Web is open source? This means we can host our very own copy! And that’s even officially supported!
Let’s do it!
Getting the source
It’s on GitHub! Awesome!
git clone https://github.com/threema-ch/threema-web.git
Now you’ll want to edit the file
src/config.ts and change
Next we build it with npm (get it with
apt install npm on Debian based systems)!
While in the threema-web folder (root of the repo) run:
npm install --production
Now we wait for it to build. I successfully built it on WSL because I’m evil.
Packing and distributing it
And now we pack it for distribution!
npm run dist
It will take a little while, and in the end it will output to
dist/threema-web-[VERSION].tar.gz which is the archive you’ll want to extract to your “web space”, to self-host Threema Web.
Make sure your web server knows the mime type
.wasm files, as stated in the upstream guide.
Check out (and feel free to use) my own self-hosted copy! I made sure there’s no Cloudflare in between, for privacy. https://threema.sindastra.de/
I also made sure to get an A+ on ssllabs.com.
That’s all there is to it…
But wait! There is more! (Advanced)
If you followed this guide, you should now have your self-hosted version of Threema Web, as seen in the “Result” section above. But that’s just the web application! The SaltyRTC and the STUN / TURN servers are still hosted by Threema. While you can also self-host the those, this is out of the scope of this guide. Maybe if people want to, I could write a guide for that too. Let me know in the comments!
https://threema.sindastra.de/I no longer maintain this version. Please use the official one or self-host!