Tutorials  /  Linux Basics

Install Apache ActiveMQ on CentOS 7: Complete Guide

Ccentron Redaktion · July 2025 ·4 min read ·Linux Basics, Tutorial

Contents

  1. Prerequisites
  2. Step 1: System Update
  3. Step 2: Installing OpenJDK JRE 8
  4. Step 3: Installing Apache ActiveMQ
  5. Step 4: Create a Systemd Service for ActiveMQ
  6. Step 5: Using the Apache ActiveMQ Web Console
  7. Conclusion

Apache ActiveMQ is a widely adopted, open-source platform used for messaging and integration in enterprise-level software solutions.

This guide will walk you through the process of setting up the binary distribution of Apache ActiveMQ on a CentOS 7 system.

Prerequisites

  • A newly deployed CentOS 7 server, assigned the IP address 203.0.113.1.
  • A user account with sudo privileges.
  • Java version 7 or newer must be installed.
OPS

Rather have your server managed?

centron takes care of updates, monitoring and troubleshooting: managed servers from €54.04 per month, run in our own data center in Germany. View managed servers →

Prefer to manage it yourself? Cloud servers from €4.04 per month →

Step 1: System Update

Start by accessing your server via SSH using your sudo user credentials. Proceed to apply all available system updates through the EPEL YUM repository:

Console
sudo yum install epel-release -y
sudo yum update -y
sudo shutdown -r now

Once the system has rebooted, reconnect using the same sudo user account.

Step 2: Installing OpenJDK JRE 8

Apache ActiveMQ 5.x requires Java 7 or above. We'll install OpenJDK 8 JRE using the YUM package manager:

Console
sudo yum install -y java-1.8.0-openjdk

To verify that Java has been installed correctly, run the following command:

Code
java -version

You should see output similar to the following:

Code
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

Next, configure the JAVA_HOME environment variable by executing the following:

Console
echo "JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")" | sudo tee -a /etc/profile
source /etc/profile

Step 3: Installing Apache ActiveMQ

You can download the most recent stable version of Apache ActiveMQ from its official releases page. As of the time this guide was written, version 5.14.3 was the latest available.

Console
cd
wget https://archive.apache.org/dist/activemq/5.14.3/apache-activemq-5.14.3-bin.tar.gz
sudo tar -zxvf apache-activemq-5.14.3-bin.tar.gz -C /opt

To make managing future upgrades easier, it's recommended to create a symbolic link that doesn't depend on the version number:

Console
sudo ln -s /opt/apache-activemq-5.14.3 /opt/activemq

Step 4: Create a Systemd Service for ActiveMQ

You can launch Apache ActiveMQ by executing its script directly:

Console
cd /opt/activemq
sudo ./bin/activemq start

Alternatively, for better control and integration with your system, you can configure it as a Systemd service. First, create the necessary service unit file:

Console
sudo vi /usr/lib/systemd/system/activemq.service

Insert the following content into the file:

Code
[Unit]
Description=activemq message queue
After=network.target

[Service]
PIDFile=/opt/activemq/data/activemq.pid
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
User=root
Group=root

[Install]
WantedBy=multi-user.target

To save and exit in vi, use:

Code
:wq!

Now you can start, stop, or enable ActiveMQ as a service using the following commands:

Console
sudo systemctl enable activemq.service
sudo systemctl start activemq.service
sudo systemctl stop activemq.service

Step 5: Using the Apache ActiveMQ Web Console

Once ActiveMQ is up and running, you can access its web interface.

Start the service:

Console
sudo systemctl start activemq.service

Next, allow access to port 8161 through the firewall:

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

To open the web console, launch a browser and go to:

http://203.0.113.1:8161/admin

The default login credentials are:

  • Username: admin
  • Password: admin

These credentials can be changed by editing the following configuration file:

/opt/activemq/conf/jetty-realm.properties

Apache ActiveMQ is now successfully configured and operational. Thank you for following this tutorial.

Conclusion

By following this step-by-step guide, you have successfully installed and configured Apache ActiveMQ on a CentOS 7 server. You’ve prepared your environment with Java, downloaded and extracted the binary release, and set up ActiveMQ to run as a Systemd service. Additionally, you have enabled web console access, making it easier to monitor and manage your message queue server. This setup lays a solid foundation for building scalable, enterprise-grade messaging solutions using Apache ActiveMQ.

Claim €200 credit

Test your setup on ccloud³

Sign up for ccloud³ and receive €200 starting credit for your project.

centron Redaktion Technical editorial team

The centron editorial team writes guides from day-to-day operations: tested on our own platform, run in our data centre in Hallstadt near Bamberg.

Category Linux Basics
Share
Still have questions?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

Was this tutorial helpful?

Your answer is stored anonymously and helps us improve our tutorials.

Comments

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Get started for free

Sign up and receive €200 credit at centron within your first 60 days.

This promotional offer applies to new accounts only. Available exclusively to businesses.