How To Use My Matrix Home Server

Posted on August 19, 2017

Instant messaging services are getting blocked in some totalitarian states. But I still want to speak with my family and friends without being surveilled, so I am self-hosting my own server Matrix.

Configuring it is not difficult. Simply reading the instructions in README is enough to get you going. The only thing I did differently is that I used Let’s Encrypt certificates with nginx and reverse proxied traffic from port 8448 to 8008, which means Synapse (the reference implementation) does not need to run as root. Also remember to open port 8448 in your firewall, for me I had to add a service to /etc/firwalld/services.

Let us get back on track, which is how to actually use Matrix. Firstly you need a client, the most popular one at the moment is Riot. To register an account on my server, you need to specify https://cong.eu:8448 as the servers. An example in the Android app is shown below. Please let me know, using some out-of-band channel, if registration does not work. It may be off to defend against DoS. Finally, you can add my account @kc1212:cong.eu and start chatting!

There are a few issues that still remain. Firstly, I have not configured a TURN server, so VoIP may not work for hosts behind NAT. Secondly, federation does not work due to the way I configured my server, see here and here. A workaround would be to run Synapse directly on port 8448 rather than using nginx reverse proxy. But I have no need to join public channels at the moment so I’ll put this item on hold.

Update (January 1, 2018):

The server is no longer operational.