This is an old revision of the document!
How I Installed matrix-synapse
1. Set your DNS records.
2. Spin up a beefy container.
- RAM: 4 GiB
- Swap: 8 GiB
- Cores: 4
- Root disk space: 180 GiB
3. Install matrix-synapse stable.
Follow this guide.
I found the trickiest bit to be installing the matrix-synapse repositories, which is not very tricky.
sudo apt install -y lsb-release wget apt-transport-https
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
sudo tee /etc/apt/sources.list.d/matrix-org.list
sudo apt update
sudo apt install matrix-synapse-py3
4. Install Postgresql.
They said not to use SQLite in production, so I installed Postgresql inside the server container.
I will migrate it to a separate container later. The trick is that the port is exposed within the proxmox environment, so it should be no different than changing the hostname from something like localhost to matrix-db.pluto.sks.lan etc.
Follow this guide.
5. Final homeserver.yaml configuration.
root@matrix:~# cat /etc/matrix-synapse/homeserver.yaml
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
#
# This is set in /etc/matrix-synapse/conf.d/server_name.yaml for Debian installations.
# server_name: "SERVERNAME"
pid_file: "/var/run/matrix-synapse.pid"
listeners:
- port: 8008
resources:
- compress: false
names:
- client
- federation
- media
- metrics
- static
- health
tls: false
type: http
x_forwarded: true
database:
name: psycopg2
args:
user: XXXXXXXXXXXXXXX
password: XXXXXXXXXXXXXXXXX
dbname: XXXXXXXXXXXXXXXXX
host: localhost
cp_min: 5
cp_max: 10
log_config: "/etc/matrix-synapse/log.yaml"
media_store_path: /var/lib/matrix-synapse/media
signing_key_path: "/etc/matrix-synapse/homeserver.signing.key"
trusted_key_servers:
- server_name: "matrix.org"
macaroon_secret_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
public_baseurl: "https://solarpunk.au/"
serve_server_wellknown: true
enable_registration: true
enable_registration_without_verification: true
registrations_require_3pid:
- email
registration_shared_secret: "XXXXXXXXXXXXXXXXXXX"
allow_public_rooms_over_federation: true
web_client_location: "https://app.element.io/"
allow_public_rooms_without_auth: true
admin_contact: 'mailto:vidak@member.fsf.org'
max_upload_size: 100M
email:
smtp_host: "mail.riseup.net"
smtp_port: 465
smtp_user: "XXXXXXXXXXXXXXXXXXXXXXXXx"
smtp_pass: "XXXXXXXXXXXXXX"
require_transport_security: true
enable_tls: true
force_tls: true
notif_from: "Your Friendly %(app)s homeserver <moraleconomyinitiative@riseup.net>"
app_name: "solarpunk.au matrix server"
enable_notifs: true
notif_for_new_users: false
validation_token_lifetime: 15m
invite_client_location: https://app.element.io
subjects:
message_from_person_in_room: "[%(app)s] You have a message on %(app)s from %(person)s in the %(room)s room..."
message_from_person: "[%(app)s] You have a message on %(app)s from %(person)s..."
messages_from_person: "[%(app)s] You have messages on %(app)s from %(person)s..."
messages_in_room: "[%(app)s] You have messages on %(app)s in the %(room)s room..."
messages_in_room_and_others: "[%(app)s] You have messages on %(app)s in the %(room)s room and others..."
messages_from_person_and_others: "[%(app)s] You have messages on %(app)s from %(person)s and others..."
invite_from_person_to_room: "[%(app)s] %(person)s has invited you to join the %(room)s room on %(app)s..."
invite_from_person: "[%(app)s] %(person)s has invited you to chat on %(app)s..."
password_reset: "[%(server_name)s] Password reset"
email_validation: "[%(server_name)s] Validate your email"