If you plan to deploy Mango in a container environment, we supply Docker/OCI images through GitHub Container Registry. Browse the public container registry here.
To pull the latest image:
docker pull ghcr.io/radixiot/mango:latest
Note: These images are public and do not require authentication.
Note: We recommend using docker engine version such as 26.0 or higher.
Supported Tags
• 5
, 5.5
, 5.5.2
, latest
• 5.4
, 5.4.1
• 5.3
, 5.3.1
• 5.2
, 5.2.1
• 5.1
, 5.1.4
• 5.0.5
Note: We recommend using a fixed Mango version, such as 5.2.1 or 5.3.1, instead of 5, 5.2 or latest in a production environment to prevent unintended upgrades.
Note: Our Docker images are currently based on Ubuntu: azul/zulu-openjdk, which includes Java and OS security updates. We recommend a planned upgrade to an up-to-date version of Mango to receive the latest security updates and improvements.
Supported Architectures
• amd64,
• arm64 (arm64v8)
Note: Starting from Mango version 5.3.0, the Docker images supports additional architecture arm64v8 (64-bit ARM).
Port Mapping
When running a Docker container, you may need to expose certain ports to allow communication with the services running inside the container. This allows you to access the container's services from your local machine or other machines on the network.
Port | Type | Description |
---|---|---|
8080 | TCP | HTTP (Web traffic) |
8443 | TCP | HTTPS (Secure Web traffic) |
9090 | TCP | gRPC (Remote Procedure Calls) |
47808 | UDP | BACnet |
502 | TCP | Modbus |
... |
docker run -p 8443:8443 -p 9090:9090 ghcr.io/radixiot/mango
docker run -p 47808:47808/udp ghcr.io/radixiot/mango
Note: The application listens on a specific port, expose TCP port 8443 to access the web port. Expose TCP port 9090 to access the gRPC port.
Healthchecks
Docker image comes with a default healthcheck command that periodically monitors the health of the container to ensure it is running correctly.
Note: The default healthcheck uses relatively small intervals and startup periods for small deployments. However, it is possible to adjust timing or disable the healthcheck based on specific requirements. Docker Documentation
Container Users
User:Group | UID:GID | Docker Image | Home Directory |
---|---|---|---|
mango:mango | 1000:1000 | 5.3.0, 5.5.0+ | /opt/mango-data |
mango:mango | 999:999 | 5.3.1, 5.4.0, 5.4.1 | /opt/mango-data |
root:root | 0:0 | any | /root |
Note: mango user available starting from version 5.3.0 and is used as the default user in the container. Using a non-root user enhances security and minimizes potential vulnerabilities. To utilize the root user within containers, the -u (or --user) option can be specified in the Docker command.
docker run -u root -v /host/mango-data:/opt/mango-data ghcr.io/radixiot/mango
Warning: For existing Docker deployments, ownership of Docker bind mounts must be migrated to the mango user to ensure proper access and functionality within the container.
chown -R 1000:1000 /host/mango-data
docker run -v /host/mango-data:/opt/mango-data ghcr.io/radixiot/mango
Java VM arguments
To set JVM arguments in the Mango Docker image, you will need to pass the arguments along with the main class (com.serotonin.m2m2.Main). As the entry point is already set to java, do not repeat that.
docker run ghcr.io/radixiot/mango -Xms1024M -Xmx1024M com.serotonin.m2m2.Main
Be sure to specify JVM arguments before the main class name.
Data Persistence
Mango images do not create volumes by default. To ensure that your data remains intact across container restarts or removals, we recommend using either bind mounts or named volumes.
Bind Mounts
A bind mount allows you to specify an exact path on the host machine to be mounted into the container. This method gives you direct control over the location of data.
docker run -v /host/mango-data:/opt/mango-data ghcr.io/radixiot/mango
• Replace /host/mango-data with the desired directory on your host where data will be stored.
Named Volumes
A named volume is a convenient way to manage persistent data in Docker. Unlike bind mounts, named volumes are explicitly created and managed by Docker, allowing for easy reuse across containers.
To create a named volume for your Mango data, use the following command:
docker volume create mango-data
docker run -v mango-data:/opt/mango-data ghcr.io/radixiot/mango
Important Locations
Default directory | Description | Environment Variable | Customizable |
---|---|---|---|
/opt/mango | The Mango installation directory. | mango_paths_home | |
/opt/mango-data | Path to the directory where Mango will store its variable data. | mango_paths_data | |
/opt/mango-data/mango.properties | Path to mango.properties configuration file. | mango_config | By variable and/or by separate bind mount |
/opt/mango-data/.guid | Persistent GUID file. | By separate bind mount or within mango-data | |
/opt/mango-data/data/core/m2m2.license.xml | Persistent license XML file. | ||
Persistent GUID as environment variable. | MA_GUID | By variable |
Note: Persistent GUID file /opt/mango-data/.guid available starting from version 5.2.0
Note: If MA_GUID environment variable set, it takes precedence over the .guid file within the container. This means that if both are specified, the GUID from the environment variable will be used, overriding any value found in the .guid file.
Mango Properties
Mango can be configured by editing the mango.properties file located in the mango-data directory after the container has started. Alternatively, to set properties prior to the container's initialization, environment variables can be used, or a separate bind mount can be created for the mango.properties file.
Environment variables
Environment variables are prefixed with mango_ and have the dots/full stops (.
) replaced with an underscore (_
). e.g. db.type
becomes mango_db_type
.
docker run -e mango_db_type=h2 ghcr.io/radixiot/mango
Setting properties via a environment file
Properties can be configured in an environment file and passed to Docker, for example:
docker run --env-file mango.env ghcr.io/radixiot/mango
# Set a GUID
MA_GUID=2-6efe324b-c455-41d2-aebd-06eb175b445f
# Configure a database connection
mango_db_type=postgres
mango_db_url=jdbc:postgresql://postgres/mango
mango_db_username=mango
mango_db_password=mango_password
Setting properties via separate bind mount
The mango.properties file can be configured and passed to Docker as a separate bind mount.
docker run -v /host/mango-data:/opt/mango-data -v /host/mango.properties:/opt/mango-data/mango.properties ghcr.io/radixiot/mango
Note: The order of volume mounts matters significantly because the last mount specified at any path will effectively override all previous mounts at that same path.
or
docker run -e mango_config=/opt/mango.properties -v /host/mango-data:/opt/mango-data -v /host/mango.properties:/opt/mango.properties ghcr.io/radixiot/mango
# Configure a database connection
db.type=postgres
db.url=jdbc:postgresql://postgres/mango
db.username=mango
db.password=mango_password
GUID and License
To license Mango within a container, a static GUID is required, along with a persistent data path (as referenced above) to store the license file. GUID can be generated and passed to Docker by MA_GUID environment variable or .guid file.
A Mango GUID is 2- followed by a random (v4) UUID (lower-case) e.g.
• 2-6efe324b-c455-41d2-aebd-06eb175b445f
It is possible to generate a UUID using uuidgen e.g.
• uuidgen | tr '[:upper:]' '[:lower:]'
MA_GUID="2-$(uuidgen | tr '[:upper:]' '[:lower:]')"
docker run -e MA_GUID=$MA_GUID -v /host/mango-data:/opt/mango-data ghcr.io/radixiot/mango
Note: Persistent GUID file /opt/mango-data/.guid available starting from version 5.2.0
Content of .guid file
2-6efe324b-c455-41d2-aebd-06eb175b445f
docker run -v /host/mango-data:/opt/mango-data ghcr.io/radixiot/mango