Independent ActiveMQ handbook · archive of the 2004–2007 project site
Independent guide. Not the Apache ActiveMQ project site and not affiliated with the Apache Software Foundation. ActiveMQ and Apache are trademarks of the ASF. Official documentation: activemq.apache.org.

activemq.org › Handbook › How to run ActiveMQ in Docker

Handbook

How to run ActiveMQ in Docker

Checked against ActiveMQ Classic 6.4.0, 6.3.3 and 5.19.12 and Apache Artemis 2.57.0 on . Independent guide; sources are listed at the end. Official documentation: activemq.apache.org and artemis.apache.org.

The official ActiveMQ Docker image is apache/activemq on Docker Hub, built from the Docker files in the apache/activemq repository. Start the newest release with docker run --detach --name activemq -p 61616:61616 -p 8161:8161 apache/activemq:6.4.0; clients then connect to tcp://localhost:61616.

Many tutorials still point at apache/activemq-classic. That image lags the releases: when checked on 6 December 2026 its newest tags were 6.2.0 (pushed 19 November 2025) and 5.19.2 (13 February 2026), Docker Hub marked the repository as archived, and the 6.2.x series it carries is Inactive with no further updates. The apache/activemq repository, by contrast, had 6.4.0, 6.3.3 and 5.19.12 tags, all pushed on 27 October 2026, the day those versions were released. The official documentation is at activemq.apache.org and artemis.apache.org.

Which ActiveMQ Docker image should you use?

Status, tags and dates from the Docker Hub API, checked on 6 December 2026:

ImageWhat it isNewest tagsUse it?
apache/activemqOfficial ActiveMQ (Classic) image, active6.4.0, 6.3.3, 5.19.12 (27 Oct 2026); latest pushed the same dayYes. Pin a version tag.
apache/activemq-classicEarlier name of the ActiveMQ image, archived6.2.0 (19 Nov 2025), 5.19.2 (13 Feb 2026)No. Behind the releases.
apache/artemisOfficial Apache Artemis image (formerly ActiveMQ Artemis), active2.57.0 and 2.57.0-alpine (21 Nov 2026)Yes, if you run Artemis
apache/activemq-artemisEarlier name of the Artemis image, archived2.44.0 (3 Nov 2025)No
rmohr/activemqThird-party image, not from Apache5.15.9 (last updated 3 Jul 2019)No

Pin a version tag such as 6.4.0 rather than latest, so pulling a new image never changes your broker version without you noticing.

Run the official ActiveMQ image

The docker run options follow the Artemis Docker guide's example; ports and variables come from the Docker README in the apache/activemq repository (assembly/src/docker):

docker run --detach --name activemq \
  -p 61616:61616 -p 8161:8161 \
  apache/activemq:6.4.0

At the 6.4.0 tag, the Dockerfile builds on the Eclipse Temurin 25 JRE, installs ActiveMQ in /opt/apache-activemq, runs as an activemq user and starts the broker with activemq console in the foreground. Follow the log with docker logs -f activemq and stop it with docker stop activemq.

Reaching the web console from your machine

The console's default login in 6.x is admin/admin, from conf/users.properties. The broker binds the console to 127.0.0.1 by default; the image's entrypoint script adds -Djetty.host=0.0.0.0, with a comment saying this makes the console accessible from outside the container.

The 6.4.0 and 6.3.3 configurations add a second gate. The comment in 6.4.0's conf/jetty-spring.properties says that exposing the console also means widening the client allow-list in conf/jetty/jetty-security.xml, which ships with only 127.0.0.1 and ::1, and the allowed origins in conf/jolokia-access.xml. If http://localhost:8161/admin refuses you, mount edited copies of those two files into /opt/apache-activemq/conf/ with -v. Keep the allow-list as narrow as you can and change the default password first. The web console page covers its settings.

Ports

PortUsed forEnabled in the default 6.4.0 config?
61616OpenWire (the "tcp" connector, used by JMS clients)Yes
8161Web consoleYes
5672AMQPNo, commented out
61613STOMPNo, commented out
1883MQTTNo, commented out
61614WebSocket (WS) connectorNo, commented out
1099JMX MBean serverSee ACTIVEMQ_JMX_USER below

The image declares all seven ports, but in the default conf/activemq.xml of 6.4.0, 6.3.3 and 5.19.12 only the OpenWire connector is enabled. To use AMQP, STOMP, MQTT or WebSocket, copy activemq.xml, uncomment the connectors you need, mount it over /opt/apache-activemq/conf/activemq.xml and publish the matching ports. The older apache/activemq-classic:6.2.0 image had all five connectors switched on. More on each port: ActiveMQ ports.

Environment variables

The README documents six variables that the entrypoint script reads:

VariableEffect
ACTIVEMQ_CONNECTION_USERUsername for client connections (JMS and other transports). If not set, clients need no username or password.
ACTIVEMQ_CONNECTION_PASSWORDPassword for that user
ACTIVEMQ_JMX_USERUsername for the JMX MBean server. If set, the broker accepts remote JMX connections; otherwise only local ones.
ACTIVEMQ_JMX_PASSWORDPassword for the JMX user
ACTIVEMQ_WEB_USERUsername for the web console
ACTIVEMQ_WEB_PASSWORDPassword for the web console

The entrypoint also sets the Java heap from ACTIVEMQ_OPTS_MEMORY when it builds ACTIVEMQ_OPTS, defaulting to -Xms64M -Xmx1G. To require a login from clients and change the console password on the 6.4.0 image, using the README's variable names:

docker run --detach --name activemq \
  -p 61616:61616 -p 8161:8161 \
  -e ACTIVEMQ_CONNECTION_USER=app -e ACTIVEMQ_CONNECTION_PASSWORD=change-me \
  -e ACTIVEMQ_WEB_USER=admin -e ACTIVEMQ_WEB_PASSWORD=change-me-too \
  apache/activemq:6.4.0

The console password is only applied when ACTIVEMQ_WEB_USER is also set. In the 6.4.0 and 6.3.3 images the entrypoint also adds a renamed user to the admins group that the console requires. The 5.19.12 entrypoint lacks that step and edits conf/users.properties, but the 5.19.12 console reads its logins from conf/jetty-realm.properties (set in conf/jetty.xml). On 5.19.x images, check whether admin/admin still works after setting the variables, and if it does, mount your own jetty-realm.properties.

Docker Compose example

Adapted from the docker-compose.yml in the apache/activemq repository, which maps all seven ports and runs activemq console. This version uses the published 6.4.0 image, maps two ports and keeps the broker's data in a named volume. ActiveMQ lives in /opt/apache-activemq in the image, and the start script puts its data in the data folder under that directory:

services:
  activemq:
    image: apache/activemq:6.4.0
    ports:
      - "61616:61616"
      - "8161:8161"
    environment:
      ACTIVEMQ_WEB_USER: admin
      ACTIVEMQ_WEB_PASSWORD: change-me
    volumes:
      - activemq-data:/opt/apache-activemq/data

volumes:
  activemq-data:

Run it with docker compose up. Other services in the same Compose file reach the broker by its service name, so a Java client in another container uses tcp://activemq:61616 rather than localhost.

Build your own ActiveMQ image

If you want your configuration baked into the image, build from the project's Dockerfile. At the activemq-6.4.0 tag, assembly/src/docker/Dockerfile takes an activemq_dist build argument that can point to a local directory or tarball. Copy Dockerfile and entrypoint.sh from that folder into an empty directory, add apache-activemq-6.4.0-bin.tar.gz from the official download page (verified as in install ActiveMQ), then:

docker build --build-arg activemq_dist=apache-activemq-6.4.0-bin.tar.gz -t local/activemq:6.4.0 .

The connector and console defaults described above apply to this image as well, so edit conf/activemq.xml and the console files in the unpacked distribution first if you need them changed.

Run Apache Artemis in Docker

If you run Artemis rather than ActiveMQ Classic, use apache/artemis. From the Artemis Docker documentation:

docker run --detach --name mycontainer -p 61616:61616 -p 8161:8161 --rm apache/artemis:latest-alpine

The console is at http://localhost:8161 with the default username and password artemis. The image reads ARTEMIS_USER, ARTEMIS_PASSWORD, ANONYMOUS_LOGIN and EXTRA_ARGS, and keeps its configuration and data in /var/lib/artemis-instance, which you can map to a host folder. Pin apache/artemis:2.57.0 (or 2.57.0-alpine) for repeatable builds. The old apache/activemq-artemis repository's newest tag is 2.44.0; releases from 2.50.0 on are published as apache/artemis. How the two brokers differ is on the ActiveMQ Classic vs Artemis page.

What about rmohr/activemq?

Many older tutorials use rmohr/activemq. It is a third-party image published by the Docker Hub user rmohr, not by Apache. Its newest tag, 5.15.9, was last updated on 3 July 2019, and the 5.15.x series is Inactive on the ActiveMQ download page. Use apache/activemq instead.

Common problems

  • The console at port 8161 does not load or refuses you. Check that 8161 is published and that you open /admin, then see the allow-list note under "Reaching the web console".
  • Another container cannot connect to localhost:61616. Point the client at the broker's Compose service name instead, as in the Compose example (tcp://activemq:61616).
  • STOMP, AMQP or MQTT clients are refused. Publishing the port is not enough on 6.4.0, 6.3.3 or 5.19.12 images: enable the connector in a mounted activemq.xml.
  • Messages disappear after docker rm. The data lived inside the removed container. Mount a volume on /opt/apache-activemq/data as in the Compose example.
  • You pulled apache/activemq-classic and got 6.2.0. That repository is archived. Switch to apache/activemq with a current tag.

To install without containers, see install ActiveMQ.

Frequently asked questions

What is the official ActiveMQ Docker image?

The official image is apache/activemq on Docker Hub, built from the Docker files in the apache/activemq repository. On 6 December 2026 it had tags for the current releases 6.4.0, 6.3.3 and 5.19.12. For Apache Artemis the image is apache/artemis.

Is apache/activemq-classic still maintained?

No. Docker Hub marks apache/activemq-classic as archived, and its newest tags are 6.2.0 and 5.19.2. The 6.2.x series is Inactive, so use apache/activemq with a current version tag instead.

Is rmohr/activemq an official image?

No. rmohr/activemq is a third-party image published by the Docker Hub user rmohr. Its newest tag, 5.15.9, was last updated in July 2019, and the 5.15.x series is Inactive.

How do I change the ActiveMQ web console password in Docker?

Set ACTIVEMQ_WEB_USER and ACTIVEMQ_WEB_PASSWORD when you start the container; the password is only applied when the user variable is also set. On 5.19.x images, check that the new login works, because the 5.19 console reads conf/jetty-realm.properties.

Which ports does the ActiveMQ container use?

The image declares 61616 (OpenWire), 8161 (web console), 5672 (AMQP), 61613 (STOMP), 1883 (MQTT), 61614 (WebSocket) and 1099 (JMX). In the default 6.4.0, 6.3.3 and 5.19.12 configuration only OpenWire is enabled among the messaging connectors.

Related guides

Sources

  1. Docker Hub API: apache/activemq tags hub.docker.com
  2. Docker Hub API: apache/activemq-classic (archived) hub.docker.com
  3. ActiveMQ Docker files and README at the 6.4.0 tag (GitHub) github.com
  4. ActiveMQ 6.4.0 default configuration files (GitHub) github.com
  5. Apache Artemis documentation: Docker artemis.apache.org
  6. Docker Hub API: apache/artemis tags hub.docker.com
  7. Docker Hub API: rmohr/activemq hub.docker.com
  8. Download ActiveMQ (series status) activemq.apache.org