Quickly spin up a Synapse + Postgres in Docker for testing.
The Docker implementation of this script is no longer maintained in favor of Podman. See the podman branch.
DO NOT USE IN PRODUCTION
The config generated by this script is intentionally insecure to make testing easier.
$ ./synapse-env-manager.sh help
Usage: /path/to/synapse-env-manager.sh <option>
Options:
admin: Create Synapse admin account (username: admin. password: admin).
delete: Delete the environment, Synapse/Postgres data, and config files.
gendock: Regenerate the Docker Compose file.
genele: Regenerate the Element Web config file.
gensyn: Regenerate the Synapse config and log config files.
help: This help text.
restartall: Restart all containers.
restartele: Restart the Element Web container.
restartsyn: Restart the Synapse container.
setup: Create, edit, (re)start the environment.
stop: Stop the environment without deleting it.
Note: restartall and setup will recreate all containers and remove orphaned
containers. Synapse/Postgres data is not deleted.
Copy config.example.env
to config.env
and edit as needed.
Install yq, docker, and docker-compose if you don't have them.
Run ./synapse-env-manager.sh setup
to generate the environment. This will also generate the needed config files.
The directories postgres
and synapse
and the files docker-compose.yaml
and elementConfig.json
will be created in
the directory where the synapse-env-manager.sh
script is placed. If these already exists, you may loose data stored
in them.
It will take a minute after you create the database for Synapse to start properly as it restarts a few times while Postgres initializes the database.
Use Element Web on http://localhost:10000 or any Matrix client to access Synapse on homeserver URL
http://localhost:8448
.
You can optionally set up Adminer to manage Postgres from your browser. If you enabled this,
the Adminer web ui is accessible at http://localhost:10001/. System: PostgreSQL
. Server: postgres
.
Username/Database: synapse
. Password: password
.