activemq.org › Handbook › How to install ActiveMQ on Ubuntu, Windows and macOS
HandbookHow to install ActiveMQ on Ubuntu, Windows and macOS
To install ActiveMQ on Ubuntu, install Java 17 or newer, download apache-activemq-6.4.0-bin.tar.gz from the official download page, check its SHA-512 checksum, unpack it, and start the broker with bin/activemq console. ActiveMQ ships as a plain archive rather than an OS package: a .tar.gz for Linux, Unix and macOS and a .zip for Windows, so the same steps work on RHEL and other distributions.
This page uses ActiveMQ 6.4.0, the newest release as of 6 December 2026. The official documentation is at activemq.apache.org. This handbook does not host downloads; get ActiveMQ only from the project's download page.
Which version and which Java?
From the ActiveMQ download page:
| Series | Latest | Java | Pick it if |
|---|---|---|---|
| 6.4.x | 6.4.0 (27 Oct 2026) | 17 to 25 | You are installing fresh |
| 6.3.x | 6.3.3 (27 Oct 2026) | 17 to 25 | You are already on 6.3 and want patches only |
| 5.19.x | 5.19.12 (27 Oct 2026) | 11 to 22 | Your applications still use the javax.jms API |
All three series are Active. The 6.2.x and 5.18.x series are Inactive: they no longer receive updates, so do not start new installs on them. The 6.4.0 release page lists Java 17, 21 and 25 as compatible. Version differences are covered on the ActiveMQ versions page.
Download and verify ActiveMQ
The download page offers, per release, apache-activemq-<version>-bin.tar.gz for Unix, Linux and Cygwin, apache-activemq-<version>-bin.zip for Windows, and a source release. Each file has a .sha512 checksum and an .asc signature, and the page says to verify downloads with one of them.
On a server without a browser you can fetch the same files from downloads.apache.org, the Apache distribution server. For 6.4.0, following the verification steps on the download page:
cd /tmp
wget https://downloads.apache.org/activemq/6.4.0/apache-activemq-6.4.0-bin.tar.gz
wget https://downloads.apache.org/activemq/6.4.0/apache-activemq-6.4.0-bin.tar.gz.sha512
sha512sum -c apache-activemq-6.4.0-bin.tar.gz.sha512
To check the signature as well, import the project's KEYS file and verify the .asc, again following the download page:
wget https://downloads.apache.org/activemq/KEYS
wget https://downloads.apache.org/activemq/6.4.0/apache-activemq-6.4.0-bin.tar.gz.asc
gpg --import KEYS
gpg --verify apache-activemq-6.4.0-bin.tar.gz.asc apache-activemq-6.4.0-bin.tar.gz
downloads.apache.org only holds current releases (on 6 December 2026 the ActiveMQ versions there were 5.19.12, 6.2.10, 6.3.3 and 6.4.0). When a newer patch ships, take the new file name from the download page; older versions are on the past releases page it links to.
Install ActiveMQ on Ubuntu and other Linux
1. Install Java
On Ubuntu 24.04, OpenJDK 21 is available as the openjdk-21-jre-headless package (per packages.ubuntu.com); Java 21 is inside the 17 to 25 range for 6.4.x:
sudo apt update
sudo apt install openjdk-21-jre-headless
java -version
On RHEL and other distributions, install an OpenJDK 17, 21 or 25 runtime from the distribution's repositories. The activemq script finds Java through JAVA_HOME or the java command on the PATH.
Ubuntu 24.04 also has an activemq package in its universe repository, but it is version 5.17.6. The 5.17.x series is Inactive on the ActiveMQ download page, so install from the Apache archive instead of apt install activemq.
2. Create a service user and unpack the archive
The ActiveMQ documentation's "Running ActiveMQ as a Unix daemon" section installs under /srv/activemq as a dedicated activemq user, with a current symlink so upgrades only move the link. With the 6.4.0 file name filled in:
sudo useradd -m activemq -d /srv/activemq
cd /srv/activemq
sudo tar zxvf /tmp/apache-activemq-6.4.0-bin.tar.gz
sudo ln -snf apache-activemq-6.4.0 current
sudo chown -R activemq:users apache-activemq-6.4.0
3. Start ActiveMQ from the command line
Run the broker in the foreground first, as the activemq user, so you see any startup errors. The console command is from the getting-started guide and works the same in 6.4.0 and 5.19.x:
sudo -u activemq /srv/activemq/current/bin/activemq console
Stop it with Ctrl-C. The bin/activemq script has these management commands, from the Unix shell script documentation and the script's own help text in 6.4.0:
| Command | What it does |
|---|---|
bin/activemq console | Starts the broker in the foreground |
bin/activemq start | Starts it in the background and saves the process ID in activemq.pid in the data directory |
bin/activemq stop | Stops a background broker; if shutdown does not finish in 30 seconds (configurable) it kills the process |
bin/activemq restart | Stops the running instance, if any, and starts a new one |
bin/activemq status | Checks whether the broker process is running (exit code 0 = up, 1 = down) |
bin/activemq kill | Terminates the instance with SIGKILL |
Script settings such as memory and the user to run as are read from the first file found among /etc/default/activemq, $HOME/.activemqrc and bin/setenv (named bin/env in 5.19.x).
4. Run ActiveMQ as a systemd service
The ActiveMQ documentation describes a SysV init script. On systemd-based distributions you can write a small unit instead. This one is not shipped with ActiveMQ: it runs the same foreground command the official Docker image uses, activemq console, as the activemq user. Save it as /etc/systemd/system/activemq.service:
[Unit]
Description=Apache ActiveMQ
[Service]
Type=simple
User=activemq
ExecStart=/srv/activemq/current/bin/activemq console
Restart=on-failure
[Install]
WantedBy=multi-user.target
Then load it, enable it at boot and start it in one step (commands from the systemctl manual for Ubuntu 24.04):
sudo systemctl daemon-reload
sudo systemctl enable --now activemq
5. Check that the broker is up
- The broker log is in
data/activemq.logunder the installation directory. - Something should be listening on port 61616, ActiveMQ's default port:
netstat -nl | grep 61616. - The web console is at
http://localhost:8161/admin, loginadmin/adminby default. Change it before anyone else can reach the broker (see the web console page).
Two defaults surprise people on a fresh server. First, the console only listens on the loopback address: 6.4.0 sets jetty.http.host=127.0.0.1 in conf/jetty-spring.properties, and a comment there says that exposing it also means widening the client allow-list in conf/jetty/jetty-security.xml and the allowed origins in conf/jolokia-access.xml. Second, only OpenWire on 61616 is enabled; the AMQP, STOMP, MQTT and WebSocket connectors are commented out in conf/activemq.xml. See ActiveMQ ports for each connector.
Install ActiveMQ on Windows
- Install a Java 17 or newer JDK or JRE for 6.x and set the
JAVA_HOMEenvironment variable to its directory, as the getting-started guide requires. - Download
apache-activemq-6.4.0-bin.zipfrom the download page. To check it, runGet-FileHash apache-activemq-6.4.0-bin.zip -Algorithm SHA512in PowerShell and compare the result with the.sha512file. - Extract the ZIP to a folder of your choice, for example
C:\activemq. - Open a Command Prompt, change to that folder and run
bin\activemq start. Start it from the installation directory: ActiveMQ creates its working directories relative to the current directory. Ctrl-C stops it.
To run the broker as a Windows service, ActiveMQ includes the Java Service Wrapper. In 6.4.0 the scripts are in bin\win64: run InstallService.bat and an ActiveMQ service appears in the Services console. It is not started by default, so start it there or set it to start automatically. UninstallService.bat removes it, and the wrapper writes its log to data\wrapper.log. The ActiveMQ documentation notes that the bundled wrapper is an older community release with a 4 GB memory limit on 64-bit systems.
Install ActiveMQ on macOS
Homebrew has an activemq formula, currently at 6.4.0, which pulls in Homebrew's OpenJDK. The formula is maintained by Homebrew, not by the ActiveMQ project; apache-activemq, the name in the ActiveMQ docs, is an alias for it.
brew install activemq
brew services start activemq
The formula's service runs activemq console, and brew services start also registers it to launch at login. Stop it with brew services stop activemq.
Without Homebrew, install a Java 17 or newer JDK, download the .tar.gz, verify it as above and run bin/activemq console from the unpacked folder, exactly as on Linux.
Start and stop ActiveMQ: quick reference
| How it is installed | Start | Stop |
|---|---|---|
| Linux or macOS archive, foreground | bin/activemq console | Ctrl-C |
| Linux or macOS archive, background | bin/activemq start | bin/activemq stop |
| systemd unit (above) | sudo systemctl start activemq | sudo systemctl stop activemq |
| Windows ZIP | bin\activemq start | Ctrl-C |
| Homebrew | brew services start activemq | brew services stop activemq |
For containers, see ActiveMQ in Docker. Once the broker runs, the ActiveMQ tutorial sends your first messages.
Common problems
- "ERROR: Configuration variable JAVA_HOME or JAVACMD is not defined correctly." The script cannot find Java. Set
JAVA_HOME, or make surejavais on thePATHof the user that runs the broker. - The Java version is outside the supported range. The download page lists Java 17 up to 25 for 6.x and Java 11 up to 22 for 5.19.x. Check
java -versionas the user that runs the broker. - The web console works on the server but not from your laptop. It is bound to 127.0.0.1 by default (in 5.19.12 the host is set in
conf/jetty.xml). See the note in step 5 before you open it up. - AMQP, STOMP or MQTT clients get "connection refused". Those connectors are commented out in the default
conf/activemq.xmlof 6.4.0, 6.3.3 and 5.19.12. Uncomment the ones you need and restart. - You installed with apt and got 5.17.6. That is Ubuntu's own package of an Inactive series. Remove it and install the Apache archive.
For history, the 2006 archive page on getting started is at /site/getting-started.html; its instructions are for releases from that time.
Frequently asked questions
How do I install ActiveMQ on Ubuntu?
Install OpenJDK 17 or newer (for example openjdk-21-jre-headless), download apache-activemq-6.4.0-bin.tar.gz from the official download page, check its SHA-512 checksum, unpack it and run bin/activemq console. For a permanent install, run it as a dedicated user under systemd.
How do I start ActiveMQ from the command line?
From the installation's bin directory run ./activemq console to start it in the foreground, or ./activemq start to run it in the background and ./activemq stop to stop it. On Windows, run bin\activemq start from the installation directory.
Which Java version does ActiveMQ need?
The download page lists Java 17 up to 25 for the 6.4.x and 6.3.x series and Java 11 up to 22 for 5.19.x. The 6.4.0 release names Java 17, 21 and 25 as compatible.
Is there an ActiveMQ RPM or apt package?
The Apache download page offers only .tar.gz and .zip archives plus source. Ubuntu 24.04 has its own activemq package, but it is version 5.17.6 from an Inactive series, so install the Apache archive instead.
How do I run ActiveMQ as a Windows service?
Run bin\win64\InstallService.bat from the ActiveMQ folder. The ActiveMQ service then appears in the Windows Services console, where you start it or set it to start automatically. UninstallService.bat removes it.
Related guides
- How to run ActiveMQ in Docker
- ActiveMQ ports: defaults and how to change them
- ActiveMQ web console: URL, login and password
- ActiveMQ version history and latest release
- ActiveMQ tutorial: send and receive your first messages
- 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
- Download ActiveMQ (series, Java versions, verification) activemq.apache.org
- ActiveMQ 6.4.0 release activemq.apache.org
- Getting Started with ActiveMQ activemq.apache.org
- ActiveMQ: Unix Shell Script activemq.apache.org
- ActiveMQ: Java Service Wrapper activemq.apache.org
- ActiveMQ 6.4.0 release files: bin and conf (GitHub) github.com
- Ubuntu packages: activemq in noble (24.04) packages.ubuntu.com
- Homebrew formula: activemq formulae.brew.sh