My friends are open to leaving Discord which has finally given me a reason to look into Element/Matrix. I found the install instructions and am immediately put off. Is this it? No official docker compose? 😞
Firstly, I wish you the best of luck in your community’s journey away from Discord. This may be a good time to assess what your community needs from a new platform, since Discord targeted various use-cases that no single replacement platform can hope to replace in full. Instead, by identifying exactly what your group needs and doesn’t need, that will steer you in the right direction.
As for Element, bear in mind that their community and paid versions do not exactly target a hobbyist self-hosting clientele. Instead, Element is apparently geared more for enterprise on-premises deployment (like Slack, Atlassian JIRA, Asterisk PBX) and that’s probably why the community version is also based on Kubernetes. This doesn’t mean you can’t use it, but their assumptions about deployments are that you have an on-premises cloud.
Fortunately, there are other Matrix homeservers available, including one written in Rust that has both bare metal and Docker deployment instructions. Note that I’m not endorsing this implementation, but only know of it through this FOSDEM talk describing how they dealt with malicious actors.
As an aside, I have briefly considered Matrix before as a group communications platform, but was put off by their poor E2EE decisions, for both the main client implementation and in the protocol itself. Odd as it sounds, poor encryption is worse than no encryption, because of the false assurance it gives. If I did use Matrix, I would not enable E2EE because it doesn’t offer me many privacy guarantees, compared to say, Signal.
If you’re proficient it’s 30minutes
Something like this for server.
generate config
docker run -it --rm \ -v <your-data-path>:/data \ -e SYNAPSE_SERVER_NAME=<your-public-address-subdomain> \ -e SYNAPSE_REPORT_STATS=no \ matrixdotorg/synapse:v1.136.0 generaterun
docker run -d \ --restart=always \ --name synapse \ -e SYNAPSE_REPORT_STATS=no \ -v <your-data-path>:/data \ -p 8008:8008 matrixdotorg/synapse:v1.136.0register user
docker exec -ti synapse register_new_matrix_user http://localhost:8008/ -c /data/homeserver.yaml -u <username> -p <password> --exists-okProxy it using ex. openresty / nginx
location / { proxy_pass http://127.0.0.1:8008/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_connect_timeout 600; proxy_read_timeout 86400; }For UI if you want element on your domain, download and unpack tar.gz from.
https://github.com/element-hq/element-web/releasesPoint this location to your proxy server ex. openresty / nginx
location / { root /opt/element-v1.11.109; index index.html; }Modify
config.jsoninside/opt/element-v1.11.109to point location to<your-public-address-subdomain>By default it’s using sqlite if you want postgres or other database then modify
homeserver.yamlto use postgresIf you like compose files: https://www.composerize.com/
docker run -it --rm -v <your-data-path>:/data -e SYNAPSE_SERVER_NAME=<your-public-address-subdomain> -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:v1.136.0 generate:name: <your project name> services: synapse: stdin_open: true tty: true volumes: - <your-data-path>:/data environment: - SYNAPSE_SERVER_NAME=<your-public-address-subdomain> - SYNAPSE_REPORT_STATS=no image: matrixdotorg/synapse:v1.136.0 command: generatedocker run -d --restart=always --name synapse -e SYNAPSE_REPORT_STATS=no -v <your-data-path>:/data -p 8008:8008 matrixdotorg/synapse:v1.136.0:name: <your project name> services: synapse: restart: always container_name: synapse environment: - SYNAPSE_REPORT_STATS=no volumes: - <your-data-path>:/data ports: - 8008:8008 image: matrixdotorg/synapse:v1.136.0I don’t like compose files :)
How do you manage your containers?
I have a git repo with some directory convention and bash scripts. Ex stop is just
#!/bin/bash name=synapse docker stop $name docker rm $nameetc. depending on what actions I need to do against container I have bash script for that and if I need to perform same action against other container I just copy paste this file and change name variable. I pull this repo to my containers host and just type ./bin/synapse/stop and I stop synapse.
Hope that makes sense.
Have you considered replace the name with input from stdin? So instead of
name=synapseyou could doname=$1and have one script to use for all containers.yeah but I don’t mind having duplicated scripts, it’s just easier to go to single script and don’t have to worry about everything else, I keep them like
bin/synapse/run,bin/synapse/stop,bin/synapse/logsetc. What I haven’t figured out is better way to keep all ports in one place instead ofports.mdfile but on the other hand it’s not like I have thousands of containers running.it’s not like I have thousands of containers running
I feel you. I have ~20 container files (some are multiple containers in one file, e.g. db and web server) and I seldom have to do changes to them. Once properly configured, I don’t really have to do anything.
12 pages of detailed documentation
Home Gamer: Is this it?
Fair criticism. I just don’t have a lot of free time. I can invest in Element but I wanted to crowd source information to see if it was worth it or if there was an easier way. It doesn’t get much easier than Docker
I was scared off a couple years ago when I attempted to host it myself. I took a break from selfhosting, but now I’m back, and from what I learned in the past, I know now not to torture myself swimming upstream when there are far easier downstream currents to follow.
I’m looking at conduit but I’m currently writing up a doc to plan out the process, and understand it before I actually deploy anything. I don’t want to open ports, don’t need federation and don’t need encryption, since I’ll be using tailscale to host a private server to only members of my tailnet.
I’ll report back, either here or in the main community, because I don’t want to expose ports, rent a VPS or use ansible for a simple private server for less than 10 people.
Element has no gif keyboard just so you’re aware. Huge dealbreaker.
I’ve never encountered a gif keyboard that worked well so no big loss.
I mean, discord gifs work perfectly…and my friends rely HEAVILY it.