How to Install Apache ActiveMQ on CentOS/RHEL 8

ActiveMQ is a popular, open-source, multi-protocol implementation of message-oriented middleware (MOM) with enterprise features written in Java, used to send messages between two applications, or two components inside an application.

It supports a wide range of Cross-Language Clients from Java, C, C++, C#, Ruby, Perl, Python, PHP, and transport protocols such as OpenWire, STOMP, MQTT, AMQP, REST, and WebSockets.

Read Also: How to Install Apache ActiveMQ on Debian 10

Some of its use cases include transactional messaging, clustering and general-purpose async messaging model, web streaming of data, RESTful API to messaging using HTTP, and much more.

In this article, we will explain to you how to install the latest version of Apache ActiveMQ on CentOS 8 and RHEL 8 Linux distribution.

Installing Apache ActiveMQ on CentOS and RHEL 8

To install ActiveMQ, your system must have Java installed on your server. If Java is not installed, you can install it on your system using our How to Install Java on CentOS and RHEL 8 guide.

Once Java is installed, you can proceed further to download the latest version of ActiveMQ or use the following wget command to grab the source package as shown.

# cd /opt
# wget

Now extract the archive file using the tar command and move it into the extracted directory using the cd command as shown.

# tar zxvf apache-activemq-5.16.4-bin.tar.gz
# cd apache-activemq-5.16.4

Now your ActiveMQ package should be installed in the /opt directory and you can view its contents using the ls command.

# ls -l 
ActiveMQ Files
ActiveMQ Files

From the output above, there are some key directories you need to take note of, they include the following:

  • bin – stores the binary file plus other related files.
  • conf – contains the configuration files: the main configuration file activemq.xml, written in XML format.
  • data – stores the PID file as well as log files.
  • docs – contains documentation files.
  • lib – stores library files.
  • webapps – contains the web interface and admin console files.

Running ActiveMQ as a Service Under Systemd

To run ActiveMQ as a service, you need to create an ActiveMQ service unit file under the user called activemq, so start by creating the user using the useradd command as shown.

# useradd activemq

Next, set the correct permissions on the ActiveMQ installation directory and all of its contents belong to the newly created user and group. Besides, confirm that the new permissions are set as follows.

# chown -R activemq:activemq /opt/apache-activemq-5.16.4
# ls -l /opt/apache-activemq-5.16.4/
Setting Permissions on ActiveMQ
Setting Permissions on ActiveMQ

Now create a service unit file for ActiveMQ called activemq.service under /etc/systemd/system/ directory.

# vi /etc/systemd/system/activemq.service

Add the following configuration in the activemq.service file.

Description=Apache ActiveMQ Message Broker



ExecStart=/opt/apache-activemq-5.16.4/bin/activemq start
ExecStop=/opt/apache-activemq-5.16.4/bin/activemq stop


Save the file and close it. Then reload the systemd manager configuration to read the newly created service, using the following command.

# systemctl daemon-reload
Create ActiveMQ Service Unit File
Create ActiveMQ Service Unit File

Next, you can use the systemctl commands to start. enable and check the status of Apache ActiveMQ service as shown.

# systemctl start activemq.service
# systemctl enable activemq.service
# systemctl status activemq.service
Start ActiveMQ Service
Start ActiveMQ Service

By default, the ActiveMQ daemon listens on port 61616 and you can confirm the port using the ss utility as follows.

# ss -ltpn 
Check ActiveMQ Port
Check ActiveMQ Port

Before you can access the ActiveMQ web console, if you have the firewalld service running (which should be by default), you need to open port 8161 which the web console listens on in the firewall, using the firewall-cmd tool as shown.

# firewall-cmd --zone=public --permanent --add-port=8161/tcp
# firewall-cmd --reload

Testing the ActiveMQ Installation

The ActiveMQ web console is used to manage and monitor ActiveMQ via a web browser. To access it open a web browser and point it to the following URL:


You will land on the following web interface.

ActiveMQ Web Console
ActiveMQ Web Console

To start the actual administration of ActiveMQ, log into the admin web console by clicking on the “Manager ActiveMQ broker” link. Alternatively, the following URL will also take you directly to the admin web console login interface.


Then use the default username admin and password admin to log in.

ActiveMQ Admin Login
ActiveMQ Admin Login

The following screenshot shows the web console dashboard, with various features to manage and monitor ActiveMQ.

ActiveMQ Admin Web Console
ActiveMQ Admin Web Console

In this article, we have explained how to install the latest version of Apache ActiveMQ on CentOS 8 and RHEL 8 Linux distribution. If you want to know more information, especially about how to use Apache ActiveMQ, read the official ActiveMQ 5 documentation. Do not forget to send us your feedback via the comment form below.

Tutorial Feedback...
Was this article helpful? If you don't find this article helpful or found some outdated info, issue or a typo, do post your valuable feedback or suggestions in the comments to help improve this article...

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

4 thoughts on “How to Install Apache ActiveMQ on CentOS/RHEL 8”

  1. The wget command to install ActiveMQ didn’t work for me, I used the following instead:

    # wget "" -O apache-activemq-5.15.8-bin.tar.gz


Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.