I need to host my own Matrix chat server and it appears this may be possible using my Opalstack shared hosting account. There are implementations based on python 3, postgresql, and nginx, apparently.
My plan is to attempt this and document my efforts here. If you have suggestions, I welcome them!
Hosting a Matrix chat server
jeromev I tried the Python implementation and it was very easy to get running.
- Create a new Nginx Proxy Port app to reserve a HTTP port for the server and make a note of the app's port assignment.
- Attach the app to a site.
- SSH to the app's shell user and run the following commands:
cd ~/apps/name_of_app python3 -m venv env pip install --upgrade pip pip install --upgrade setuptools pip install matrix-synapse # use the site domain from step 2 here: SERVERNAME=matrix.domain.com python -m synapse.app.homeserver \ --server-name $SERVERNAME \ --config-path homeserver.yaml \ --generate-config \ --report-stats=yes
- Edit
homeserver.yaml
to set the http port to your app's port (from step 1). - Edit
$SERVERNAME.log.config
to set the log filename to/home/your_shell_user/logs/apps/name_of_app/homeserver.log
- Run the following command to start the instance:
synctl start
At this point your Matrix server will be up and running and accessible via HTTP.
10 days later
- Edited
To upgrade by using pip:
source ~/apps/synapse/env/bin/activate
pip install -U matrix-synapse
to start:
cd ~/apps/synapse
source env/bin/activate
synctl start