this post was submitted on 12 Jan 2024
6 points (100.0% liked)

Matrix

3299 readers
4 users here now

An open network for secure, decentralized communication

founded 4 years ago
MODERATORS
 

Hello everyone,

I just got a Pi4b 8gb model and was looking to set up a matrix instance on it.

Right now it would just be for me and a few close friends. Maybe eventually federating to bigger rooms.

Does anyone have any up to date guides on the best way to set this up? Thank you.

UPDATE:

Hello everyone. So after many hours of tinkering, I can confirm you can run Dendrite on the pi4.

I decided to go with the Docker version of Dendrite with Postgresql.

Generally, the official guide got me most of the way through: https://matrix-org.github.io/dendrite/installation

Some important notes I would like to make however, for anyone reading this post in the future:

  1. I used the Raspberry Pi OS-Lite 64 bit.
  2. I used Caddy for a reverse proxy, which I admit I had never heard of. I highly recommend saving yourself from the trouble, if possible and you're new like me, and just edit/use the example configuration rather than try to follow the bits and pieces of the Caddy instructions throughout the rest of the guide.
  3. If you want to use an external storage drive to hold the Matrix/Jetstream storage, for the love of God set it up to automount and change the Docker data directory config to use it BEFORE you actually get the image/container up and running.
  4. Related to point 3, the docker container seems a bit fragile (which is to be expected). Changing file structures, trying to change data directory, database changes, etc. will basically force the Matrix instance to start all over again and you'll have to readd your users, rooms, etc. that you made while testing.
  5. Here is the big one that caused me to nearly rip my hair out before I realized what was going on. I also self-host Nextcloud via Nextcloudpi, which uses ports 80/443. Matrix + Dendrite + Docker use ports 80/443 too. I could not figure out how to get Dendrite to use any other ports, and did not want to learn how to use the reverse proxy just to jankily set it up. So instead I just changed my Nextcloudpi's config files to use different ports.
  6. Some changes to the dendrite.yaml config did not seem to take affect just with a container restart. I had to reboot the entire pi.
  7. Unless you fully own the domain and its dns records (I use the same one I made through NOIP when configuring my nextcloud instance), do not try to make a subdomain such as matrix.your-url.com to redirect matrix traffic. LetsEncrypt did not play well with it.

Having said all of that... Performance seems okay! It's just my wife and I so far, but we can chat, upload 1gb files, voice call, and screen share with virtually no lag. If that changes in the future as we add users and possibly federate, I will update this post.

top 2 comments
sorted by: hot top controversial new old
[โ€“] knfrmity@lemmygrad.ml 2 points 10 months ago* (last edited 10 months ago) (1 children)

I set up my instance with a Docker image and tutorial and it was pretty easy. I've just testing so far, no other users, so I can't comment on performance. I don't think I'll federate either because that can be resource intensive.

I'll link the tutorials I used in a bit.

Edit: Tutorial Links and notes

https://linuxhandbook.com/install-matrix-synapse-docker/

https://fossengineer.com/selfhosting-matrix-synapse-docker/

I read through both of these and referred to the official documentation to set up my instance. It is exposed to the internet through a Cloudflare Zero Trust tunnel - I am not the biggest fan of Cloudflare, but I prefer the tunnel to directly exposing my personal network to the internet. I am also using a Postgres DB on the backend rather than the integrated SQLite engine as I am comfortable with Postgres and it's plug-and-play with my existing DB admin and backup solution.

[โ€“] aspectoffate@lemmy.ml 2 points 10 months ago

Hey sorry, I wasn't able to see this until I switched accounts to Lemmy.ml.

Thank you for the response! I was actually about to use synapse, but I eventually decided to try dendrite since I figured I had nothing to lose with a fresh Pi and worst comes to worst I could just format and start over.

After a few hours of tinkering, I got it to work! I'll update my post.