[Yandex Cloud documentation](../index.md) > [Yandex IoT Core](index.md) > Getting started > Broker

# Getting started with Yandex IoT Core brokers

{% note warning %}

Yandex IoT Core is no longer available to new users. 

Current users can create resources until November 1, 2026. Afterwards, the service will go read-only and cease to operate on December 1, 2026. For more information on the timing and procedure, see [Service shutdown](sunset.md).

{% endnote %}

To get started with Yandex IoT Core:

1. [Create an X.509 certificate](#create-ca).
1. [Create a broker](#create-broker).
1. [Set up message exchange](#exchange).

{% note info %}

The broker is at the [Preview](../overview/concepts/launch-stages.md) stage.

{% endnote %}

## Getting started {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../billing/quickstart/index.md) and [link](../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../resource-manager/concepts/resources-hierarchy.md).

## Create a certificate for the {#create-ca} broker

If you have a certificate, add it to the broker after [creation](#create-broker). If you do not have a certificate, create it using the [OpenSSL](https://www.openssl.org) program:

   ```bash
   openssl req -x509 \
   -newkey rsa:4096 \
      -keyout private-key.pem \
      -out cert.pem \
      -nodes \
      -days 365 \
      -subj '/CN=localhost'
   ```

   Where:

   * `-x509`: Certificate type: X.509.
   * `-newkey`: Encryption algorithm.
   * `-keyout`: File with the certificate's private key.
   * `-out`: File with the certificate's public key.
   * `-nodes`: This flag is set when no public key encryption is required.
   * `-days`: Certificate validity period in days.
   * `-subj`: Request object.

## Create a broker {#create-broker}

{% list tabs group=instructions %}

- Management console {#console}

   1. In the [management console](https://console.yandex.cloud), select the folder where you want to create a broker.
   1. Navigate to **IoT Core**.
   1. In the left-hand panel, select **Brokers**.
   1. Click **Create broker**.
   1. Under **General information**, specify the broker name: `my-broker`.
   1. Add a certificate:

      * To add a file:

         1. Select the `File` method.
         1. Click **Attach file**.
         1. Select the file with the public key of the certificate and click **Open**.
         1. Click **Add**.

      * To add text:

         1. Select the `Text` method.
         1. Paste the certificate's public key to the **Content** field.
         1. Click **Add**.

   1. Click **Create**.

- CLI {#cli}

   If you do not have the Yandex Cloud CLI yet, [install and initialize it](../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

   1. Create a broker:

      ```bash
      yc iot broker create --name my-broker
      ```

      Result:

      ```text
      id: b91ki3851h**********
      folder_id: aoek49ghmk*********
      created_at: "2022-05-28T11:29:42.420Z"
      name: my-broker
      status: ACTIVE
      ```

   1. Add the certificate to the broker:

      ```bash
      yc iot broker certificate add \
         --broker-name my-broker \
         --certificate-file cert.pem
      ```

      Where:

      * `--broker-name`: Broker name.
      * `--certificate-file`: Path to the certificate's public key.

      Result:

      ```text
      broker_id: b91ki3851h**********
      fingerprint: 1f21cf6d0183d****
      certificate_data: |
         -----BEGIN CERTIFICATE-----
         MIIEpDCCAow...
         -----END CERTIFICATE-----
      created_at: "2023-07-11T16:20:53.466370019Z"
      ```

{% endlist %}

## Set up message exchange {#exchange}

1. [Subscribe to receive messages in a broker](operations/subscribe.md#broker).
1. [Send a message in a broker](operations/publish.md#broker).

## What's next {#what-is-next}

* Read about [service concepts](concepts/index.md).
* Learn how to [work with brokers](operations/index.md#broker).