MQTT Broker is a server that receives all messages from the clients.
MQTT client is any device that runs an MQTT library and connects to an MQTT broker over a network.
Install MQTT Broker Packages
Open a new Terminal window.
Type the following Command to install MQTT broker.
sudo apt-get install -y mosquitto mosquitto-clients.
And then type sudo Password
After entering sudo password, MQTT broker packages will install.
Type the Command to check the version of MQTT broker>> mosquitto -v
The Installed mosquitto version is 3.1 broker.
Type the following Command to connect the MQTT broker
>> mosquitto -p port address
If the port address is already in use then try another port address.