RabbitMQ 4.4 on Ubuntu 26.04 on Azure User Guide
Overview
This guide covers deploying and using RabbitMQ 4.4 on Ubuntu 26.04 LTS from cloudimg on Microsoft Azure.
RabbitMQ is an open source message broker (MPL-2.0) that runs on Erlang/OTP. Producers publish messages to exchanges, the broker routes them into queues, and consumers read from the queues. This image serves AMQP 0-9-1 and AMQP 1.0 over TLS, so any maintained AMQP client library works with it (pika, the Java and .NET clients, amqplib, Bunny and others).
What the cloudimg image adds:
- AMQP over TLS only. Clients reach the broker on 5671 (AMQPS: TLS 1.3 or 1.2 with AEAD cipher suites only). Plain AMQP (5672) is switched off in RabbitMQ's own configuration (
listeners.tcp = none). The MQTT, STOMP, Web-MQTT, Web-STOMP, Stream and Prometheus plugins are not enabled, so nothing answers on those ports even if a network security group allows them. - A certificate made on your virtual machine. At first boot the broker gets a TLS key and an end-entity certificate for this VM's public and private addresses. The certificate cannot sign other certificates. You pin it in your clients (Step 7), or replace it with one from your own CA (Step 14).
- No default account. RabbitMQ's built-in
guestuser is never created. First boot generates two logins unique to your VM: cloudimg-admin, the administrator. It works the console and the HTTP API, but it can use AMQP only from the VM itself.cloudimg-app, an application user. It is confined to thecloudimg-appvirtual host and to queue and exchange names that start withapp..
Only salted password hashes ever reach the broker.
* Erlang distribution kept on the VM. The node is rabbit@localhost. Its peer discovery daemon (epmd, 4369), the inter-node and CLI port (25672) and the CLI tools listen on 127.0.0.1 only. The Erlang cookie, the shared secret that lets a process control the node, is minted on your VM at first boot (Step 12). No two VMs share one.
* A broker that refuses to run unsafely. Before every start a configuration gate refuses an unsafe change (a plain-text listener, a console bound to the network, a non-loopback guest, the ANONYMOUS login mechanism, a refused plugin, Erlang distribution off loopback). After every start a guard checks the running broker's users, passwords, listeners and anonymous access, and stops it if it is unsafe.
* The management console over HTTPS. The console listens on 127.0.0.1 only. nginx serves it on 443 with the same certificate, refuses requests for host names that are not this VM's, and blocks cross-site requests and WebSocket upgrades.
* No telemetry, and no access to the Azure metadata service. RabbitMQ has no telemetry and no metrics plugin is enabled. The broker (with the epmd it starts), nginx and the boot service run with the Azure Instance Metadata Service and the WireServer blocked (Step 13).
* A pinned supply chain. RabbitMQ 4.4.1 and Erlang/OTP 27.3.4.20 come from Team RabbitMQ's signed apt repositories, with the release signing key pinned by fingerprint and every package checked against its signed index. Ubuntu 26.04 LTS is fully patched at build time, with unattended security upgrades left on.
What is on the image:
- RabbitMQ 4.4.1 (the
rabbitmq-serverpackage; configuration in/etc/rabbitmq/, data in/var/lib/rabbitmq/mnesia). - Erlang/OTP 27.3.4.20.
- nginx, the HTTPS front door of the console.
- The cloudimg helpers:
rabbitmq-probe(an AMQP test client),rabbitmq-selfcheck,rabbitmq-config-gate,rabbitmq-guard,cloudimg-set-public-address,rabbitmq-set-hostnameandrabbitmq-install-cert.
Default user: azureuser · Recommended size: Standard_B2s
Prerequisites
- An Azure subscription and an SSH key pair.
- A network security group that allows:
| Port | Protocol | Source | Purpose |
|---|---|---|---|
| 22 | TCP | your admin network | SSH |
| 443 | TCP | your admin network | the management console and HTTP API (HTTPS) |
| 5671 | TCP | the networks your applications connect from | AMQP over TLS (AMQPS) |
Nothing else needs to be open. The broker does not serve 5672, 15672, 4369, 25672, 1883, 61613, 5552, 15692 or 80, so opening them achieves nothing.
Step 1: Choose a VM size
Standard_B2s (2 vCPUs, 4 GB RAM) runs the broker and the console comfortably for development and moderate production traffic. Choose a larger size for many thousands of connections or high sustained message rates. Messages are kept on the OS disk under /var/lib/rabbitmq/mnesia, so give the disk room for the backlog you expect.
Step 2: Deploy from the Azure Portal
- Find RabbitMQ 4.4 on Ubuntu 26.04 LTS by cloudimg in the Azure Marketplace and choose Create.
- Choose your subscription, resource group, region and a size such as Standard_B2s.
- Under Administrator account, choose SSH public key and give the user name
azureuser. - Under Inbound port rules, allow SSH (22) and HTTPS (443). After the VM is created, add a rule for 5671 and narrow every rule to your own address ranges (Step 3 shows the commands).
- Choose Review + create, then Create.
First boot takes about a minute after the VM is running: the boot service reads the VM's addresses from Azure, creates the Erlang cookie, the logins and the certificate, starts the broker and loads the logins, and the guard checks the broker.
Step 3: Deploy from the Azure CLI
Replace the placeholder values with your own before running:
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:rabbitmq-ubuntu-26-04:default:latest
az vm create \
--resource-group my-resource-group \
--name rabbitmq \
--image cloudimg1647283583153:rabbitmq-ubuntu-26-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub \
--public-ip-sku Standard
# Allow the console (443) and AMQPS (5671) from your own networks only, and limit SSH the same way
az network nsg rule create --resource-group my-resource-group --nsg-name rabbitmqNSG \
--name rabbitmq-https-amqps --priority 1010 --direction Inbound --access Allow --protocol Tcp \
--source-address-prefixes <your-cidr> --destination-port-ranges 443 5671
az network nsg rule update --resource-group my-resource-group --nsg-name rabbitmqNSG \
--name default-allow-ssh --source-address-prefixes <your-mgmt-cidr>
Then connect over SSH:
ssh azureuser@<public-address>
The login banner shows where the logins and the certificate are:
RabbitMQ 4.4.1 message broker on Ubuntu 26.04 LTS (cloudimg)
Logins, endpoint, certificate fingerprint: sudo cat /root/rabbitmq-credentials.txt
Clients: AMQPS only, amqps://<this host>:5671 (pin /etc/rabbitmq/tls/rabbitmq.crt); console https://<this host>/
Broker: systemctl status rabbitmq-server journalctl -u rabbitmq-server Verify: sudo rabbitmq-selfcheck
New public IP or DNS name: sudo cloudimg-set-public-address <ip-or-dns-name>
User guide: https://www.cloudimg.co.uk/guides/rabbitmq-4-4-on-ubuntu-26-04-azure/
Step 4: Check the services and the listening set
systemctl is-active rabbitmq-metadata-names rabbitmq-firstboot rabbitmq-server nginx
sudo ss -tlnp | grep -E ':(22|443|1883|4369|5552|5671|5672|15672|15692|25672|61613) '
sudo ss -ulnp | grep -E 'beam|epmd|nginx' || echo 'no UDP socket'
active
active
active
active
LISTEN 0 4096 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=904,fd=3),("systemd",pid=1,fd=255))
LISTEN 0 1024 127.0.0.1:15672 0.0.0.0:* users:(("beam.smp",pid=15960,fd=37))
LISTEN 0 511 0.0.0.0:443 0.0.0.0:* users:(("nginx",pid=15336,fd=5),("nginx",pid=15335,fd=5),("nginx",pid=13409,fd=5))
LISTEN 0 128 127.0.0.1:25672 0.0.0.0:* users:(("beam.smp",pid=15960,fd=19))
LISTEN 0 4096 127.0.0.1:4369 0.0.0.0:* users:(("epmd",pid=16001,fd=3))
LISTEN 0 4096 [::1]:4369 [::]:* users:(("epmd",pid=16001,fd=4))
LISTEN 0 4096 [::]:22 [::]:* users:(("sshd",pid=904,fd=4),("systemd",pid=1,fd=256))
LISTEN 0 128 *:5671 *:* users:(("beam.smp",pid=15960,fd=38))
no UDP socket
The four units:
rabbitmq-metadata-namesreads this VM's addresses from the Azure Instance Metadata Service for the certificate.rabbitmq-firstbootprepares the cookie, the logins and the certificate.rabbitmq-serveris the broker, the Erlang VMbeam.smp.nginxserves the console on 443.
The broker listens on 5671 (AMQPS) on every address. Everything else it opens is on 127.0.0.1 only: the console backend (15672, for nginx), Erlang distribution (25672) and epmd (4369). The versions:
sudo rabbitmq-diagnostics server_version
dpkg-query -W -f='${Package} ${Version}\n' rabbitmq-server erlang-base
Asking node rabbit@localhost for its RabbitMQ version...
4.4.1
erlang-base 1:27.3.4.20-1
rabbitmq-server 4.4.1-1

Step 5: Your endpoint and logins
Everything generated for your VM is in /root/rabbitmq-credentials.txt, which only root can read. View it all with sudo cat /root/rabbitmq-credentials.txt. These lines are not secret:
sudo grep -E '^RABBITMQ_(HOST|AMQPS_ENDPOINT|AMQPS_PORT|MGMT_URL|PRIVATE_IP|ADMIN_USER|APP_USER|APP_VHOST|APP_PREFIX|TLS_CERT_FILE|TLS_CERT_SHA256|TLS_PUBKEY_SHA256)=' /root/rabbitmq-credentials.txt
RABBITMQ_HOST=<public-address>
RABBITMQ_AMQPS_ENDPOINT=amqps://<public-address>:5671
RABBITMQ_AMQPS_PORT=5671
RABBITMQ_MGMT_URL=https://<public-address>/
RABBITMQ_PRIVATE_IP=<private-address>
RABBITMQ_ADMIN_USER=cloudimg-admin
RABBITMQ_APP_USER=cloudimg-app
RABBITMQ_APP_VHOST=cloudimg-app
RABBITMQ_APP_PREFIX=app.
RABBITMQ_TLS_CERT_FILE=/etc/rabbitmq/tls/rabbitmq.crt
RABBITMQ_TLS_CERT_SHA256=57:7D:3A:AF:64:49:5F:84:23:C0:F0:44:D6:67:4C:3C:76:B5:5E:0D:D5:19:91:4C:E6:5E:67:2D:8F:00:28:F1
RABBITMQ_TLS_PUBKEY_SHA256=72df255189b87d9f1a4a37974b430872540bf04ed0b18598a7f93a8d74948414
<public-address> and <private-address> are your VM's own addresses, and the fingerprints are your VM's own. The file also holds RABBITMQ_ADMIN_PASSWORD and RABBITMQ_APP_PASSWORD. It does not hold the Erlang cookie (Step 12).
Give applications the cloudimg-app login or a scoped user of their own (Step 10), never the administrator's. Keep passwords in files with mode 0600, not in shell history or on command lines: every user on a machine can see a command line through ps.

Step 6: Test on the VM
rabbitmq-probe is a small AMQP client. It reads passwords from a file (or from the credentials file with --identity) and trusts only the broker's certificate:
sudo rabbitmq-probe connect --identity app
sudo rabbitmq-probe roundtrip --identity app --queue app.guide-test
sudo rabbitmq-probe declare --identity app --queue orders || true
sudo rabbitmq-probe connect --identity app --vhost / || true
OPEN ok vhost=cloudimg-app tls=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384
ROUNDTRIP OK queue=app.guide-test bytes=56 tls=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384
CHANNEL-CLOSE 403 ACCESS_REFUSED - configure access to queue 'orders' in vhost 'cloudimg-app' refused for user 'cloudimg-app'
REFUSED 530 NOT_ALLOWED - access to vhost '/' refused for user 'cloudimg-app'
These four commands show that the application user logs in over TLS 1.3; that it declares a queue named app.guide-test, publishes a message and reads it back; that it is refused a queue outside app.*; and that it is refused the / virtual host. rabbitmq-probe exits non-zero on a refusal, hence the || true.

Step 7: Check the certificate and pin it in your client
The broker's certificate is self-signed, made on your VM:
sudo openssl x509 -in /etc/rabbitmq/tls/rabbitmq.crt -noout -subject -enddate -ext subjectAltName,basicConstraints
sudo openssl x509 -in /etc/rabbitmq/tls/rabbitmq.crt -noout -fingerprint -sha256
subject=CN=rabbitmq-broker, O=cloudimg
notAfter=Mar 7 01:50:34 2029 GMT
X509v3 Subject Alternative Name:
IP Address:<public-address>, IP Address:<private-address>, IP Address:127.0.0.1, DNS:localhost
X509v3 Basic Constraints: critical
CA:FALSE
sha256 Fingerprint=57:7D:3A:AF:64:49:5F:84:23:C0:F0:44:D6:67:4C:3C:76:B5:5E:0D:D5:19:91:4C:E6:5E:67:2D:8F:00:28:F1
CA:FALSE means it is an end-entity certificate that cannot sign anything else. The SHA-256 fingerprint is the RABBITMQ_TLS_CERT_SHA256 value in your credentials file, and the same certificate is served on 5671 and on 443.
The certificate is public; the private key never leaves the VM. Copy the certificate to each client machine and check its fingerprint against RABBITMQ_TLS_CERT_SHA256 before you trust it:
client-host$ ssh azureuser@<public-address> 'sudo cat /etc/rabbitmq/tls/rabbitmq.crt' > rabbitmq.crt
client-host$ openssl x509 -in rabbitmq.crt -noout -fingerprint -sha256
Then set your client's CA file or trust store to only this file, with host name checking on. Your client will then refuse any other server, including one in the middle that presents a different certificate.
The certificate covers the VM's public and private IPv4 addresses, localhost and 127.0.0.1. If the VM's public address changes (for example, you move it to a new public IP), the certificate is re-issued at the next boot for the new address with the same key: clients that pin the public key (RABBITMQ_TLS_PUBKEY_SHA256) keep working, and clients that pin the certificate file need the new copy. A Standard SKU public IP keeps its address across a stop and start.
Step 8: Connect a client from another machine
On the client machine, put the application password in a file that only you can read, and copy the certificate as in Step 7:
client-host$ umask 077
client-host$ ssh azureuser@<public-address> "sudo sed -n 's/^RABBITMQ_APP_PASSWORD=//p' /root/rabbitmq-credentials.txt" > app.password
This example uses Python and pika (sudo apt-get install python3-pika on Ubuntu, or pip install pika):
# pika_demo.py - publish and consume through your cloudimg RabbitMQ broker over AMQPS (pika 1.x).
# Usage: python3 pika_demo.py <broker-host> <rabbitmq.crt> <user> <password-file> <vhost> <queue>
# The password is read from a file, never the command line; TLS trusts ONLY the broker's own certificate.
import ssl
import sys
import pika
host, cafile, user, pwfile, vhost, queue = sys.argv[1:7]
with open(pwfile) as f:
password = f.read().strip()
ctx = ssl.create_default_context(cafile=cafile) # verify against this one certificate, nothing else
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
params = pika.ConnectionParameters(
host=host, port=5671, virtual_host=vhost,
credentials=pika.PlainCredentials(user, password),
ssl_options=pika.SSLOptions(ctx, server_hostname=host),
)
conn = pika.BlockingConnection(params)
ch = conn.channel()
ch.queue_declare(queue=queue, durable=True)
ch.basic_publish(exchange="", routing_key=queue, body=b"hello from pika",
properties=pika.BasicProperties(delivery_mode=2))
method, props, body = ch.basic_get(queue=queue, auto_ack=True)
print("received:", body.decode())
conn.close()
client-host$ python3 pika_demo.py <public-address> rabbitmq.crt cloudimg-app app.password cloudimg-app app.offhost-pika
received: hello from pika
For <broker-host>, use a name the certificate covers: the public or private address, or your own DNS name once you have added it (Step 14).
The AMQP URL form is amqps://cloudimg-app:<password>@<public-address>:5671/cloudimg-app, and most libraries accept it. Build it inside your program from the password file; do not write it in a configuration file or on a command line.
Step 9: The management console over HTTPS
Open https://<public-address>/ in a browser and sign in as cloudimg-admin with RABBITMQ_ADMIN_PASSWORD. The certificate is self-signed, so the browser warns until you trust rabbitmq.crt or install a certificate from your CA (Step 14).




The HTTP API is served at the same address. On the VM, keep the administrator login in a curl configuration file that only you can read, copy the certificate where your user can read it, and check the API. A request with no login gets 401:
umask 077
sudo cat /etc/rabbitmq/tls/rabbitmq.crt > ~/rabbitmq.crt
printf 'user = "cloudimg-admin:%s"\n' "$(sudo sed -n 's/^RABBITMQ_ADMIN_PASSWORD=//p' /root/rabbitmq-credentials.txt)" > ~/.rabbitmq-admin.curl
api() { curl -sS --cacert ~/rabbitmq.crt -K ~/.rabbitmq-admin.curl "$@"; }
api -o /dev/null -w '%{http_code}\n' https://localhost/api/overview
curl -sS --cacert ~/rabbitmq.crt -o /dev/null -w '%{http_code}\n' https://localhost/api/overview
api https://localhost/api/whoami; echo
200
401
{"name":"cloudimg-admin","tags":["administrator"],"is_internal_user":true}
From another machine, manage the broker over HTTPS on 443 with the console or the HTTP API (https://<public-address>/api/... with --cacert rabbitmq.crt). When you create a user through the API, send the password in a JSON request body read from a 0600 file (--data @file), never in the URL or on the command line.
Step 10: Scoped users and virtual hosts
Give each application its own user, limited to its own virtual host and name prefix, rather than sharing one login. The safe way on the VM is rabbitmqctl with the password on standard input: run rabbitmqctl add_user with only the user name and redirect the password file into it. The password never appears in ps, your shell history or the broker log. Never pass the password as a second argument.
This example sets up a virtual host orders, a user orders-svc with a random password kept in a 0600 file, and permissions limited to names that start with orders.:
umask 077
sudo rabbitmqctl add_vhost orders
openssl rand -base64 30 | tr -d '/+=\n' | head -c 32 > ~/orders-svc.password
sudo rabbitmqctl add_user orders-svc < ~/orders-svc.password
sudo rabbitmqctl set_permissions -p orders orders-svc '^orders\.' '^(orders\..*|amq\.default)?$' '^orders\.'
Adding vhost "orders" ...
Adding user "orders-svc" ...
Password:
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
Setting permissions for user "orders-svc" in vhost "orders" ...
The write pattern also allows amq.default, the default exchange, so the application can publish straight to its own queues by name. Try the new user:
sudo rabbitmq-probe roundtrip --user orders-svc --password-file ~/orders-svc.password --vhost orders --queue orders.created
sudo rabbitmq-probe declare --user orders-svc --password-file ~/orders-svc.password --vhost orders --queue app.x || true
sudo rabbitmq-probe connect --user orders-svc --password-file ~/orders-svc.password --vhost cloudimg-app || true
ROUNDTRIP OK queue=orders.created bytes=56 tls=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384
CHANNEL-CLOSE 403 ACCESS_REFUSED - configure access to queue 'app.x' in vhost 'orders' refused for user 'orders-svc'
REFUSED 530 NOT_ALLOWED - access to vhost 'cloudimg-app' refused for user 'orders-svc'
To rotate the password, use the same standard-input form:
umask 077
openssl rand -base64 30 | tr -d '/+=\n' | head -c 32 > ~/orders-svc.password.new
sudo rabbitmqctl change_password orders-svc < ~/orders-svc.password.new && mv ~/orders-svc.password.new ~/orders-svc.password
sudo rabbitmq-probe connect --user orders-svc --password-file ~/orders-svc.password --vhost orders
Changing password for user "orders-svc" ...
Password:
OPEN ok vhost=orders tls=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384
Hand ~/orders-svc.password to the application's secret store. To remove the example again, with the curl login file and the certificate copy from Step 9:
sudo rabbitmqctl delete_user orders-svc
sudo rabbitmqctl delete_vhost orders
shred -u ~/orders-svc.password 2>/dev/null || true
shred -u ~/.rabbitmq-admin.curl
rm -f ~/rabbitmq.crt
Deleting user "orders-svc" ...
Deleting vhost "orders" ...
The broker enforces these rules whatever you change: no user may be called guest; no user may have the password guest, an empty password, a common default or its own name; and cloudimg-admin can use AMQP only from the VM itself (loopback_users).
Step 11: The broker refuses to run unsafely
rabbitmq-server.service runs rabbitmq-config-gate before every start and rabbitmq-guard after it. Check both, and the whole VM, at any time:
sudo rabbitmq-config-gate --unit && echo gate-ok
sudo rabbitmq-selfcheck | tail -n 1
rabbitmq-config-gate: OK (unit)
gate-ok
SELFCHECK OK
The gate runs before every start. It refuses:
- in
/etc/rabbitmq/rabbitmq.confor aconf.d/*.conffile: a plain-text listener (listeners.tcp.*, or a plugin's plain port off loopback), a console bound to the network, a non-loopbackguest, the ANONYMOUS mechanism, a TLS version below 1.2, or an external authentication backend; - an
advanced.configfile; - in
enabled_plugins: a plugin whose plain-text listener would be public. MQTT, STOMP and Stream need their plain listener set tononeor to a127.0.0.1address (use their TLS listener for the network). Web-MQTT, Web-STOMP and Prometheus need their HTTP listener on127.0.0.1. The gate also refuses the LDAP, HTTP and OAuth 2 authentication backends, peer discovery (clustering) and message tracing; - changes to
rabbitmq-env.conf(the loopback-only Erlang distribution).
If the gate refuses a change, the broker does not start, and journalctl -u rabbitmq-server shows the reason.
The guard runs after every start. It stops the broker if it has a user called guest, a user with a weak password or no password, a management API that answers without a login, or any listener other than the expected set.
rabbitmq-selfcheck prints one ok: line per area and ends with SELFCHECK OK. The areas are the units, the gate and the guard, the Erlang cookie, the listening set, the certificate, round trips, refusals, the console and the metadata block.
Step 12: Why 5672, 15672, epmd and 25672 are closed, and the Erlang cookie
By default RabbitMQ serves plain AMQP on 5672 and the HTTP console on 15672, both without TLS, and epmd on 4369 and Erlang distribution on 25672 on every address. Its first start also creates guest / guest. On a cloud VM that means passwords and messages in clear text, a well-known login, and a node that anyone holding the cookie can control over the network. This image closes each of these in RabbitMQ's own configuration, not with a firewall:
- 5672 (AMQP) is off. Use AMQPS on 5671; every maintained AMQP client supports TLS.
- 15672 (HTTP console and API) is bound to
127.0.0.1for nginx only. Usehttps://<host>/on 443. - 4369 (epmd) and 25672 (Erlang distribution) are bound to
127.0.0.1, set in/etc/rabbitmq/rabbitmq-env.conf. The node israbbit@localhost. Only processes on this VM can reach it, which is whatrabbitmqctlneeds. This image is a single node; clustering would need distribution on the network, and the gate refuses that. - MQTT (1883), STOMP (61613), Stream (5552) and Prometheus (15692) are not enabled.
epmd -names
sudo stat -c '%n %a %U:%G %s bytes' /var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq
epmd: up and running on port 4369 with data:
name rabbit at port 25672
/var/lib/rabbitmq/.erlang.cookie 400 rabbitmq:rabbitmq 64 bytes
/var/lib/rabbitmq 750 root:rabbitmq 4096 bytes
The Erlang cookie is the shared secret that lets an Erlang process join the node or control it with rabbitmqctl. Anyone who has it, and can reach the distribution port, has full control of the broker. On this image the cookie is 256 random bits generated on your VM at first boot (the image ships none); it is readable only by the rabbitmq user (0400), in a home directory that root owns; it is not in the credentials file and you never need to copy it, because sudo rabbitmqctl on the VM reads it for you; and the distribution port is on loopback, so the cookie is useless from another machine. If you delete the cookie, the next boot mints a new one.
Step 13: The Azure metadata block
The Azure Instance Metadata Service (169.254.169.254) hands out the VM's managed identity tokens to any process that asks, and the WireServer (168.63.129.16) serves the VM agent. A broker or web server that could be tricked into fetching a URL must not reach either. These units run with both blocked by systemd (IPAddressDeny): rabbitmq-server (and the epmd daemon it starts in its own control group), nginx and rabbitmq-firstboot. Only rabbitmq-metadata-names, which reads the VM's addresses for the certificate, may reach the metadata service, and it may reach nothing else:
for u in rabbitmq-server nginx rabbitmq-firstboot rabbitmq-metadata-names; do printf '%-24s deny=%s allow=%s\n' "$u" "$(systemctl show -p IPAddressDeny --value "$u")" "$(systemctl show -p IPAddressAllow --value "$u")"; done
rabbitmq-server deny=168.63.129.16/32 ::ffff:168.63.129.16/128 ::ffff:169.254.169.254/128 169.254.169.254/32 allow=
nginx deny=168.63.129.16/32 ::ffff:168.63.129.16/128 ::ffff:169.254.169.254/128 169.254.169.254/32 allow=
rabbitmq-firstboot deny=168.63.129.16/32 ::ffff:168.63.129.16/128 ::ffff:169.254.169.254/128 169.254.169.254/32 allow=
rabbitmq-metadata-names deny=0.0.0.0/0 ::/0 allow=169.254.169.254/32
rabbitmq-selfcheck proves the block from inside the broker's own control group: a request to the metadata service gets no answer, while a request to the VM's own console succeeds. RabbitMQ has no telemetry, and the image enables no plugin that dials out (no Federation, Shovel or Prometheus), so the broker opens no outbound connection.

Step 14: Use your own DNS name or a certificate from your CA
Point a DNS name at the VM's public address, then tell the VM about it:
sudo cloudimg-set-public-address <dns-name>
This re-issues the self-signed certificate, with the same key, to cover the name; pins nginx to the name; updates the endpoint in /root/rabbitmq-credentials.txt; and restarts the broker. Copy the new rabbitmq.crt to clients that pin the certificate file. Run it with no argument to go back to the public IP address Azure reports for the VM. If the VM has no public IP of its own (behind a load balancer, say), the login banner and the credentials file say so, and you give the address the same way.
To use a certificate from your CA (your own, or a public one such as Let's Encrypt), copy the chain (server certificate first) and its unencrypted PEM key to the VM, then run:
sudo rabbitmq-install-cert <certificate-chain.pem> <private-key.pem> <dns-name>
Both endpoints (5671 and 443) then serve your certificate, and clients trust your CA instead of pinning this VM. The boot-time renewal never replaces an installed certificate. To go back to a new self-signed certificate, run sudo rabbitmq-set-hostname <name>.
Logs, files and maintenance
- Logs: the broker:
journalctl -u rabbitmq-serverand/var/log/rabbitmq/; the console front door:journalctl -u nginxand/var/log/nginx/; first boot:journalctl -u rabbitmq-firstboot. - Files: configuration:
/etc/rabbitmq/rabbitmq.conf,/etc/rabbitmq/conf.d/,/etc/rabbitmq/enabled_pluginsand/etc/rabbitmq/rabbitmq-env.conf, all checked by the gate on every start; data:/var/lib/rabbitmq/mnesia; the certificate and key:/etc/rabbitmq/tls/. - Day-to-day commands:
sudo rabbitmqctl list_users,sudo rabbitmqctl list_vhosts,sudo rabbitmqctl list_queues -p cloudimg-app name messagesandsudo rabbitmq-diagnostics status. - Sandbox: the broker runs as the unprivileged
rabbitmquser in a systemd sandbox: no capabilities, a read-only system, a system-call filter and core dumps off. It can write only its data and log directories. - Package updates: nothing is held, so Ubuntu's unattended security upgrades keep applying. RabbitMQ and Erlang come only from Team RabbitMQ's signed repositories, and Erlang is pinned to the 27 series that RabbitMQ 4.4 supports. Upgrade RabbitMQ to a new minor or major version deliberately, following RabbitMQ's upgrade guide and its Erlang version table.
- Backups: export the broker's definitions (users, virtual hosts, queues, exchanges, bindings and policies) with
sudo rabbitmqctl export_definitions /root/rabbitmq-definitions.json(it holds password hashes, so keep it as private as the credentials file), and take Azure disk snapshots or Azure Backup of the VM for message data.
Support
Support by email from cloudimg's team, on hand 24 hours a day, with a guaranteed response within 24 hours: support@cloudimg.co.uk. cloudimg supports the image: launch problems, the first-boot setup, the TLS configuration and the cloudimg helpers. RabbitMQ itself is documented at rabbitmq.com/docs.