How To Install Apache ActiveMQ on CentOS 8

Install Apache ActiveMQ on CentOS 8

In this tutorial, we will show you how to install Apache ActiveMQ on CentOS 8. For those of you who didn’t know, Apache ActiveMQ is a free, multi-protocol, Java-based message broker software written in Java. It supports industry-standard protocols that allow communication between separate applications.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step by step install Apache ActiveMQ on CentOS 8 system.

Install Apache ActiveMQ on CentOS 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf clean all
sudo dnf update

Step 2. Installing Java.

Apache ActiveMQ is a Java-based application so Java must be installed in your system:

sudo dnf install java-11-openjdk-devel

Step 3. Download Apache ActiveMQ on CentOS 8.

Download the latest version of ActiveMQ from their official website. You can download it using the following command:


Once downloaded, extract the downloaded file:

tar -xvzf apache-activemq-5.15.12-bin.tar.gz
mv apache-activemq-5.15.12 apache-activemq

Next, create an ActiveMQ user for running the service:

useradd activemq
chown -R activemq:activemq /opt/apache-activemq/

Step 4. Create Apache ActiveMQ Systemd.

We’ll create a Systemd unit file for managing Apache ActiveMQ service:

nano /etc/systemd/system/apache-activemq.service

Add the following lines:

Description=Apache ActiveMQ Messaging Server


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


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

sudo systemctl daemon-reload
systemctl start apache-activemq
systemctl enable apache-activemq

Step 5. Configure Firewall.

You will need to allow port 80 and 8161 through firewalld. You can allow them with the following command:

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

Step 6. Accessing Apache ActiveMQ.

ActiveMQ will be available on HTTP port 8161 by default. Open your favorite browser and navigate to or http://your-server-ip/8161/admin/ and you should be prompted for a username and password. The default is admin/admin

Congratulations! You have successfully installed Apache ActiveMQ on CentOS 8. Thanks for using this tutorial for installing Apache ActiveMQ on CentOS 8 systems. For additional help or useful information, we recommend you to check the official Apache ActiveMQ website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!