Nomploy Nomad Packs

← All packs

synapse v0.1.0

Messaging

Synapse — the reference Matrix homeserver for secure, decentralized chat. Runs with an embedded SQLite database and auto-generates its config on first start. Deployed as a single host-networked Nomad service.

nomad-pack run synapse --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- synapse

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

2 tasks http 8008 1 volume image matrixdotorg/synapse:latest tracks :latest image bumped today
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run synapse -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "synapse"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Synapse container image. Pin a tag in production.
image = "matrixdotorg/synapse:latest"

# Host port for the Synapse client-server API (HTTP).
port = 8008

# The Matrix server name (SYNAPSE_SERVER_NAME). This becomes part of every user ID (@user:server_name) and CANNOT be changed later — set it to your real domain before first start.
server_name = "localhost"

# Whether to report anonymous usage statistics (SYNAPSE_REPORT_STATS): yes or no.
report_stats = "no"

# Named volume mounted at /data — config, signing keys, media and the SQLite database.
data_volume = "synapse_data"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 500
    memory = 1024
  }
NameTypeDefaultDescription
job_name string
"synapse"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"matrixdotorg/synapse:latest"
The Synapse container image. Pin a tag in production.
port number
8008
Host port for the Synapse client-server API (HTTP).
server_name string
"localhost"
The Matrix server name (SYNAPSE_SERVER_NAME). This becomes part of every user ID (@user:server_name) and CANNOT be changed later — set it to your real domain before first start.
report_stats string
"no"
Whether to report anonymous usage statistics (SYNAPSE_REPORT_STATS): yes or no.
data_volume string
"synapse_data"
Named volume mounted at /data — config, signing keys, media and the SQLite database.
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 1024
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: synapse_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/synapse_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/synapse_data/_data backup:<bucket>/synapse_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

synapse

Synapse — the reference Matrix homeserver for secure, decentralized, end-to-end-encrypted chat. Run your own homeserver and connect with any Matrix client (Element, etc.). This pack runs Synapse with an embedded SQLite database and auto-generates its config on first start.

Single host-networked Nomad service with a persistent data volume.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run synapse --registry=nomploy

Configure

Variable Default Description
port 8008 Client-server API port (Synapse's default).
server_name localhost Set before first start. Your Matrix domain — becomes part of every user ID and cannot change later.
report_stats no Report anonymous usage stats (yes/no).
image matrixdotorg/synapse:latest Container image. Pin a tag in production.
data_volume synapse_data /data — config, keys, media and the SQLite database.
resources { cpu = 500, memory = 1024 } Task resources.

Pick server_name carefully (ideally your real domain) — it's fixed for the life of the server. On first start Synapse generates homeserver.yaml and signing keys into the volume; a prestart init task makes it writable. Create users with register_new_matrix_user (exec into the task). For federation and production, front it with a reverse proxy over TLS and switch to PostgreSQL. Pin the job to the node holding the volume with constraints.