activemq.org › Handbook › ActiveMQ ports: defaults and how to change them
HandbookActiveMQ ports: defaults and how to change them
ActiveMQ's default port is 61616, used by OpenWire, the broker's native protocol, and the web console runs on port 8161. In the default configuration of ActiveMQ 6.4.0 and 5.19.12, 61616 is the only messaging port that is switched on: the AMQP (5672), STOMP (61613), MQTT (1883) and WebSocket (61614) connectors are present in conf/activemq.xml but commented out.
This page covers ActiveMQ, also called ActiveMQ Classic, and is based on the default configuration files in the 6.4.0 and 5.19.12 release tags of the project's GitHub repository (listed under Sources). The official documentation is at activemq.apache.org.
ActiveMQ default ports
| Port | What uses it | Defined in | On by default (6.4.0, 5.19.12) |
|---|---|---|---|
| 61616 | OpenWire (JMS clients, other brokers) | conf/activemq.xml, connector openwire | Yes, on all interfaces |
| 5672 | AMQP | conf/activemq.xml, connector amqp | No, commented out |
| 61613 | STOMP | conf/activemq.xml, connector stomp | No, commented out |
| 1883 | MQTT | conf/activemq.xml, connector mqtt | No, commented out |
| 61614 | WebSocket (ws://) | conf/activemq.xml, connector ws | No, commented out |
| 8161 | Web console and REST API (HTTP) | conf/jetty-spring.properties (6.4.0), conf/jetty.xml (5.19.x) | Yes, on 127.0.0.1 only |
| 8443 | Web console over HTTPS (6.4.0) | conf/jetty-spring.properties | No (httpsEnabled=false) |
| none | Remote JMX | bin/setenv (6.4.0) | No; a commented example uses 11099 |
The transport connectors in conf/activemq.xml
Every messaging port is a <transportConnector> element inside <transportConnectors>. From the default conf/activemq.xml in ActiveMQ 6.4.0 (the 5.19.12 file has the same five lines):
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/>
<!-- <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/> -->
A few things to read from those lines:
- The scheme picks the protocol.
tcp://is OpenWire;amqp://,stomp://,mqtt://andws://select the other protocols. 0.0.0.0means the connector accepts connections on every network interface, unlike the web console, which is bound to127.0.0.1.- The two options are the file's own denial-of-service guard: at most 1,000 concurrent connections and a 10 MB maximum frame size per connector.
- The extra protocols are off on purpose. A comment in the file says they are disabled to reduce the exposed attack surface, and asks you to enable only the protocols you need, preferring the secured variants (
openwire+ssl,amqp+ssl,stomp+ssl,mqtt+nio+ssl,wss) in production. - Plain 61616 is unencrypted. The comment above the OpenWire line says it is intended for initial testing, and recommends the
ssl://variant in production so that credentials and messages are not sent in cleartext.
If a tutorial tells you the broker answers on 5672 or 61613 straight after installation, check your own conf/activemq.xml: in 6.4.0 and 5.19.12 those connectors stay off until you uncomment them.
What is port 8161?
Port 8161 belongs to the embedded Jetty web server that serves the ActiveMQ web console at /admin and the REST APIs. It is configured separately from the messaging connectors above. In 6.4.0 and 5.19.12 it listens on 127.0.0.1, so it is reachable only from the broker machine until you change the bind address. From conf/jetty-spring.properties in ActiveMQ 6.4.0:
jetty.http.host=127.0.0.1
jetty.ssl.host=127.0.0.1
jetty.http.port=8161
jetty.ssl.port=8443
In 5.19.x the same two values are the host and port properties of the jettyPort bean in conf/jetty.xml.
How do I check that ActiveMQ is listening on a port?
The official getting-started guide uses netstat. On Windows:
netstat -an|find "61616"
From a Unix shell:
netstat -nl|grep 61616
Replace 61616 with 8161, 5672 or any other port to check it. If 61616 is missing, the broker did not start or could not open the port (for example because another process already uses it); the broker log, data/activemq.log, records the startup. If 8161 shows only 127.0.0.1, that is the default loopback binding, not a fault.
How do I change an ActiveMQ port?
- Stop the broker.
- Open
conf/activemq.xmland edit the port inside theuriof the connector you want to move. For example, to move OpenWire to 61626:<transportConnector name="openwire" uri="tcp://0.0.0.0:61626?maximumConnections=1000&wireFormat.maxFrameSize=10485760"/> - To enable another protocol, remove the
<!--and-->around its line and change the port if you need to. - Start the broker and check the port with
netstatas above. - Update every client's broker URL, firewall rule and container port mapping to the new number.
The web console port is changed separately: jetty.http.port in conf/jetty-spring.properties (6.4.0) or the jettyPort bean in conf/jetty.xml (5.19.x).
One port for several protocols
Since ActiveMQ 5.13.0 the auto transport can detect OpenWire, STOMP, AMQP and MQTT on a single port, so all four kinds of client can share one connector. The official example:
<transportConnector name="auto" uri="auto://localhost:5671"/>
There are also auto+ssl, auto+nio and auto+nio+ssl variants. Protocol details are in STOMP and OpenWire and AMQP.
Remote JMX port
No JMX port is opened by default. The default activemq.xml tells the broker not to create its own JMX connector (createConnector="false"), and the 6.4.0 bin/setenv file sets -Dcom.sun.management.jmxremote without a port. The lines that would open a remote JMX port are commented out and use 11099 as the example. See ActiveMQ monitoring before opening one.
Ports in Docker and on Artemis
Running the broker in a container adds port publishing on top of everything above; ActiveMQ in Docker covers the mappings and the console's bind address. Apache Artemis (formerly ActiveMQ Artemis) does not use activemq.xml: it defines listeners as <acceptor> elements in broker.xml, where the default value of the port parameter is also 61616. The differences are covered in ActiveMQ Classic vs Artemis.
The 2006 archive page on configuring transports and the 2006 archive page on the TCP transport show how transports were configured in the project's early years.
Frequently asked questions
What port does ActiveMQ use?
61616 for OpenWire, the native protocol that JMS clients use, plus 8161 for the web console. In the 6.4.0 and 5.19.12 default configuration those are the only ports opened.
What is port 8161 in ActiveMQ?
It is the embedded Jetty web server for the web console at /admin and the REST APIs. By default it listens on 127.0.0.1 only.
Does ActiveMQ listen on 5672 and 61613 by default?
Not in 6.4.0 or 5.19.12. The AMQP (5672), STOMP (61613), MQTT (1883) and WebSocket (61614) connectors are in conf/activemq.xml but commented out; uncomment the ones you need.
How do I check if ActiveMQ is listening on port 61616?
Run netstat -an|find "61616" on Windows or netstat -nl|grep 61616 on Linux and macOS, as the official getting-started guide shows.
How do I change the ActiveMQ port?
Edit the port in the uri of the transportConnector in conf/activemq.xml and restart the broker. The console port is jetty.http.port in conf/jetty-spring.properties (6.4.0) or the jettyPort bean in conf/jetty.xml (5.19.x).
Related guides
- ActiveMQ web console: URL, login and password
- How to install ActiveMQ on Ubuntu, Windows and macOS
- How to run ActiveMQ in Docker
- STOMP protocol explained, with ActiveMQ, RabbitMQ and Python
- AMQP: 0-9-1 vs 1.0, and which brokers speak which
- All handbook guides
From the 2006 archive
The original ActiveMQ documentation on these topics, kept as it was published here in 2004–2007. It describes ActiveMQ 4.x and older.
Sources
- ActiveMQ 6.4.0 default conf/activemq.xml (GitHub) raw.githubusercontent.com
- ActiveMQ 5.19.12 default conf/activemq.xml (GitHub) raw.githubusercontent.com
- ActiveMQ 6.4.0 conf/jetty-spring.properties (GitHub) raw.githubusercontent.com
- ActiveMQ 5.19.12 conf/jetty.xml (GitHub) raw.githubusercontent.com
- ActiveMQ 6.4.0 bin/setenv (GitHub) raw.githubusercontent.com
- ActiveMQ Classic: Getting Started activemq.apache.org
- ActiveMQ Classic: AUTO transport activemq.apache.org
- Apache Artemis: Configuring the Transport artemis.apache.org