First draft for matrix server setup

This commit is contained in:
DrHaid
2026-02-14 15:58:18 +01:00
parent 05acfad916
commit 65d27b0ec0
7 changed files with 135 additions and 1 deletions

2
.env.example Normal file
View File

@@ -0,0 +1,2 @@
DOMAIN=<your-domain.com>
COTURN_AUTH_SECRET=<secret>

View File

@@ -1,3 +1,21 @@
# matrix-server
self-hosted matrix server configuration
## Requirements
### VPS
2GB RAM sollte passen, wenn wir ned ins föderierte Multiversum wollen
- https://www.ionos.de/server/vps
- https://www.hetzner.com/cloud
### Domain
Domain = Server-Name = User-Identity
Namen später ändern heißt: Chatverläufe und User weg...
- https://www.namecheap.com/
## Setup
1. VPS Setup, imo Debian beschde weil light-weight
2. Docker install
3. Clone repo
4. `docker-compose up -d`
5. fertig? kp

7
config/Caddyfile Normal file
View File

@@ -0,0 +1,7 @@
matrix.{$DOMAIN} {
reverse_proxy conduit:6167
}
element.{$DOMAIN} {
reverse_proxy element:80
}

17
config/conduit.toml Normal file
View File

@@ -0,0 +1,17 @@
[global]
server_name = "matrix.${DOMAIN}"
database_backend = "rocksdb"
database_path = "/var/lib/matrix-conduit/"
address = "0.0.0.0"
port = 6167
# Turn on only long enough to create your first accounts
allow_registration = true
allow_federation = false
# TURN configuration
turn_uris = ["turn:${DOMAIN}:3478?transport=udp","turns:${DOMAIN}:5349?transport=tcp"]
turn_secret = ${COTURN_AUTH_SECRET}

View File

@@ -0,0 +1,11 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.${DOMAIN}",
"server_name": "matrix.${DOMAIN}"
}
},
"disable_custom_urls": true,
"disable_guests": true,
"brand": "My Matrix"
}

79
docker-compose.yml Normal file
View File

@@ -0,0 +1,79 @@
version: "3.8"
services:
conduit:
image: matrixconduit/matrix-conduit:latest
container_name: conduit
restart: unless-stopped
volumes:
- conduit_data:/var/lib/matrix-conduit/
- ./config/conduit.toml:/etc/conduit.toml:ro
environment:
DOMAIN: ${DOMAIN}
COTURN_AUTH_SECRET: ${COTURN_AUTH_SECRET}
CONDUIT_CONFIG: /etc/conduit.toml
networks:
- matrix
element:
image: vectorim/element-web:latest
container_name: element
restart: unless-stopped
environment:
- DOMAIN=${DOMAIN}
volumes:
- ./config/element_config.template.json:/app/config.template.json:ro
command: sh -c "envsubst < /app/config.template.json > /app/config.json && /docker-entrypoint.sh"
networks:
- matrix
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
environment:
- DOMAIN=${DOMAIN}
ports:
- "80:80"
- "443:443"
volumes:
- ./config/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
networks:
- matrix
coturn:
image: coturn/coturn:latest
container_name: coturn
restart: unless-stopped
environment:
- DOMAIN=${DOMAIN}
- COTURN_AUTH_SECRET=${COTURN_AUTH_SECRET}
command: >
-n
--log-file=stdout
--external-ip=YOUR_SERVER_PUBLIC_IP
--realm=$$DOMAIN
--use-auth-secret
--static-auth-secret=$$COTURN_AUTH_SECRET
--no-cli
--listening-port=3478
--tls-listening-port=5349
--fingerprint
ports:
- "3478:3478"
- "3478:3478/udp"
- "5349:5349"
- "5349:5349/udp"
- "49152-49200:49152-49200/udp"
networks:
- matrix
volumes:
conduit_data:
caddy_data:
caddy_config:
networks:
matrix:

BIN
docs/note.exe Executable file

Binary file not shown.