## Synapse Set up your domain names. You'll need - example.com (A record) - matrix.example.com (A record or CNAME depending if they are on the same public ip or not) - turn.example.com (CNAME to matrix.example.com) - admin.matrix.example.com (CNAME to matrix.example.com) Open the following ports on your firewall and forward them to the Matrix Server IP. - 80 (TCP) - 443 (TCP/UDP) - 8448 (TCP) - 3478 (TCP/UDP) - 5349 (TCP/UDP) - 49152-65535 (UDP) To init the synapse server, replace the `SYNAPSE_SERVER_NAME` value in the docker compose file to your base domain name (this will become your server name which means you do NOT want to use the matrix.example.com, but instead use example.com) and run `docker compose up synapse` to generate the configuration files. Then remove the `command: generate` and all the environment variables from the synapse service in the compose file. Use `pwgen -s 64 1` to generate a password and set it to the `POSTGRES_PASSWORD` environment variable on the postgres container. Then set go into the caddy directory and replace all domain names in the Caddyfile with your domain names. Go into the cotorun directory and edit the turnserver.conf file. Replace the "realm" with your domain name. Replace the "cert" and "pkey" paths with your domain name for the turn server (caddy will generate the certs for you). Run `pwgen -s 64 1` again to get a new password and set it to the "static-auth-secret" field. Now go into your synapse folder and edit the "homeserver.yaml" file. Remove the current database entry from the file and copy everything from the "homeserver.template" file into it. Set the database password to the one set in the "docker-compose.yml". Change the turn server uris to your turn domain name. Set the "turn_shared_secret" to the value of the "static-auth-secret" in the "turnserver.conf" file. Add "public_baseurl: "https://matrix.yourdomain.com:8448" on the line under "server_name" Now run `docker compose up -d` to start everything. To create your use, run `docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml` and fill in all the values.