Tutorials  /  Linux Basics

Install Apache ActiveMQ on CentOS 7: Complete Guide

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

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.
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

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.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren