Deployment guide

ejabberd

Overview

ejabberd is a robust, scalable, open source XMPP (Jabber) server for real-time messaging. It supports one-to-one chat, presence, group chat rooms (MUC), publish-subscribe and server-to-server federation.

This SecureAnyCloud image gives you a private chat server that any standard XMPP client can connect to, with a built-in web admin console for managing virtual hosts, users and rooms. It installs ejabberd 26.04 from the official ProcessOne package, which bundles its own Erlang runtime, and runs it as the dedicated ejabberd system service.

What you get:

  • ejabberd 26.04 installed from the official ProcessOne package and run as the ejabberd system service
  • The built-in Mnesia database (no external database required) on a dedicated Azure data disk at /var/lib/ejabberd. It holds your users, rooms and rosters.
  • The web admin console bound to the loopback connector 127.0.0.1:5280, with nginx on port 80 reverse proxying to it. nginx adds the WebSocket upgrade that the /ws and /bosh endpoints (XMPP over WebSocket and BOSH) require.
  • Port 80 serving an unauthenticated /healthz endpoint for load balancer probes
  • XMPP client-to-server connections on port 5222 (c2s, STARTTLS) and server-to-server federation on port 5269 (s2s)
  • A unique admin account generated on first boot of every VM, the full JID admin@localhost, recorded in a root-only file
  • ejabberd.service and nginx.service as enabled, active systemd units
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a reasonable starting size. Choose a larger size for more concurrent users and rooms.

Configure the network security group (NSG) to allow these inbound ports:

  • 22/tcp from your management network
  • 80/tcp for the web admin, plus 443/tcp if you add TLS
  • 5222/tcp for XMPP clients
  • 5269/tcp for server-to-server federation

The web admin is served over plain HTTP by default. For production, put your own domain and a trusted certificate in front of it (see Maintenance).

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for ejabberd by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then select Review + create and Create. After the VM is created, add inbound rules for 5222 (XMPP clients) and 5269 (federation).

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:ejabberd-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name ejabberd \
  --image sac1647283583153:ejabberd-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name ejabberd --port 80 --priority 1010
az vm open-port --resource-group <your-rg> --name ejabberd --port 5222 --priority 1020
az vm open-port --resource-group <your-rg> --name ejabberd --port 5269 --priority 1030

Step 3 - Connect to your VM

Connect over SSH as the admin user you created (azureuser in the CLI example):

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Run these commands to check both services and the listening ports:

systemctl is-active ejabberd.service nginx.service
sudo -u ejabberd -H /usr/sbin/ejabberdctl status ss -tlnp | grep -E '5222|5269|5280'

Both services report active, and ejabberdctl status reports that the node is started. ejabberd listens on port 5222 for XMPP clients and 5269 for federation. The web admin listens only on the loopback address 127.0.0.1:5280, behind nginx on port 80.

Step 5 - Retrieve your admin password

The first boot of your VM generates a unique ejabberd admin password and writes it to a root-only file. Read it with sudo:

sudo cat /root/ejabberd-credentials.txt

The file contains EJABBERD_ADMIN_JID (the full JID admin@localhost), EJABBERD_PASSWORD and the web admin URL. Store the password somewhere safe. The file is mode 0600 and owned by root, so only an administrator can read it.

The Mnesia database that holds your users and rooms lives on the dedicated Azure data disk mounted at /var/lib/ejabberd.

Step 6 - Confirm the health endpoints

nginx serves an unauthenticated health endpoint for load balancers and probes. It challenges the web admin for authentication. Check both:

curl -s http://localhost/healthz
curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://localhost/healthz
curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://localhost/admin/

/healthz returns ok with HTTP 200 and never requires authentication, so it is safe for an Azure Load Balancer health probe. The web admin at /admin/ returns HTTP 401 until you supply credentials.

Step 7 - Verify authentication from the command line

The web admin uses HTTP Basic Auth with the full JID admin@localhost as the username. The check below sends the correct per-VM password and reaches the console (HTTP 200), then sends a wrong password and is rejected (HTTP 401).

The command embeds your unique password, so run it interactively rather than from a script. Replace <EJABBERD_PASSWORD> with the value of EJABBERD_PASSWORD from Step 5:

curl -s -o /dev/null -w 'correct password -> HTTP %{http_code}\n' \
  -u 'admin@localhost:<EJABBERD_PASSWORD>' http://localhost/admin/
curl -s -o /dev/null -w 'wrong password -> HTTP %{http_code}\n' \
  -u 'admin@localhost:wrong' http://localhost/admin/

The correct per-VM password prints HTTP 200, which means it reached the admin console. The wrong password prints HTTP 401, which means it was rejected.

Step 8 - Sign in to the web admin

Browse to http://<vm-public-ip>/admin/. When the browser shows an HTTP authentication prompt, enter the full JID admin@localhost as the username and the password from Step 5.

You land on the ejabberd Web Admin, which lists your virtual hosts and cluster nodes. From here you manage users, rooms, access rules and server internals.

Step 9 - Open your virtual host

Click the localhost virtual host to see its overview: the number of registered users, online users, shared rosters and the modules serving the host. localhost is the default served domain. To serve a real public domain, see Maintenance.

Every user JID that belongs to this host, for example alice@localhost, is managed under this virtual host.

Step 10 - Register users

Open Users under the virtual host to list existing accounts and register new ones. Enter a username and password to create a JID such as alice@localhost. That user can then sign in from any XMPP client.

You can also register users from the command line:

sudo -u ejabberd -H /usr/sbin/ejabberdctl register alice localhost 'a-strong-password'

Step 11 - Inspect the node

Open the node (for example ejabberd@localhost) to see server internals: the database tables, backend statistics, the running modules and the Erlang virtual machine. Use this page to confirm the Mnesia backend and monitor the health of the node.

Step 12 - Connect an XMPP client

Point any XMPP client at your server, for example Gajim, Conversations, Dino or Pidgin. Sign in with a JID you registered, such as alice@localhost, and the password you set.

Set the connection server or host to the VM's public IP address and use port 5222. The appliance requires STARTTLS on client connections.

ejabberd federates with other servers over port 5269 (server to server). Create group chat rooms from a client that supports Multi User Chat, or manage them from the web admin.

Step 13 - Confirm data lives on the dedicated disk

ejabberd stores its data under /var/lib/ejabberd on the dedicated Azure data disk. This is the Mnesia database that holds your registered users, rooms, rosters and offline messages. The data survives OS changes and the disk can be resized independently. Confirm the mount:

findmnt /var/lib/ejabberd

The mount is backed by a separate Azure data disk that is captured into the image and re-provisioned on every VM.

Maintenance

  • Password. The admin password is set on first boot. To change it, sign in to the web admin, or run sudo -u ejabberd -H /usr/sbin/ejabberdctl change_password admin localhost '<new-password>'.
  • Serve a real domain. The default served XMPP domain is localhost. For production, set your public domain in the hosts: list in /opt/ejabberd/conf/ejabberd.yml, register an admin@<yourdomain> account, add it to the admin ACL, and restart ejabberd.service. Configure DNS SRV records (_xmpp-client._tcp and _xmpp-server._tcp) for federation.
  • TLS and certificates. The appliance serves the web admin over plain HTTP on port 80, and ejabberd generates a self-signed certificate for client STARTTLS. For production, point a DNS name at the VM and obtain a trusted certificate, for example with certbot and Let's Encrypt. List it under certfiles: in ejabberd.yml, and front the web admin with nginx TLS on port 443.
  • Chat rooms (MUC). Multi User Chat is enabled. Create and administer rooms from an XMPP client or the web admin. Rooms and their archives are stored in the Mnesia database on the data disk.
  • Federation. Server-to-server is enabled on port 5269, with STARTTLS optional. Open the port in your NSG to chat with users on other XMPP servers.
  • Upgrades. ejabberd is installed under /opt/ejabberd. Upgrade with the ProcessOne package and restart ejabberd.service. Your data under /var/lib/ejabberd is preserved.
  • Storage. All ejabberd state lives under /var/lib/ejabberd on the data disk. Back up that volume to protect your users, rooms and history.
  • Security patches. Unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch ejabberd XMPP Server on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure