This guide provides comprehensive installation instructions for HiveMQ Community Edition across different platforms and deployment scenarios.
System Requirements
Java Requirements
Runtime : Java 11 or higher is required to run HiveMQ CE
Development : Java 21 or higher is required to build from source and run tests
Verify your Java installation:
If you need to install Java, we recommend Eclipse Temurin (formerly AdoptOpenJDK).
Hardware Requirements
Resource Minimum Recommended CPU 1 core 2+ cores Memory 512 MB RAM 2 GB+ RAM Disk Space 100 MB 1 GB+ (for data persistence) Network Port 1883 accessible Multiple ports for TLS/WebSocket
Linux (recommended for production)
macOS
Windows
Docker
Any platform with Java 11+ support
Installation Methods
Binary Package
Docker
Build from Source
Embedded Mode
Download Binary Package This is the recommended method for most users.
Download the Latest Release
Download HiveMQ CE version 2025.5: wget https://github.com/hivemq/hivemq-community-edition/releases/download/2025.5/hivemq-ce-2025.5.zip
Or download manually from the GitHub Releases page .
Extract the Archive
unzip hivemq-ce-2025.5.zip
cd hivemq-ce-2025.5
Expand-Archive - Path hivemq - ce - 2025.5 .zip - DestinationPath .
cd hivemq - ce - 2025.5
Verify Installation
Check the directory structure: You should see:
bin/ - Startup scripts and JAR file
conf/ - Configuration files
data/ - Data persistence directory
extensions/ - Extensions directory
log/ - Log files
Start HiveMQ CE
On Windows, you may need to run the command prompt as Administrator for optimal performance.
Directory Structure hivemq-ce-2025.5/
├── bin/
│ ├── run.sh # Linux/macOS startup script
│ ├── run.bat # Windows startup script
│ ├── diagnostics.sh # Diagnostics tool
│ └── hivemq.jar # Main application JAR
├── conf/
│ ├── config.xml # Main configuration file
│ ├── logback.xml # Logging configuration
│ └── examples/ # Configuration examples
├── data/ # Persistence data (created on first run)
├── extensions/ # Extensions directory
│ └── hivemq-allow-all-extension/ # Default extension
├── log/ # Log files (created on first run)
└── third-party-licenses/ # License information
Docker Installation HiveMQ CE is available as an official Docker image.
Pull the Image
docker pull hivemq/hivemq-ce:latest
For a specific version: docker pull hivemq/hivemq-ce:2025.5
Run HiveMQ CE
Basic usage: docker run --name hivemq-ce -d -p 1883:1883 hivemq/hivemq-ce
Advanced Configuration
With custom configuration and persistent storage: docker run -d \
--name hivemq-ce \
-p 1883:1883 \
-p 8000:8000 \
-v /path/to/conf:/opt/hivemq/conf \
-v /path/to/data:/opt/hivemq/data \
-v /path/to/extensions:/opt/hivemq/extensions \
-e HIVEMQ_LOG_LEVEL=INFO \
hivemq/hivemq-ce
Volume Mounts:
/opt/hivemq/conf - Configuration files
/opt/hivemq/data - Persistent data
/opt/hivemq/extensions - Extensions
/opt/hivemq/log - Log files
Environment Variables:
HIVEMQ_LOG_LEVEL - Set log level (TRACE, DEBUG, INFO, WARN, ERROR)
HIVEMQ_JMX_ENABLED - Enable/disable JMX (default: true)
HIVEMQ_JMX_PORT - JMX port (default: 9010)
Docker Compose Create a docker-compose.yml file: version : '3.8'
services :
hivemq :
image : hivemq/hivemq-ce:2025.5
container_name : hivemq-ce
ports :
- "1883:1883" # MQTT
- "8000:8000" # WebSocket
- "9010:9010" # JMX
environment :
- HIVEMQ_LOG_LEVEL=INFO
volumes :
- ./conf:/opt/hivemq/conf
- ./data:/opt/hivemq/data
- ./extensions:/opt/hivemq/extensions
- ./log:/opt/hivemq/log
restart : unless-stopped
Run with: Build from Source Build HiveMQ CE from the source code. Building from source requires Java 21 or higher .
Clone Repository
git clone https://github.com/hivemq/hivemq-community-edition.git
cd hivemq-community-edition
Build Binary Package
The package will be created in build/distributions/hivemq-ce-<version>.zip.
Build Docker Image
To build a local Docker image: This creates the image hivemq/hivemq-ce:snapshot locally. Gradle Tasks
./gradlew hivemqZip - Build ZIP distribution
./gradlew loadOciImage - Build Docker image
./gradlew check - Run all tests
./gradlew test - Run unit tests
Embedded Mode Embed HiveMQ CE directly into your Java application.
Add Dependency
Maven: < dependency >
< groupId > com.hivemq </ groupId >
< artifactId > hivemq-community-edition-embedded </ artifactId >
< version > 2025.5 </ version >
</ dependency >
Gradle: implementation 'com.hivemq:hivemq-community-edition-embedded:2025.5'
Set your compiler version to Java 11 or higher.
Create Embedded Instance
import com.hivemq.embedded.EmbeddedHiveMQ;
import java.nio.file.Path;
public class EmbeddedExample {
public static void main ( String [] args ) {
final EmbeddedHiveMQ hivemq = EmbeddedHiveMQ . builder ()
. withConfigurationFolder ( Path . of ( "/path/to/config" ))
. withDataFolder ( Path . of ( "/path/to/data" ))
. withExtensionsFolder ( Path . of ( "/path/to/extensions" ))
. build ();
try {
hivemq . start (). join ();
System . out . println ( "HiveMQ CE started successfully!" );
// Your application logic here
} catch ( Exception e ) {
e . printStackTrace ();
} finally {
hivemq . stop (). join ();
}
}
}
Using Try-With-Resources
import com.hivemq.embedded.EmbeddedHiveMQ;
public class EmbeddedExample {
public static void main ( String [] args ) {
try ( final EmbeddedHiveMQ hivemq = EmbeddedHiveMQ . builder (). build ()) {
hivemq . start (). join ();
// Your application logic
} catch ( Exception ex ) {
ex . printStackTrace ();
}
}
}
EmbeddedHiveMQ implements AutoCloseable. Always use try-with-resources or ensure close() is called.
Add Custom Extensions
import com.hivemq.embedded.EmbeddedExtension;
import com.hivemq.extension.sdk.api.ExtensionMain;
import com.hivemq.extension.sdk.api.parameter. * ;
final EmbeddedExtension extension = EmbeddedExtension . builder ()
. withId ( "my-extension" )
. withName ( "My Custom Extension" )
. withVersion ( "1.0.0" )
. withPriority ( 0 )
. withStartPriority ( 1000 )
. withAuthor ( "Your Name" )
. withExtensionMain ( new MyExtensionMain ())
. build ();
final EmbeddedHiveMQ hivemq = EmbeddedHiveMQ . builder ()
. withEmbeddedExtension (extension)
. build ();
Excluding Dependencies If you need to reduce the size of your embedded deployment, you can exclude certain dependencies. Excluding RocksDB To exclude RocksDB persistence (uses file-based persistence instead): < dependency >
< groupId > com.hivemq </ groupId >
< artifactId > hivemq-community-edition-embedded </ artifactId >
< version > 2025.5 </ version >
< exclusions >
< exclusion >
< groupId > org.rocksdb </ groupId >
< artifactId > rocksdbjni </ artifactId >
</ exclusion >
</ exclusions >
</ dependency >
Configure persistence type: import com.hivemq.configuration.service.InternalConfigurations;
import com.hivemq.persistence.PersistenceType;
InternalConfigurations . PAYLOAD_PERSISTENCE_TYPE . set ( PersistenceType . FILE );
InternalConfigurations . RETAINED_MESSAGE_PERSISTENCE_TYPE . set ( PersistenceType . FILE );
hivemq . start (). join ();
Linux Installation
Install Java
Ubuntu/Debian: sudo apt update
sudo apt install openjdk-11-jre
RHEL/CentOS/Fedora: sudo yum install java-11-openjdk
Create HiveMQ User (Optional)
sudo useradd -r -s /bin/ false hivemq
Install HiveMQ CE
cd /opt
sudo wget https://github.com/hivemq/hivemq-community-edition/releases/download/2025.5/hivemq-ce-2025.5.zip
sudo unzip hivemq-ce-2025.5.zip
sudo chown -R hivemq:hivemq hivemq-ce-2025.5
Create systemd Service
Create /etc/systemd/system/hivemq.service: [Unit]
Description =HiveMQ Community Edition
After =network.target
[Service]
Type =simple
User =hivemq
Group =hivemq
WorkingDirectory =/opt/hivemq-ce-2025.5
ExecStart =/opt/hivemq-ce-2025.5/bin/run.sh
Restart =on-failure
RestartSec =10
[Install]
WantedBy =multi-user.target
Enable and start: sudo systemctl daemon-reload
sudo systemctl enable hivemq
sudo systemctl start hivemq
sudo systemctl status hivemq
macOS Installation
Install HiveMQ CE
cd ~/Applications
wget https://github.com/hivemq/hivemq-community-edition/releases/download/2025.5/hivemq-ce-2025.5.zip
unzip hivemq-ce-2025.5.zip
cd hivemq-ce-2025.5
Windows Installation
Install Java
Download and install Java from Adoptium .
Extract HiveMQ CE
Extract hivemq-ce-2025.5.zip to C:\hivemq-ce-2025.5
Run as Administrator
Right-click Command Prompt and select “Run as Administrator”: cd C:\hivemq-ce-2025.5
bin\run.bat
Create Windows Service (Optional)
You can use tools like NSSM to run HiveMQ CE as a Windows service.
Initial Configuration
After installation, configure HiveMQ CE by editing conf/config.xml.
Basic Configuration
The default configuration enables MQTT on port 1883:
<? xml version = "1.0" ?>
< hivemq >
< listeners >
< tcp-listener >
< port > 1883 </ port >
< bind-address > 0.0.0.0 </ bind-address >
</ tcp-listener >
</ listeners >
</ hivemq >
Add WebSocket Listener
< hivemq >
< listeners >
< tcp-listener >
< port > 1883 </ port >
< bind-address > 0.0.0.0 </ bind-address >
</ tcp-listener >
< websocket-listener >
< port > 8000 </ port >
< bind-address > 0.0.0.0 </ bind-address >
< path > /mqtt </ path >
< subprotocols >
< subprotocol > mqttv3.1 </ subprotocol >
< subprotocol > mqtt </ subprotocol >
</ subprotocols >
< allow-extensions > false </ allow-extensions >
</ websocket-listener >
</ listeners >
</ hivemq >
Add TLS Listener
< tls-tcp-listener >
< port > 8883 </ port >
< bind-address > 0.0.0.0 </ bind-address >
< tls >
< keystore >
< path > /path/to/keystore.jks </ path >
< password > keystore-password </ password >
< private-key-password > key-password </ private-key-password >
</ keystore >
< truststore >
< path > /path/to/truststore.jks </ path >
< password > truststore-password </ password >
</ truststore >
< client-authentication-mode > NONE </ client-authentication-mode >
</ tls >
</ tls-tcp-listener >
Check the conf/examples/ directory for more configuration examples.
Verifying Installation
Check HiveMQ is Running
You should see:
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN
Test with Mosquitto Client
mosquitto_pub -h localhost -t test/topic -m "HiveMQ CE is running!"
mosquitto_sub -h localhost -t test/topic
Check Logs
View the log files in the log/ directory:
Firewall Configuration
Linux (UFW)
sudo ufw allow 1883/tcp comment 'HiveMQ MQTT'
sudo ufw allow 8000/tcp comment 'HiveMQ WebSocket'
sudo ufw allow 8883/tcp comment 'HiveMQ MQTT TLS'
Linux (firewalld)
sudo firewall-cmd --permanent --add-port=1883/tcp
sudo firewall-cmd --permanent --add-port=8000/tcp
sudo firewall-cmd --permanent --add-port=8883/tcp
sudo firewall-cmd --reload
Windows Firewall
New-NetFirewallRule - DisplayName "HiveMQ MQTT" - Direction Inbound - Protocol TCP - LocalPort 1883 - Action Allow
New-NetFirewallRule - DisplayName "HiveMQ WebSocket" - Direction Inbound - Protocol TCP - LocalPort 8000 - Action Allow
JVM Options
Edit the startup script to customize JVM options:
Linux/macOS (bin/run.sh):
JAVA_OPTS = " $JAVA_OPTS -Xmx4g -Xms4g"
Windows (bin/run.bat):
set " JAVA_OPTS = %JAVA_OPTS% -Xmx4g -Xms4g"
Recommended Settings for Production
JAVA_OPTS = "-Xmx4g -Xms4g"
JAVA_OPTS = " $JAVA_OPTS -XX:+UseG1GC"
JAVA_OPTS = " $JAVA_OPTS -XX:MaxGCPauseMillis=100"
JAVA_OPTS = " $JAVA_OPTS -XX:+ParallelRefProcEnabled"
Troubleshooting
Java Not Found
Error: ERROR! You do not have the Java Runtime Environment installed
Solution: Install Java 11 or higher and ensure it’s in your PATH.
Insufficient Java Version
Error: ERROR! HiveMQ requires at least Java version 11
Solution: Update to Java 11 or higher.
Port Already in Use
Error: Port 1883 is already in use
Solution:
Find the process using the port: lsof -i :1883 (Linux/macOS) or netstat -ano | findstr :1883 (Windows)
Change the port in conf/config.xml
Permission Denied (Linux)
Error: Permission denied when starting HiveMQ
Solution:
Heap Dump on OutOfMemory
HiveMQ CE automatically creates heap dumps on OutOfMemoryError. Find them in the HiveMQ home directory:
heap-dump.hprof
hs_err_pid<pid>.log
Next Steps
Configuration Configure listeners, security, MQTT settings, and more
Extensions Extend HiveMQ CE with custom functionality
Monitoring Monitor HiveMQ CE with JMX and metrics
Security Configure TLS, authentication, and authorization