Portainer Templates logo

Portainer Templates

Pro Mosquitto with Management Center Pro Mosquitto with Management Center

edge

Commercial-grade Mosquitto MQTT broker with Management Center

Configuration

Type
Compose
Platform
linux
Env vars
CEDALO_LICENSE_KEY=''CEDALO_MOSQUITTO_PASSWORD=''CEDALO_MC_USER=cedaloCEDALO_MC_PASSWORD=''
Source

Template by portainer·Source

Notes

The Mosquitto broker password must be at least 12 characters.

Services

mosquitto

Configuration

Image
registry.cedalo.com/portainer-trials/mosquitto:2.8
Ports
188388838090
Volumes
/mosquitto/data : mosquitto_data/mosquitto/config : mosquitto_config
Env vars
CEDALO_LICENSE_KEY=${CEDALO_LICENSE_KEY}MOSQUITTO_DYNSEC_PASSWORD=${CEDALO_MOSQUITTO_PASSWORD}

management-center

Configuration

Image
registry.cedalo.com/portainer-trials/management-center:2.8
Ports
8088
Volumes
/management-center/config : mc_data
Env vars
CEDALO_LICENSE_KEY=${CEDALO_LICENSE_KEY}CEDALO_MC_PROXY_HOST=0.0.0.0CEDALO_MC_USERNAME=${CEDALO_MC_USER}CEDALO_MC_PASSWORD=${CEDALO_MC_PASSWORD}CEDALO_MC_PROXY_SRT_BASE=/management-center/configCEDALO_MC_PROXY_CONFIG=/management-center/config/config.jsonCEDALO_MC_PROXY_CONFIG_CERTS=/management-center/config/certs.dbCEDALO_MC_PROXY_CONFIG_TOKENS=/management-center/config/tokens.jsonCEDALO_MC_PROXY_CONFIG_USERS=/management-center/config/users.jsonCEDALO_MC_PROXY_CONFIG_AUDIT_TRAIL=/management-center/config/audit.jsonCEDALO_MC_BROKER_CONNECTION_MQTT_EXISTS_MAPPING=mosquitto:trueCEDALO_MC_BROKER_CONNECTION_MQTTS_EXISTS_MAPPING=mosquitto:falseCEDALO_MC_BROKER_CONNECTION_WS_EXISTS_MAPPING=mosquitto:falseCEDALO_MC_BROKER_CONNECTION_HOST_MAPPING=mosquitto:localhostCEDALO_MC_BROKER_URL=mqtt://mosquitto:1883CEDALO_MC_BROKER_NAME=pro-mosquittoCEDALO_MC_BROKER_ID=pro-mosquittoCEDALO_MC_BROKER_USERNAME=adminCEDALO_MC_BROKER_PASSWORD=${CEDALO_MOSQUITTO_PASSWORD}CEDALO_MC_DATA_DIRECTORY_PATH=/management-center/configCEDALO_MC_MODE=offline

Installation

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select the app you wish to deploy, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

Service #1 - mosquitto

docker run -d --name mosquitto \
  -p 1883 \
  -p 8883 \
  -p 8090 \
  -e 'CEDALO_LICENSE_KEY=${CEDALO_LICENSE_KEY}' \
  -e 'MOSQUITTO_DYNSEC_PASSWORD=${CEDALO_MOSQUITTO_PASSWORD}' \
  -v mosquitto_data:/mosquitto/data \
  -v mosquitto_config:/mosquitto/config \
  registry.cedalo.com/portainer-trials/mosquitto:2.8

Service #2 - management-center

docker run -d --name management-center \
  -p 8088 \
  -e 'CEDALO_LICENSE_KEY=${CEDALO_LICENSE_KEY}' \
  -e 'CEDALO_MC_PROXY_HOST=0.0.0.0' \
  -e 'CEDALO_MC_USERNAME=${CEDALO_MC_USER}' \
  -e 'CEDALO_MC_PASSWORD=${CEDALO_MC_PASSWORD}' \
  -e 'CEDALO_MC_PROXY_SRT_BASE=/management-center/config' \
  -e 'CEDALO_MC_PROXY_CONFIG=/management-center/config/config.json' \
  -e 'CEDALO_MC_PROXY_CONFIG_CERTS=/management-center/config/certs.db' \
  -e 'CEDALO_MC_PROXY_CONFIG_TOKENS=/management-center/config/tokens.json' \
  -e 'CEDALO_MC_PROXY_CONFIG_USERS=/management-center/config/users.json' \
  -e 'CEDALO_MC_PROXY_CONFIG_AUDIT_TRAIL=/management-center/config/audit.json' \
  -e 'CEDALO_MC_BROKER_CONNECTION_MQTT_EXISTS_MAPPING=mosquitto:true' \
  -e 'CEDALO_MC_BROKER_CONNECTION_MQTTS_EXISTS_MAPPING=mosquitto:false' \
  -e 'CEDALO_MC_BROKER_CONNECTION_WS_EXISTS_MAPPING=mosquitto:false' \
  -e 'CEDALO_MC_BROKER_CONNECTION_HOST_MAPPING=mosquitto:localhost' \
  -e 'CEDALO_MC_BROKER_URL=mqtt://mosquitto:1883' \
  -e 'CEDALO_MC_BROKER_NAME=pro-mosquitto' \
  -e 'CEDALO_MC_BROKER_ID=pro-mosquitto' \
  -e 'CEDALO_MC_BROKER_USERNAME=admin' \
  -e 'CEDALO_MC_BROKER_PASSWORD=${CEDALO_MOSQUITTO_PASSWORD}' \
  -e 'CEDALO_MC_DATA_DIRECTORY_PATH=/management-center/config' \
  -e 'CEDALO_MC_MODE=offline' \
  -v mc_data:/management-center/config \
  registry.cedalo.com/portainer-trials/management-center:2.8

If the stack expects env vars, set them or add them to a .env file first.

services:
  mosquitto:
    image: registry.cedalo.com/portainer-trials/mosquitto:2.8
    ports:
      - 1883
      - 8883
      - 8090
    environment:
      CEDALO_LICENSE_KEY: ${CEDALO_LICENSE_KEY}
      MOSQUITTO_DYNSEC_PASSWORD: ${CEDALO_MOSQUITTO_PASSWORD}
    volumes:
       - mosquitto_data:/mosquitto/data
       - mosquitto_config:/mosquitto/config

  management-center:
    image: registry.cedalo.com/portainer-trials/management-center:2.8
    ports:
      - 8088
    depends_on:
      - mosquitto
    environment:
      CEDALO_LICENSE_KEY: ${CEDALO_LICENSE_KEY}
      CEDALO_MC_PROXY_HOST: 0.0.0.0
      CEDALO_MC_USERNAME: ${CEDALO_MC_USER}
      CEDALO_MC_PASSWORD: ${CEDALO_MC_PASSWORD}
      CEDALO_MC_PROXY_SRT_BASE: /management-center/config
      CEDALO_MC_PROXY_CONFIG: /management-center/config/config.json
      CEDALO_MC_PROXY_CONFIG_CERTS: /management-center/config/certs.db
      CEDALO_MC_PROXY_CONFIG_TOKENS: /management-center/config/tokens.json
      CEDALO_MC_PROXY_CONFIG_USERS: /management-center/config/users.json
      CEDALO_MC_PROXY_CONFIG_AUDIT_TRAIL: /management-center/config/audit.json
      CEDALO_MC_BROKER_CONNECTION_MQTT_EXISTS_MAPPING: mosquitto:true
      CEDALO_MC_BROKER_CONNECTION_MQTTS_EXISTS_MAPPING: mosquitto:false
      CEDALO_MC_BROKER_CONNECTION_WS_EXISTS_MAPPING: mosquitto:false
      CEDALO_MC_BROKER_CONNECTION_HOST_MAPPING: mosquitto:localhost
      CEDALO_MC_BROKER_URL: mqtt://mosquitto:1883
      CEDALO_MC_BROKER_NAME: pro-mosquitto
      CEDALO_MC_BROKER_ID: pro-mosquitto
      CEDALO_MC_BROKER_USERNAME: admin
      CEDALO_MC_BROKER_PASSWORD: ${CEDALO_MOSQUITTO_PASSWORD}
      CEDALO_MC_DATA_DIRECTORY_PATH: /management-center/config
      CEDALO_MC_MODE: offline
    volumes:
       - mc_data:/management-center/config

volumes:
    mosquitto_data:
    mosquitto_config:
    mc_data:

Or, use the original compose file, straight from the template repo. Deploy with:

git clone https://github.com/portainer/templates
cd templates
docker compose -f edge/cedalo-mosquitto-mc/docker-compose.yml up -d

For more installation options, see the Documentation in our GitHub repo

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Image won't pull

Test the pull directly on the host: docker pull registry.cedalo.com/portainer-trials/mosquitto:2.8

  • "manifest unknown" means the tag no longer exists.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

Similar apps