activemq.org › Handbook › How to run ActiveMQ in Docker
HandbookHow to run ActiveMQ in Docker
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:
| Image | What it is | Newest tags | Use it? |
|---|---|---|---|
apache/activemq | Official ActiveMQ (Classic) image, active | 6.4.0, 6.3.3, 5.19.12 (27 Oct 2026); latest pushed the same day | Yes. Pin a version tag. |
apache/activemq-classic | Earlier name of the ActiveMQ image, archived | 6.2.0 (19 Nov 2025), 5.19.2 (13 Feb 2026) | No. Behind the releases. |
apache/artemis | Official Apache Artemis image (formerly ActiveMQ Artemis), active | 2.57.0 and 2.57.0-alpine (21 Nov 2026) | Yes, if you run Artemis |
apache/activemq-artemis | Earlier name of the Artemis image, archived | 2.44.0 (3 Nov 2025) | No |
rmohr/activemq | Third-party image, not from Apache | 5.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
| Port | Used for | Enabled in the default 6.4.0 config? |
|---|---|---|
| 61616 | OpenWire (the "tcp" connector, used by JMS clients) | Yes |
| 8161 | Web console | Yes |
| 5672 | AMQP | No, commented out |
| 61613 | STOMP | No, commented out |
| 1883 | MQTT | No, commented out |
| 61614 | WebSocket (WS) connector | No, commented out |
| 1099 | JMX MBean server | See 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:
| Variable | Effect |
|---|---|
ACTIVEMQ_CONNECTION_USER | Username for client connections (JMS and other transports). If not set, clients need no username or password. |
ACTIVEMQ_CONNECTION_PASSWORD | Password for that user |
ACTIVEMQ_JMX_USER | Username for the JMX MBean server. If set, the broker accepts remote JMX connections; otherwise only local ones. |
ACTIVEMQ_JMX_PASSWORD | Password for the JMX user |
ACTIVEMQ_WEB_USER | Username for the web console |
ACTIVEMQ_WEB_PASSWORD | Password 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/dataas in the Compose example. - You pulled
apache/activemq-classicand got 6.2.0. That repository is archived. Switch toapache/activemqwith 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
- How to install ActiveMQ on Ubuntu, Windows and macOS
- ActiveMQ ports: defaults and how to change them
- ActiveMQ web console: URL, login and password
- ActiveMQ Artemis vs ActiveMQ Classic: differences and migration
- All handbook guides
Sources
- Docker Hub API: apache/activemq tags hub.docker.com
- Docker Hub API: apache/activemq-classic (archived) hub.docker.com
- ActiveMQ Docker files and README at the 6.4.0 tag (GitHub) github.com
- ActiveMQ 6.4.0 default configuration files (GitHub) github.com
- Apache Artemis documentation: Docker artemis.apache.org
- Docker Hub API: apache/artemis tags hub.docker.com
- Docker Hub API: rmohr/activemq hub.docker.com
- Download ActiveMQ (series status) activemq.apache.org