When I start the installation of the Matrix container with Docker, the installation goes fine; it tells me that the configuration file is located at /data/homeserver.yaml, but when I return to the root I don’t have a data folder.
Cuando creas un volumen con el comando --mount type=volume,src=synapse-data,dst=/data estás usando un volumen con nombre 'named volume'. Docker guarda estos volúmenes en una ruta gestionada por él, generalmente en /var/lib/docker/volumes/ en Linux. Por eso no ves una carpeta data directamente en tu raíz.
Para ver tus archivos de configuración, como homeserver.yaml, puedes ejecutar docker volume inspect synapse-data para ver la ruta exacta en el host donde Docker está almacenando los datos. Ahí es donde deberías encontrar el archivo homeserver.yaml.
La forma más rápida y limpia de verificar que el archivo existe es ejecutar un contenedor temporal que monte el mismo volumen. Puedes lanzar un comando como docker run -it --rm -v synapse-data:/data alpine ls -l /data para ver el contenido del volumen. Esto debería mostrarte el archivo de configuración.
Si el archivo no existe, tendrás que forzar la regeneración de la configuración.
Thanks for your reply, I admit I’m not yet very accustomed to Docker in general; my installations are done with apt.
Indeed, the file is exactly where you indicated.
It looks like the problem stems from the fact that you're using a Docker volume rather than a regular directory on the system. With the parameter --mount type=volume,src=synapse-data,dst=/data the files are stored inside the synapse-data volume, so you won't simply see them in the /data directory on the VPS.
You can check the volume's contents with the command:
docker volume inspect synapse-data
or enter a temporary container and inspect the files:
docker run --rm -it -v synapse-data:/data alpine sh
ls -la /data
There should be a homeserver.yaml there. If you want to keep the configuration in a normal folder, instead of type=volume you can use a bind mount, e.g. -v /path/on/server:/data. Then the files will be visible directly on the VPS.
With such Docker installations it’s also worth double‑checking that the old volume wasn’t left over from a previous attempt, because the “file already exists” message often points to that. By the way you can find more interesting topics online here: https://vegashero.com.pl/app/. Good luck with configuring Matrix!
Docker runs the processes inside the container with a specific user. When you mount a volume from your host into the container, the files that are created inside that volume from the container take the permissions of the user that creates them. If the Synapse image runs with a specific user (such as 991), and your user on the host is debian, it’s normal that you can’t read those files because the permissions don’t match.
You can add your debian user (or whichever you have) to the group that has access to the volume directory. For example, if the volume is at /var/lib/docker/volumes/synapse-data/_data, you can run:
You can also change the group permissions so that your user can read them. A clean way is to pass the container the UID and GID of your debian user on the host.
Since all this can be a bit overwhelming, I recommend you take a look at this
Alright, I’m starting to get a sense of how Docker works.
I’ll study the topic thoroughly, then I’ll see whether to go with a Docker installation or a classic one.
I imagine the two setups are about the same in terms of installation? From what I’ve read, a classic version is simpler to install but less convenient for ongoing maintenance.
Exactly! In terms of final functionality, the result is the same, i.e., your Matrix server will be running and will work. The difference is the path you choose to get there.
With the classic installation. You install each component (Python, PostgreSQL, the Matrix server, etc…) directly on your VPS’s operating system. The result is a system that works, but all those components are ‘mixed’ with the system.
Installation with Docker. Each service component runs inside its own container, isolated from the operating system. You store the configuration and the data in volumes, which are folders you control and that are independent of the container. Your installation isn’t in the system, but in the docker-compose.yml file and the volumes. The advantage? To update, you just change the image version in the file and run docker-compose up -d. To move everything to another server, copy the file and the volumes. It’s more complex at first, but later maintenance is much cleaner and more predictable
I hope you understand it a bit better. Let us know how it goes.
Sergio Turpín