• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Looking for tutorial/information on how to install Matrix Docker container

David Borrink

Basic Pleskian
Server operating system version
CentOS 7.9
Plesk version and microupdate number
18.0.65
I have a Plesk server with Docker support. I'm kinda green when it comes to Docker use. I'm asking for a little advising to help me get things going.

I see I can find several Matrix Docker containers and I'm asking if anyone has any tutorial information on how to get it to run properly. I found one that is subtitled "matrix-synapse". Once I started the run cycle I get a dialog (see below) and I have a few comments/questions:

1. I know to choose "Automatic Start after system reboot"

2. I have a subdomain "matrix.[MYDOMAIN].com" already set up on my server for this, ready to apply to it. Do I need to apply my domain to the areas listed in the screen shot dialog shown below, or is that another step after I set up. I had hoped to find a video of someone installing Matrix on Docker to see it happening but I haven't been able to find one.

3. It says my data will not be stored in the backup so I'm going to need to choose somewhere to put it in order for my server backups to collect it and save to my remote backups I do to Dropbox. I currently have my domains backing up to Dropbox via the Backup Manager on Plesk, so I'm wondering how I would make this set of data get backed up.

So if someone can point me to a video or tutorial, I'd really appreciate it. I get the impression that Docker containers are incredibly helpful but I haven't had much success in implementing them to try and get a chat server going for my home business use between my family members. So I've actually attempted other services in Docker but it's been a bit challenging to get them to run.

Screenshot 2024-12-07 at 11.06.02 AM.png
 
You might want to use matrixdotorg/synapse instead of hakankuja/matrix since the one from matrixdotorg is more up to date.

Now to your questions. The way the Plesk docker extension does thing is.... stupid. It only just recently added stack (docker-compose) support so you can create stacks within the interface but the way everything is still stupid. You'll be better off doing things through the terminal for the set up process and once everything is done in terms of getting your container going then you can manage the power off and off through the docker extension (or deploy and use portainer).

I'll lay out what I know based off of what is stated in https://hub.docker.com/r/matrixdotorg/synapse but more user friendly. You will need to be connected via SSH for this though as just trying to get this working through the docker extension in plesk alone is not going to help anyone.

So first off, once you've SSH'd into your server and run the following replacing my.matrix.host with your host (matrix.yourhost.com) and if you want change the SYNAPSE_REPORT_STATS to no if you do not want reports sent back to matrix for diag use.

Bash:
docker run -it --rm \
    --mount type=volume,src=synapse-data,dst=/data \
    -e SYNAPSE_SERVER_NAME=my.matrix.host \
    -e SYNAPSE_REPORT_STATS=yes \
    matrixdotorg/synapse:latest generate

Once you're done editing the 2 basics you can now cd into /var/lib/docker/volumes/synapse-data/_data and edit the file with whatever additional configs you want to add. Refer to Configuration Manual - Synapse for configuration options.

Once you're done editing, run the following to start the container

Bash:
docker run -d --name synapse \
    --mount type=volume,src=synapse-data,dst=/data \
    -p 8008:8008 \
    matrixdotorg/synapse:latest

You will now need to make an admin user account and to do this you'll want to run the following to shell into your container and to start the new user process:

Code:
docker exec -it synapse sh
register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml

Follow the prompts for making a new user making sure to type yes when asked if to make it an admin.

Once you're done with that you are done with the CLI and can now switch back to Plesk to finish the rest of the setup.

Go to your sub domain that you've created and make sure you're under the dashboard part because we want to go into Docker Proxy Rules then add a new rule to have port 8008 to 8008, leave the URL alone and make sure synapse is the container selected. You can enable the "Support WebSocket traffic" too.

Once you got those in placed you are all set. You can now use a matrix client to log into your new instance and start inviting people. For making user accounts you can either go through the process above where you SSH into the container and run the register_new_matrix_user or configure it using one of the pluggable modules for the password auth provider or configure a SSO provider (again, refer to User Authentication - Synapse documentation as I am not going this as it's way beyond the scope of Plesk to begin with. If you need any help with the configuration part, you're best bet would be to check the documentation or asking in their github GitHub - element-hq/synapse: Synapse: Matrix homeserver written in Python/Twisted. ).

As for backups: You can refer to Backup Docker Volumes with Duplicati and Docker Compose and skip to the part that talks about docker compose. A lot of it is talking about doing it through command line but you can actually do that through the docker extension in Plesk under Stack and making a new stack. Just paste in the docker compose YAML, edit it accordingly to where you like to store and deploy. You can now configure it to have it backup to any number of locations including dropbox. This won't use Plesk's backup method but this is design to work with docker to begin with. Plus you should be making snapshots and backups of your whole server if it's anything extremely important.

Hope this helps you out and get you going.
 
Wow, scsa. That was a very helpful post. I really appreciate your advising that Docker has its issues on Plesk. That might be why I've had a hard time trying to use it with a couple other chat service attempts. If there are issues with Docker via the Plesk setup, then it obviously makes more sense to use the terminal (which I'm slowly getting better at over time). I was getting the impression that using Docker is like adding plug-ins to a server, but nothing was working. I'm so used to adding plug-ins in Wordpress with ease, and everyone was raving how Docker was so great and I was failing to see any success and wondered what the heck I was doing wrong.

Your description sounds so do-able and it made sense, and helps me see that it is only a few steps and it's ready. I really appreciate the tips on getting it connected to my domain and what I'd need to do for backup. I do have my server backing up to a separate drive on the machine it's on, plus to Dropbox, so I do have a double backup of the whole thing. That actually means by default I'd have the setup backed up in two place already.

I'll give this a try in a few days when I get the time available to give it a run. I'm planning on using it as a chat communications tool via Thunderbird between my family over all three of our desktops.
 
Back
Top