Getting Started with HiveMQ Cloud
HiveMQ Cloud is part of the HiveMQ Platform, an MQTT-based industrial AI platform.
| HiveMQ Cloud deployments do not yet support Data Intelligence in the HiveMQ Platform. This means the Contextualize and Analyze capabilities are currently unavailable for Cloud-deployed brokers. |
This quick start guide shows you how to complete the following tasks:
-
Create a free HiveMQ account.
-
Start a 15-day free trial of the HiveMQ Cloud Starter plan.
-
Configure client access to your HiveMQ Cloud broker.
-
Test your broker with MQTT clients.
More ways to get started:
-
To learn about all the features that the HiveMQ Platform offers, including ways to operationalize your data for AI-driven actions, see Getting Started with the HiveMQ Platform.
-
To connect your existing HiveMQ brokers to the HiveMQ Platform, see Connect Your Existing HiveMQ Broker or Edge Instance
-
For instructions on running HiveMQ software on your own infrastructure with a free HiveMQ Lab License, see Getting Started with the HiveMQ Broker. The Lab license also includes free access to Data Intelligence functionality, up to the free allowance.
Sign Up and Log In to HiveMQ
To get started with HiveMQ Cloud, navigate to app.hivemq.com.
-
The first time you use HiveMQ, you are asked to select a login method and sign up. You can use your GitHub, Google, or LinkedIn account, or your email address:
-
Email: HiveMQ sends a verification code to your email address. Enter the code and click Verify email. If you do not receive the code, click Resend code. Then set a secure password and click Create account.
-
GitHub, Google, or LinkedIn: The provider supplies your login data.
-
-
To complete your sign-up, enter basic contact details for your user profile and click Continue:
Your account opens in the HiveMQ Platform at app.hivemq.com.
For future visits, log in directly with the method you selected.HiveMQ automatically creates a HiveMQ organization when you create a HiveMQ account. The account creator becomes the organization owner and receives administrative rights. HiveMQ organizations enable users to collaborate on HiveMQ brokers across HiveMQ accounts. To learn more, see HiveMQ Organizations.
Select Your HiveMQ Cloud Plan
After you complete your sign-up, a page with information about the different plans HiveMQ Cloud offers opens:
-
HiveMQ Cloud Enterprise: Production-grade MQTT for large-scale, mission-critical IoT. For more information on HiveMQ Cloud Enterprise, contact our sales team.
-
HiveMQ Cloud Starter: Complete MQTT platform for testing and small-scale production.
This guide uses the 15-day free trial of the HiveMQ Cloud Starter plan.
-
On the Select your Cloud Plan page, select Starter, then click Continue:
-
A form opens to configure your HiveMQ Cloud starter plan trial:
-
Name your broker: You can keep the automatically generated broker name or enter a name of your choice. The broker name must be unique within your account. Use lowercase letters, numbers, hyphens (-) and dots (.) only. The broker name must start and end with a letter or number with no spaces, underscores, or uppercase letters.
-
If more than one AWS region is available, select the AWS region in which your HiveMQ Cloud broker is located from the list.
-
Enter your contact information and billing address.
-
Provide your payment details. You are not charged during your trial.
-
Review the configuration information in the Plan Details area. For the HiveMQ Cloud Starter free trial, pricing applies only after the 15-day trial ends.
-
After you review your configuration information, save your payment details. Review and agree to the HiveMQ Subscription Agreement, then click Start Free Trial.
-
View Your Newly Created HiveMQ Cloud Broker
Your trial HiveMQ Cloud Starter broker appears in the Connect & Manage Network view on the Connect page. Broker creation can take a few minutes.
-
When broker creation is complete, select the broker name on the Connect & Manage Network view to open the Broker Details panel.
-
On the Broker Details panel, click Configure to access broker details such as connection settings, usage, and configuration options.
You can also click the settings icon for each broker on the Connect & Manage Network view to access the broker details.
-
Explore the broker detail tabs to become familiar with the management interface:
Table 1. Broker detail tabs Tab Description Actions Overview
Shows general broker information and connection details.
-
Custom Domain
-
Delete Broker
Usage
How much of the plan limit the broker currently uses.
-
See all usage & billing
-
Set period
Access Management
Area to configure how clients prove their identity to your broker and define permissions that control clients access. See, Configure Client Access.
-
Add Credentials
-
Add Permission
-
Add Role
Integrations
Connect your broker with external data platforms and services.
-
Configure Confluent
-
Configure Kafka
-
Configure Amazon Kinesis
API Keys
Manage API keys and access the HiveMQ REST API for this broker. View URLs to interact with your broker via the REST API.
-
Generate Key
Troubleshooting
Get help with common issues.
-
Test your connection
-
Trace Recordings
-
Logs
-
Configure Client Access to Your HiveMQ Cloud Broker
Before an MQTT client can connect to your HiveMQ Cloud broker, you must configure an authentication method for the client. The HiveMQ Cloud Starter plan offers three ways to ensure that only authorized devices connect to your MQTT broker:
-
Access Credentials
-
Client Certificate
-
JSON Web Token
Only clients that present a known access credential, client certificate, or JSON Web Token are allowed to connect and perform actions on the selected broker. You can choose the authentication method that fits your individual business needs.
| You can use only one authentication method at a time. When you configure a method, HiveMQ disables the other methods for your MQTT clients. |
This guide shows you how to add username and password access credentials. To learn more about other authentication methods, see HiveMQ Cloud Authentication and Authorization.
Configure Client Authentication
-
Select the broker name on the Connect & Manage Network view and switch to the Access Management tab.
-
In the Credentials section of the Authentication area, click Add Credentials.
You can have HiveMQ generate credentials for you or add credentials manually. This guide uses the manual option. For more information, see Access Credentials. -
Enter a username, password, and password confirmation, and select a Role, then click Add.
In HiveMQ Starter plan and above, permissions are tied to roles. When you assign one or more roles to an access credential, clients that connect to your broker with the access credential can perform all activities that the permissions associated with the roles allow.
To get you started, HiveMQ provides a default Allow All role. For more information, see Role Based Access Control.
| When you create or edit a credential, the Credentials area automatically adjusts to display your changes. All currently available MQTT access credentials for the selected broker are listed in the Credentials area of the Access Management tab. For more information, see HiveMQ Cloud Authentication and Authorization. |
Configure Client Authorization
The HiveMQ Cloud Starter plan uses permissions and roles to control the actions that MQTT clients can perform on your HiveMQ Cloud broker.
To authorize an MQTT client to perform specific actions on your HiveMQ Cloud broker, you assign the MQTT client a role that contains the desired set of permissions. You can define and attach one or more permissions to a role. For more information, see Permission Management.
By default, your HiveMQ Cloud Starter broker contains a predefined Allow All role that includes the default permissions and additional MQTT-specific permissions.
This guide uses the default Allow All role.
To learn how to restrict the access of MQTT clients to your broker, see Create Permissions and Custom Roles.
Test Your New HiveMQ Cloud Broker
After you create your MQTT credentials, you are ready to connect some MQTT clients and explore basic MQTT functionality.
This guide walks you through two ways to try out the connection to your HiveMQ Cloud instance:
Pub/Sub Test with the HiveMQ WebSocket Client
Your HiveMQ Cloud Starter broker supports MQTT over WebSocket on port 8884.
The graphical view of the public WebSocket client provides a convenient way to explore and experiment with MQTT functionality.
Access the HiveMQ WebSocket Client
To get started with the HiveMQ WebSocket Client, switch to the Troubleshooting tab on your HiveMQ Cloud broker details. Then click Test your connection.
Connect to Your HiveMQ Cloud Broker
-
In the Connection Settings area, enter the credentials you want to use for the web client connection.
You can use one of the credentials listed on your Access Management tab or create a new set of automatically generated connection credentials.
-
To connect with credentials that you previously created, enter one of your active credentials and click Connect to establish the connection.
-
Alternatively, HiveMQ can generate credentials for the connection. To use generated credentials, select Connect with autogenerated credentials.
-
If you selected the Connect with autogenerated credentials option, a dialog opens with your autogenerated username and password.
Record your new credential information in a secure location, and click Connect to establish the connection.
-
-
-
Upon connection, the screen adjusts to show a Web Client is connected banner.
Pub/Sub Test with the HiveMQ Web Client
After you connect the Web Client to your broker, you can test that messages route correctly through your broker.
-
In the Topic Subscriptions area of the Test your connection page, enter the wildcard topic
#to subscribe to all MQTT topics routed through the broker. Then click Subscribe. The default Quality of Service (QoS) levelQoS 0is suitable for this test.
-
In the Send Message area, enter the destination topic, the desired message payload, and quality of service level (QoS). For example, enter
Test message payloadin the Message field, andweb-client-testin the Topic field. The default QoS level is 0.
-
To publish the message to your HiveMQ Cloud broker, click Send Message.
In the Messages area of the Test your connection page, the topic, QoS level, and message payload display immediately.
You can also generate a test message from the Messages area of the Test your connection page. In the Messages area, click Send a test message. HiveMQ automatically generates a message with the topic Hello, QoS: 0, and the payloadMQTT.
For more information on MQTT over WebSockets, see the HiveMQ MQTT Essentials special edition on WebSockets.
Pub/Sub Test with the MQTT CLI
| This guide uses the MQTT CLI for ease of use and to simplify the explanation of this example procedure. However, you are free to use whichever tool and method you prefer. |
Connect an MQTT Client
-
To start the MQTT CLI in shell mode, open a terminal window and enter the following command:
mqtt shellThe MQTT CLI starts and shows a list of options and commands.
-
To connect to your HiveMQ Cloud broker, enter the following command:
con --host <broker-url> --port 8883 --secure --user <username> --password <password>Replace the placeholders with your own values:
-
<broker-url>: The URL of your broker, from the Overview tab of your broker details. -
<username>and<password>: The access credentials that you created on the Access Management tab.The
--secureoption opens a TLS connection with the default TLS configuration. HiveMQ Cloud accepts only TLS connections.The MQTT CLI shows information about the connection. This client is your first connected MQTT client.
-
-
To create a second client, open a second terminal window, and keep the first window open.
-
In the second window, enter
mqtt shell, and then enter the sameconcommand as before.This client is your second connected MQTT client.
Publish/Subscribe Test
-
In the terminal window of the second client, enter the following command:
sub --topic testTopic --stayThe second client subscribes to all messages on the topic
testTopic. The--stayoption keeps the console open, so the client shows each incoming message. -
In the terminal window of the first client, enter the following command:
pub --topic testTopic --message "Hello"The first client publishes the message
Helloto the topictestTopic. The message appears immediately in the terminal window of the second client. -
To publish another message, enter the following command in the first window:
pub --topic testTopic --message "Goodbye"The message
Goodbyeappears in the terminal window of the second client.The MQTT CLI also accepts short options. In the concommand,-sis short for--secure. In thesubcommand,-sis short for--stay. == Next Steps
After you connect your first MQTT clients with your HiveMQ Cloud broker and exchange your first MQTT messages, you are ready to scale up and dive deeper.
To learn more about HiveMQ Cloud features and applications, visit our informative blog: