---
name: messages-for-rabbitmq-howto-getting-connection-strings
title: Creating users and getting connection strings
description: To connect to IBM Cloud&reg; Messages for RabbitMQ, you need some users and some connection strings. Connection Strings for your deployment are displayed on the _Dashboard Overview_, in the _Endpoints_ panel.
last-updated: 2025-05-14
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/messages-for-rabbitmq?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Creating users and getting connection strings
{: #connection-strings}

To connect to IBM Cloud&reg; Messages for RabbitMQ, you need some users and some connection strings. Connection Strings for your deployment are displayed on the _Dashboard Overview_, in the _Endpoints_ panel.

![Endpoints panel](images/getting-started-endpoints-panel.png){: caption="Endpoints panel" caption-side="bottom"}

You can also grab connection strings from the [CLI](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-reference&format=markdown#deployment-connections) and the [API](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#getconnection).

A Messages for RabbitMQ deployment is provisioned with an admin user, and after you [set the admin password](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-user-management&interface=ui&format=markdown#user-management-set-admin-password-ui), you can use its credentials to connect to your deployment.
{: .tip}

## Credentials and connection strings for more users
{: #cred-connection-strings-additional-users}

Access to your Messages for RabbitMQ deployment is not limited to the root user. You can create users by using the _Service Credentials_ panel, the IBM CLI, or through the IBM Cloud Databases API. 

All users on your deployment can use the connection strings, including connection strings for either public or private endpoints.

Not all users get the same privileges regarding administering RabbitMQ. To read more about which users get what privileges see the [Managing Users](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-user-management&format=markdown) page.

### From the _Service Credentials_ UI
{: #cred-connection-strings-additional-users-service-cred}
{: ui}

1. Navigate to the service dashboard for your service.
2. Click _Service Credentials_ to open the _Service Credentials_ panel.
3. Click **New Credential**.
4. Choose a descriptive name for your new credential. 
5. (Optional) Specify whether the new credentials use a public or private endpoint. Use either `{ "service-endpoints": "public" }` / `{ "service-endpoints": "private" }` in the _Add Inline Configuration Parameters_ field to generate connection strings that use the specified endpoint. Use of the endpoint is not enforced. It controls which hostnames are in the connection strings. Public endpoints are generated by default.
6. Click **Add** to provision the new credentials. A username and password, and an associated RabbitMQ user is auto-generated.

The new credentials appear in the table, and the connection strings are available as JSON in a click-to-copy field under _View Credentials_.

### From the CLI
{: #cred-connection-strings-additional-users-cli}
{: cli}

If you manage your service through the IBM Cloud CLI and the [cloud databases plug-in](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli&format=markdown), you can create a new user with `cdb user-create`. For example, to create a new user for an "example-deployment", use the following command.
```sh
ibmcloud cdb user-create example-deployment <newusername> <newpassword>
```

Once the task is finished, you can retrieve the new user's connection strings with the `ibmcloud cdb deployment-connections` command.
```sh
ibmcloud cdb deployment-connections example-deployment -u <newusername> [--endpoint-type <endpoint type>]
```

Full connection information is returned by the `ibmcloud cdb deployment-connections` command with the `--all` flag. To retrieve all the connection information for a deployment named "example-deployment", use the following command.
```sh
ibmcloud cdb deployment-connections example-deployment -u <newusername> --all [--endpoint-type <endpoint type>]
```

If you don't specify a user, the `deployment-connections` commands return information for the admin user by default. If you don't specify an endpoint type, the connection string returns the public endpoint by default. If your deployment has only a private endpoint, you must specify `--endpoint-type private` or the commands return an error. The user and endpoint type is not enforced. You can use any user on your deployment with either endpoint (if both exist on your deployment).

To use the `ibmcloud cdb` CLI commands, you must [install the Cloud Databases plug-in](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-icd-cli&format=markdown#icd-cli-install).
{: .tip}

### From the API
{: #cred-connection-strings-additional-users-api}
{: api}

The _Foundation Endpoint_ that is shown on the _Overview_ panel of your service provides the base URL to access this deployment through the API. To create and manage users, use the base URL with the `/users` endpoint.

```sh
curl -X POST 'https://api.{region}.databases.cloud.ibm.com/v4/ibm/deployments/{id}/users' \
-H "Authorization: Bearer $APIKEY" \
-H "Content-Type: application/json" \
-d '{"username":"jane_smith", "password":"newsupersecurepassword"}'
```

To retrieve user's connection strings, use the base URL with the `/users/{userid}/connections` endpoint. You must specify in the path which user and which type of endpoint (public or private) is used in the returned connection strings. The user and endpoint type is not enforced. You can use any user on your deployment with either endpoint (if both exist on your deployment).

```sh
curl -X GET -H "Authorization: Bearer $APIKEY" 'https://api.{region}.databases.cloud.ibm.com/v4/ibm/deployments/{id}/users/{userid}/connections/{endpoint_type}'
```

### Adding users to _Service Credentials_ 
{: #adding-users-service-cred}

Creating a new user from the CLI or API doesn't automatically populate that user's connection strings into _Service Credentials_. If you want to add them there, you can create a new credential with the existing user information.

Enter the username and password in the JSON field _Add Inline Configuration Parameters_, or specify a file where the JSON information is stored. For example, `{"existing_credentials":{"username":"Robert","password":"supersecure"}}`.

Generating credentials from an existing user does not check for or create that user.
{: tip}

## Connection string breakdown
{: #connection-strings-breakdown}

### The `amqps` section
{: #amqps-section}

The "amqps" section contains information that is suited for your applications that make connections to RabbitMQ.

| Field name | Index | Description |
| ----------|-----|----------- |
| `Type` | | Type of connection - for RabbitMQ, it is "uri". |
| `Scheme` | | Scheme for a URI - for RabbitMQ, it is "amqps". |
| `Path` | | Path for a uri. |
| `Authentication` | `Username` | The username that you use to connect. |
| `Authentication` | `Password` | A password for the user - might be shown as `$PASSWORD`. |
| `Authentication` | `Method` | How authentication takes place; "direct" authentication is handled by the driver. |
| `Hosts` | `0...` | A hostname and port to connect to. |
| `Composed` | `0...` | A URI combining Scheme, Authentication, Host, and Path. |
| `Certificate` | `Name` | The allocated name for the service proprietary certificate for database deployment. |
| `Certificate` | `Base64`|A base64 encoded version of the certificate. |
{: caption="RabbitMQ/uri connection information" caption-side="top"}

* `0...` indicates that there might be one or more of these entries in an array.

For more information on using this information to connect, see the [Connecting an External Application](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-external-app&format=markdown) page.

### The `stomp_ssl` section
{: #stomp_ssl-section}

The `stomp_ssl` section contains the information that a STOMP client needs to connect to your deployment.

| Field name | Index | Description  |
| ---------- | ----- | ----------- |
| `Type` | | Type of connection - for STOMP, it is `stomp`. |
| `Authentication` | `Username`|The username that you use to connect. |
| `Authentication` | `Password`|A password for the user - might be shown as `$PASSWORD`. |
| `Authentication` | `Method`|How authentication takes place; "direct" authentication is handled by the driver. |
| `Hosts` | `0...` | A hostname and port to connect to, also contains the protocol name "stomp-ssl". |
| `Composed` | `0...` | A URI combining Authentication, Host, and TLS/SSL. |
| `ssl` | | The TLS/SSL setting needed for a connection. Should always be `true`. |
| `Certificate` | `Name` | The allocated name for the service proprietary certificate for database deployment. |
| `Certificate` | `Base64` | A base64 encoded version of the certificate. |
{: caption="RabbitMQ/stomp_ssl connection information" caption-side="top"}

* `0...` indicates that there might be one or more of these entries in an array.

### The `mqtts` section
{: #mqtts-section}

The `mqtts` section contains the information that an MQTT client needs to connect to your deployment.

| Field name | Index | Description |
| ---------- | ----- | ----------- |
| `Type` | | Type of connection - for `MQTTS` it is `uri`. |
| `Scheme` | | Scheme for a URI - in this case it is `mqtts`. |
| `Authentication` | `Username` | The username that you use to connect. |
| `Authentication` | `Password` | A password for the user - might be shown as `$PASSWORD`. |
| `Authentication` | `Method` | How authentication takes place; "direct" authentication is handled by the driver. |
| `Hosts` | `0...` | A hostname and port to connect to. |
| `Composed` | `0...` | A URI combining Authentication, Host, and Port used to connect. |
| `Certificate` | `Name` | The allocated name for the service proprietary certificate for database deployment. |
| `Certificate` | `Base64` | A base64 encoded version of the certificate. |
{: caption="RabbitMQ/mqtts connection information" caption-side="top"}

* `0...` indicates that there might be one or more of these entries in an array.

### The CLI and https sections
{: #cli-https-section}

The `CLI` section contains information that is suited for the management plug-in and command-line clients that make connections to RabbitMQ.

| Field name | Index | Description |
| ---------- | ----- | ----------- |
| `Bin` | | The recommended binary to create a connection; in this case it is `rabbitmqadmin`. |
| `Composed` | | A formatted command to establish a connection to your deployment. The command combines the `Bin` executable, `Environment` variable settings, and uses `Arguments` as command-line parameters. |
| `Environment` | | A list of key/values you set as environment variables. |
| `Arguments` | `0...` | The information that is passed as arguments to the command shown in the Bin field. |
| `Certificate` | `Base64` | A service proprietary certificate that is used to confirm that an application is connecting to the appropriate server. It is base64 encoded. |
| `Certificate` | `Name` | The allocated name for the service proprietary certificate. |
| `Type` | | The type of package that uses this connection information; in this case `cli`.  |
{: caption="rabbitmqadmin/cli connection information" caption-side="top"}

* `0...` indicates that there might be one or more of these entries in an array.

The `https` section contains information that you can use to access the RabbitMQ management plug-in via web browser.

| Field name|Index|Description |
| ---------- | ----- | ----------- |
| `Type` | | Type of connection - for RabbitMQ, it is `uri`. |
| `Scheme` | | Scheme for a URI - for RabbitMQ, it is `https`. |
| `Path` | | Path for a URI. |
| `Authentication` | `Username`|The username that you use to connect. |
| `Authentication` | `Password`|A password for the user - might be shown as `$PASSWORD`. |
| `Authentication` | `Method`|How authentication takes place; "direct" authentication is handled by the driver. |
| `Hosts` | `0...` | A hostname and port to connect to. |
| `Composed` | `0...` | A URI combining Scheme, Authentication, Host, and Path. |
| `Certificate` | `Name` | The allocated name for the service proprietary certificate for database deployment. |
| `Certificate` | `Base64` | A base64 encoded version of the certificate. |
{: caption="https/uri connection information" caption-side="top"}

* `0...` indicates that there might be one or more of these entries in an array.

For more information, see [Connecting with the RabbitMQ Management plug-in](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-rabbitmq-management-plugin&format=markdown).