Nomploy Nomad Packs

← All packs

ejabberd v0.1.0

Messaging

ejabberd — a robust, scalable XMPP (Jabber) server for real-time chat, group chat (MUC), presence and push, with a web admin. Deployed as a single host-networked Nomad service.

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

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

1 task c2s 5222s2s 5269admin 5280 1 volume image ejabberd/ecs:latest tracks :latest image bumped today
Variables 13
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The ejabberd (ecs) container image. Pin a tag in production.
image = "ejabberd/ecs:latest"

# Host port for client-to-server XMPP (c2s).
c2s_port = 5222

# Host port for server-to-server XMPP (s2s / federation).
s2s_port = 5269

# Host port for the web admin / HTTP API.
admin_port = 5280

# The XMPP virtual host (your Jabber domain).
xmpp_domain = "localhost"

# Admin account username (localpart).
admin_user = "admin"

# Admin account password, registered on first start. CHANGE THIS.
admin_password = "ejabberd_change_me"

# Named volume for the ejabberd database (/home/ejabberd/database).
data_volume = "ejabberd_data"

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

# The task resources.
resources = {
    cpu    = 500
    memory = 512
  }
NameTypeDefaultDescription
job_name string
"ejabberd"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"ejabberd/ecs:latest"
The ejabberd (ecs) container image. Pin a tag in production.
c2s_port number
5222
Host port for client-to-server XMPP (c2s).
s2s_port number
5269
Host port for server-to-server XMPP (s2s / federation).
admin_port number
5280
Host port for the web admin / HTTP API.
xmpp_domain string
"localhost"
The XMPP virtual host (your Jabber domain).
admin_user string
"admin"
Admin account username (localpart).
admin_password set me string
"ejabberd_change_me"
Admin account password, registered on first start. CHANGE THIS.
data_volume string
"ejabberd_data"
Named volume for the ejabberd database (/home/ejabberd/database).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 512
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: ejabberd_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/ejabberd_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/ejabberd_data/_data backup:<bucket>/ejabberd_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

ejabberd

ejabberd is a battle-tested, massively scalable XMPP (Jabber) server. It powers real-time one-to-one and group chat (MUC), presence, push notifications, file transfer, MAM message archiving and more, with a web admin, a rich command API, and support for millions of concurrent users.

This pack runs ejabberd (the official ecs image) as a single host-networked Nomad service.

Deploy

nomad-pack run ejabberd --registry=nomploy \
  --var xmpp_domain=chat.example.com \
  --var admin_password=$(openssl rand -hex 12)

Connect an XMPP client to <node-ip>:5222 (domain = your xmpp_domain), or open the web admin at http://<node-ip>:5280/admin/.

Configuration

Variable Default Description
image ejabberd/ecs:latest Container image (pin a tag in production).
c2s_port 5222 Client-to-server XMPP port.
s2s_port 5269 Server-to-server (federation) port.
admin_port 5280 Web admin / HTTP API port.
xmpp_domain localhost Your XMPP virtual host.
admin_user admin Admin account localpart.
admin_password ejabberd_change_me Admin password (first start) — change this.
data_volume ejabberd_data Volume for the database (/home/ejabberd/database).
resources 500 MHz / 512 MB CPU and memory for the task.

For remote clients and federation, set xmpp_domain to a real domain and publish the matching DNS SRV records. Accounts and message data persist in data_volume.