Apache ActiveMQ
Overview
Apache ActiveMQ Classic is an open-source, multi-protocol Java message broker that implements the JMS API and speaks OpenWire, AMQP, STOMP and MQTT. It moves messages reliably between distributed applications, with durable queues and topics backed by a persistent store.
This SecureAnyCloud image installs ActiveMQ 6.2.6 on OpenJDK 17 at /opt/activemq and runs it as a dedicated activemq system user. An nginx reverse proxy on TCP 80 fronts the Jetty web console, and the KahaDB message store lives on a dedicated Azure data disk.
What you get:
- Apache ActiveMQ Classic 6.2.6 broker on OpenJDK 17 at
/opt/activemq - nginx reverse proxy on
:80in front of the Jetty web console (bound to loopback:8161) - OpenWire
61616, AMQP5672, STOMP61613and MQTT1883transport connectors - A dedicated Azure data disk at
/var/lib/activemqholding the KahaDB persistence store, separate from the OS disk and re-provisioned with every VM - A unique web console password (
ACTIVEMQ_ADMIN_PASSWORD) generated on the first boot of every VM and stored in a root-only file activemq.serviceandnginx.serviceas 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_B2ms (2 vCPU / 8 GiB RAM) is a good starting size for the JVM broker. Scale up for higher message throughput.
Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp for the web console. Put TLS in front of the console before you expose it publicly (see Enabling HTTPS). Also allow the transport ports your clients use (61616 OpenWire, 5672 AMQP, 61613 STOMP, 1883 MQTT) from your application networks.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache ActiveMQ 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.
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:apache-activemq-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name activemq \
--image sac1647283583153:apache-activemq-ubuntu-24-04:default:latest \
--size Standard_B2ms \
--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 activemq --port 80 --priority 1010Step 3 - Connect to your VM
ssh azureuser@<vm-public-ip>Step 4 - Confirm the services are running
systemctl is-active activemq.service nginx.serviceBoth services report active. On first boot, the broker can take a minute or two to start fully while the JVM warms up.
Step 5 - Retrieve your web console password
Your VM generates its own web console password on first boot and writes it to a root-only file. Read the file with sudo:
sudo cat /root/activemq-credentials.txtThe ACTIVEMQ_ADMIN_PASSWORD value is the password. Sign in to the web console as admin with it.
Step 6 - Open the web console
Browse to http://<vm-public-ip>/ and sign in as admin with the password from Step 5.
The ActiveMQ web console lets you browse queues and topics, inspect message counts, send and purge messages, and view broker and connection details.
Step 7 - Verify the broker health
The broker exposes a Jolokia REST endpoint behind the console. Read the broker version to confirm the broker is healthy, replacing <password> with your console password:
PW=<password> curl -s -u admin:$PW -H 'Origin: http://<vm-public-ip>' -H 'Content-Type: application/json' \
-X POST -d '{"type":"read","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","attribute":"BrokerVersion"}' \
'http://<vm-public-ip>/api/jolokia/'The response is JSON with "status":200 and the broker version in value. The Jolokia endpoint accepts only POST and requires a same-origin request, so the Origin header must match the host you are calling.
Step 8 - Send and receive a test message
ActiveMQ ships a producer/consumer CLI. On the VM, send five messages to a queue, then drain them:
DIR=$(ls -d /opt/activemq/apache-activemq-*/);
sudo -u activemq "$DIR/bin/activemq" producer --destination queue://demo.queue --messageCount 5 --brokerUrl tcp://127.0.0.1:61616DIR=$(ls -d /opt/activemq/apache-activemq-*/);
sudo -u activemq "$DIR/bin/activemq" consumer --destination queue://demo.queue --messageCount 5 --brokerUrl tcp://127.0.0.1:61616The producer reports Produced: 5 messages and the consumer reports Received: 5. The queue and its messages persist in the KahaDB store on the dedicated data disk.
Step 9 - Connect from your applications
Point JMS / OpenWire clients at tcp://<vm-public-ip>:61616, AMQP 1.0 clients at amqp://<vm-public-ip>:5672, STOMP clients at <vm-public-ip>:61613, and MQTT clients at <vm-public-ip>:1883. Open the matching NSG ports to your application networks only.
Enabling HTTPS
For production, terminate TLS at nginx with a real domain pointed at the VM's public IP. Install certbot and request a certificate, replacing the domain with your own:
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.example.comBackup and maintenance
The KahaDB persistence store and broker data live on the dedicated data disk at /var/lib/activemq. Snapshot that disk in Azure to back up your durable queues and topics. Keep the OS patched with sudo apt update && sudo apt upgrade. Restart the broker with sudo systemctl restart activemq; it restarts cleanly.
Support
This image is backed by 24/7 SecureAnyCloud support. Contact us by email and chat for help with broker configuration, protocol connectors, clustering, persistence, TLS and backups.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch Apache ActiveMQ 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
Overview
Apache ActiveMQ Artemis is the high-performance, non-blocking message broker from the Apache ActiveMQ project. It implements the JMS 2.0 and Jakarta Messaging APIs and speaks AMQP 1.0, MQTT, STOMP and OpenWire on the wire. JMS applications, AMQP clients, MQTT devices and STOMP clients can all publish and consume messages against one broker.
This SecureAnyCloud image runs Artemis on Amazon EC2 with the Hawtio web management console on port 80 and a unique administrator password generated on first boot.
What you get:
- Artemis installed under
/opt/artemis, with a broker instance at/var/lib/artemis-instanceon a dedicated, independently resizable EBS data volume. The volume holds the broker configuration, the message journal, the paging store and the large message store - A dedicated unprivileged
artemissystem account running the broker under a systemd service that starts it on boot and restarts it on failure - The Hawtio web management console on port 80, served by an nginx reverse proxy in front of the broker's embedded web server on port 8161. The broker requires login by default
- A broker administrator password generated on the first boot of every instance, so two instances launched from the same Amazon Machine Image never share a password. It is written to
/root/apache-activemq-credentials.txtwith mode 0600, so only the root user can read it - A multiplexed acceptor on port 61616 that handles the CORE, OpenWire, AMQP, STOMP and MQTT protocols, plus dedicated listeners for AMQP on 5672, MQTT on 1883 and STOMP on 61613
- 24/7 SecureAnyCloud support
Prerequisites
Before you deploy this image, make sure you have:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network, port 80 for the web console, and the broker acceptor ports (61616, 5672, 1883, 61613) from the networks your messaging clients use
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
Launch the Instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Apache ActiveMQ Artemis.
Select the SecureAnyCloud listing and choose Select, then Continue on the subscription summary.
Pick an instance type of m5.large or larger (the broker is a JVM workload). Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet. Create or select a security group that opens port 22 from your management network, port 80 for the console, and the acceptor ports your clients use. Leave the root volume at the default size or larger.
Select Launch instance. First boot takes approximately one minute after the instance state becomes Running and the status checks pass.
Launch the Instance from the AWS CLI
Run the block below to launch an instance from the SecureAnyCloud Apache ActiveMQ Artemis Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing. Replace <key-name> with your EC2 key pair name and <subnet-id> with your subnet ID. Replace <security-group-id> with a security group that opens ports 22, 80 and the broker acceptor ports as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=activemq-artemis}]'When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name from the EC2 console or with aws ec2 describe-instances.
Connect to Your Instance
Connect over SSH with your key pair and the login user for your operating system variant.
OS variant SSH login user
Ubuntu 24.04 ubuntu
ssh -i <key-name>.pem ubuntu@<public-ip>Retrieve the Broker Administrator Password
Your instance generated its own broker administrator password on first boot. Read it as root:
sudo cat /root/apache-activemq-credentials.txtThe file lists the console URL, the administrator user (artemisadmin) and the generated password, along with the broker acceptor ports. Keep this password somewhere safe.
Sign In to the Web Management Console
The Hawtio web management console is served on port 80. In a browser, open:
http://<instance-public-ip>/The console redirects you to its login page. Sign in as artemisadmin with the password from the credentials file.
After you sign in, the Artemis tab shows the broker status, version and address memory usage. The Queues tab lists every queue on the broker with its routing type, durability and live message counts.
Select a queue's message count to open the message browser, where you can inspect, move, copy or delete individual messages.
Confirm the Broker Is Running
Over SSH, confirm that the broker and the nginx proxy are active and that the acceptor ports are listening:
sudo systemctl is-active artemis nginx
sudo ss -tlnp | grep -E ':(80|8161|61616|5672|1883|61613) 'Both services report active, the console listens on 8161 (proxied by nginx on 80), and the broker acceptors listen on 61616, 5672, 1883 and 61613.
The Broker Acceptors and Protocols
The broker accepts connections on the following ports:
Port Protocols Notes
61616 CORE, OpenWire, AMQP, STOMP, MQTT, HornetQ The default multiplexed acceptor; the JMS / CORE client connects here
5672 AMQP 1.0 Dedicated AMQP listener
1883 MQTT Dedicated MQTT listener for IoT and pub/sub clients
61613 STOMP Dedicated STOMP listener
Point your clients at the instance's address on the relevant port. Authenticate with the administrator user, or create your own users and roles.
For example, a JMS / CORE client uses a broker URL of the form tcp://<instance-public-ip>:61616. An AMQP client connects to amqp://<instance-public-ip>:5672, and an MQTT client connects to tcp://<instance-public-ip>:1883.
Create Queues and Topics
Create addresses, queues and topics in any of three ways:
- Through the web management console, on the Addresses and Queues tabs.
- Automatically, by configuring your client to create the destination on first use (the default for many JMS and AMQP clients).
- Statically, by editing
broker.xmlin the broker instance configuration directory.
The broker instance configuration lives at /var/lib/artemis-instance/etc/. The main broker configuration file is broker.xml; user accounts and roles are in artemis-users.properties and artemis-roles.properties. After editing configuration, restart the broker:
sudo systemctl restart artemisManage Broker Users
The broker ships with one administrator account, artemisadmin, whose password is generated on first boot. To add or reset users, use the Artemis CLI as the artemis service user against the running broker. The user commands prompt for input, so run them interactively over your SSH session rather than in a script.
For example, to add a new user in the amq role, run the artemis user add command from /var/lib/artemis-instance/bin. Follow the prompts, supplying the administrator credentials to connect and the new user's details when asked.
The Data Volume
The broker instance, including the message journal, the paging store and the large message store, lives on a dedicated EBS volume mounted at /var/lib/artemis-instance. This keeps the broker's persistent data off the operating system disk, so you can resize or snapshot the message store independently. Confirm the mount with:
df -h /var/lib/artemis-instanceTo grow the message store, expand the EBS volume in the AWS console, then grow the filesystem on the instance with sudo resize2fs on the underlying device.
Enable HTTPS on the Console
nginx serves the console over plain HTTP on port 80. For production, place the console behind TLS.
Obtain a certificate for your domain, for example a managed certificate on an Application Load Balancer in front of the instance, or Certbot installed on the instance. Then configure nginx to listen on 443 with your certificate and proxy to the console on 8161, exactly as the bundled site does for port 80. Restrict the broker security group so that only your management network can reach the console port.
Backup and Maintenance
Back up the broker by snapshotting the /var/lib/artemis-instance EBS volume, which captures the configuration and the entire message store. Apply operating system security updates with sudo apt-get update && sudo apt-get upgrade, and reboot when a new kernel is installed. The broker and nginx start automatically on boot.
Support
This image is published and supported by SecureAnyCloud. Support covers broker deployment, protocol and acceptor configuration, clustering and high availability, TLS, persistence tuning and JVM administration. Contact SecureAnyCloud through the support channel listed on the AWS Marketplace listing.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Apache ActiveMQ Artemis on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com