How to install Mosquitto in Ubuntu 22.04 LTS

Tutorial to install the Mosquitto on Ubuntu 22.04 Jammy LTS including Management Web Graphical Interface Cedalo.

Eclipse Mosquitto is a lightweight message broker published under an open-source license. It implements MQTT protocol versions 5.0, 3.1.1, and 3.1. And because of its low power consumption, it can be used on boards like Raspberry Pi.

Whereas the MQTT protocol (MQ Telemetry Transport or Message Queue Telemetry Transport) was developed in 1999 for M2M (machine-to-machine) communication as part of a joint oil pipeline project between IBM and Arcom Control Systems.

The Mosquitto project also provides a C library for implementing MQTT clients and the very popular mosquitto_pub and mosquitto_sub command line MQTT clients.

Steps to install Mosquitto on Ubuntu 22.04 Linux

The commands given here are also applicable to other similar Linux based on Ubuntu such as Linux Mint, Elementary OS, POP OS, and more…

1. Update Ubuntu 20.04

Start with running the system update command to install available latest package updates.

sudo apt update

2. Add the PPA Mosquitto repository

The version of Mosquitto available to install through the Ubuntu 22.04 repository is not the latest one. Therefore, use the given command to add the PPA repo provided by the official developers of this tool.

sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa

3. Install Mosquitto on Ubuntu 22.04

Finally, use the system’s default apt package manager to install Mosquitto message broker on Ubuntu 22.04 or 20.04.

sudo apt install mosquitto mosquitto-clients
Install Mosquitto on Ubuntu 22.04 or 20.04 Linux

4. Check the version

After completing the installation, check the installed version, in your terminal run:

mosquitto -version

For other further available options to use with the Mosquitto can be seen here on its official website.

5. Mosquitto Management Web UI installation

There is also free and open-source Management known as Cedalo. That can be used to manage clients, groups, and roles as in the new Dynamic Security plugin. However, to install and set it up, we need the Docker platform on our Ubuntu to access this management interface.

Those who don’t have Docker on their Ubuntu system can see our tutorial – How to install Docker on Ubuntu Linux.

Whereas others who already have docker installed can run the given command:

docker run -it -v ~/cedalo_platform:/cedalo cedalo/installer:2-linux

Once the docker pulls the Cedalo platform, it will ask you what components you want to install. Let the pre-selected one and simply hit the Enter key.

Note: If you are installing GUI management then you must not select the installation of Mosquitto because we already did that whereas those who have not installed it can let the default settings as it is.

Install Mosquitto GUI on Ubuntu min

After completing the process, you will have the cedalo_platform directory under your /home with all the required files we need to start this Mosquitto GUI management interface.

So, switch to it

cd ~/cedalo_platform

There you will find start.sh, run it:

sh start.sh

The docker will perform some downloads if you are running the script for the first time. After that don’t close the Terminal, once the downloading is completed and the service is started because it will also close the Management Web GUI as well.

Install cedalo platform on Ubuntu Linux

6. Access Management Center web GUI

By default, the Management Center Web UI runs on the 8088 port, therefore, to access it open your browser and type – http://localhost:8088.

When it asks for the username and password, the default credentials are User: cedalo Password: mmcisawesome. To change them we can edit the docker-compose.yml file. Also, the Eclipse Mosquitto connection URL is: mqtt://localhost:1883

Mosquitto Login Web UI
Mosquitto install Ubuntu 22.04 Management center Web UI

7. Eclipse Streamsheets Web UI

Open http://localhost:8081 in your browser. The default Credentials: User: admin Password: 1234. Change your password in the administration menu.

Eclipse Streamsheets Web UI

Other Articles:

⇒ 2 Ways to Install Eclipse IDE on Debian 11 Bullseye
⇒ 5 Best Linux Distros for Beginners in 2022 to use on a laptop or PC
⇒ How to start using MongoDB 6.0 in Ubuntu 20.04 LTS
⇒ Download Youtube videos on Ubuntu 22.04 via the command line

12 thoughts on “How to install Mosquitto in Ubuntu 22.04 LTS”

  1. FAIL!

    E: The repository ‘https://ppa.launchpadcontent.net/mosquitto-dev/mosquitto-ppa/ubuntu kinetic Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration detai

    Reply
    • To start mosquitto you can enable its service using – sudo systemctl enable mosquitto.service

      Whereas to start its management interface automatically create a systemd file using the given commands:

      cd /etc/systemd/system

      sudo nano mosquittogui.service

      Paste the following text and save it. Also Replace $USER with your current user.

      [Unit]
      Description=Mosquittogui

      [Service]
      Restart=always
      ExecStart=/home/$USER/cedalo_platform/start.sh
      ExecStop=/home/$USER/cedalo_platform/stop.sh

      [Install]

      WantedBy=multi-user.target

      Now, reload the deamon

      sudo systemctl daemon-reload

      sudo systemctl enable mosquittogui
      sudo systemctl start mosquittogui
      sudo systemctl status mosquittogui

      Reply
  2. i have problems in Ubuntu mate 22.04 lts,
    grzegorz@grzegorz-HP-t620-Dual-Core-TC:~/cedalo_platform$ sh start.sh
    Starting cedalo_platform_mosquitto_1 …
    Starting cedalo_platform_mosquitto_1 … error

    ERROR: for cedalo_platform_mosquitto_1 Cannot start service mosquitto: driver failed programming external connectivity on endpoint cedalo_platform_mosquitto_1 (f031c9c000905cf6298eec4eb1245806f6cbc5d6aa9110df822db5576f921fcd): Error starting userland proxy: listen tcp4 0.0.0.0:1883: bind: address already in use

    ERROR: for mosquitto Cannot start service mosquitto: driver failed programming external connectivity on endpoint cedalo_platform_mosquitto_1 (f031c9c000905cf6298eec4eb1245806f6cbc5d6aa9110df822db5576f921fcd): Error starting userland proxy: listen tcp4 0.0.0.0:1883: bind: address already in use
    ERROR: Encountered errors while bringing up the project.

    Reply
  3. Grzesieg sorry for my poor english, your problem is you have installed mosquitto before installing the cedalo docker, and cedalo has mosquitto running inside the docker image, if you try to disable mosquitto with: sudo systemctl stop mosquitto and you try again to run the docker image… this time the cedalo manager starts correctly.

    Reply
  4. Starting cedalo_platform_mosquitto_1 …
    Starting cedalo_platform_mosquitto_1 … error

    ERROR: for cedalo_platform_mosquitto_1 Cannot start service mosquitto: driver failed programming external connectivity on endpoint cedalo_platform_mosquitto_1 (d96d3a4905fdc1d9c5958cfab0c326cfbc74cedb32550cf1d5c80a9a1c58e0da): Error starting userland proxy: listen tcp4 0.0.0.0:1883: bind: address already in use

    Reply
  5. Ubuntu 22.04 installs Mosquitto 2.0.16. There is a line missing in /etc/mosquitto.mosquitto.conf, it should have “listener 1883” as the first line. I seem to be the only one in the world that has had this problem after upgrading to 22.04 nothing could connect to mosquitto! It took me 3 days of GoOgling for me to infer the solution, no one cited the solution.

    Reply
  6. Hi
    as per your writeup all things were ok.
    I installed ubuntu in digital ocean, then the docker as per this
    https://linux.how2shout.com/how-to-install-docker-ce-on-ubuntu-22-04-lts-jammy-jellyfish/

    then
    https://linux.how2shout.com/how-to-install-mosquitto-in-ubuntu-22-04-or-20-04-lts/
    starting with the 5th point.
    with cedalo management along with mosquitto 2.

    Now the issue is after the server is restart. the mosquitto and management ui is not starting automatically.

    kindly suggest

    Reply
  7. thanks for your response

    in this command
    docker run -d –restart unless-stopped container-name
    i could not figure out the container name.
    cedalo/management-center:2 cedalo_platform_management-center_1
    cedalo/streamsheets:2-milestone cedalo_platform_streamsheets_1
    eclipse-mosquitto:2-openssl cedalo_platform_mosquitto_1
    cedalo/installer:2-linux magical_goldstine

    which one to use

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.