Google Cloud IoT Core is being retired on August 16, 2023. Contact your Google Cloud account team for more information.

Getting started

This page walks you through the setup steps required to use Cloud IoT Core and introduces you to some key concepts.

(If you've completed the Quickstart, you've already done some of these steps. Review this page to make sure you're ready to use Cloud IoT Core.)

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.

  4. Enable the Cloud IoT API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.

  7. Enable the Cloud IoT API.

    Enable the API

Set up the Google Cloud CLI and gcloud

  1. Install the Google Cloud CLI. Cloud IoT Core requires version 173.0.0 or higher of the gcloud CLI.

  2. Run the following command to update the gcloud CLI that's included in the SDK:

    gcloud components update
    

    If you're using a Compute Engine VM with the default installation of gcloud, you won't be able to update the components. To enable Cloud IoT Core on a Compute Engine VM, reinstall gcloud CLI by running the following commands:

    sudo apt-get remove google-cloud-sdk
    curl https://sdk.cloud.google.com | bash
    exec -l $SHELL
    gcloud init
    

For more details, see the reference documentation for the gcloud iot commands.

Introduction to Cloud IoT Core

This section summarizes the key features of Cloud IoT Core. For more information, see the Cloud IoT Core Overview and the other pages in the Concepts section.

Device registration

In order for a device to connect, it must first be registered with Cloud IoT Core. Registration consists of adding a device to a collection (the registry) and defining some essential properties. You can register a device with Cloud Platform Console, gcloud commands, or the REST-style API. For details, see Creating Registries and Devices.

Collectively, the features that allow you to register, monitor, and configure devices are called the device manager.

Protocols (MQTT and HTTP)

Cloud IoT Core supports two protocols for device connection and communication: MQTT and HTTP. Devices communicate with Cloud IoT Core across a "bridge" — either the MQTT bridge or the HTTP bridge. When you create a device registry, you select protocols to enable: MQTT, HTTP, or both.

MQTT is a standard publish/subscribe protocol that is frequently used and supported by embedded devices, and is also common in machine-to-machine interactions.

HTTP is a "connectionless" protocol: with the HTTP bridge, devices do not maintain a connection to Cloud IoT Core. Instead, they send requests and receive responses.

For details, see Using the MQTT Bridge and Using the HTTP Bridge.

Device authentication

Cloud IoT Core uses public key (or asymmetric) authentication:

  • The device uses a private key to sign a JSON Web Token (JWT). The token is passed to Cloud IoT Core as proof of the device's identity.
  • The service uses the device public key (uploaded before the JWT is sent) to verify the device's identity.

For details, see the sections on creating key pairs, using JWTs, and device security in general.

Device control from the cloud

With Cloud IoT Core, you can control a device by modifying its configuration. A device configuration is an arbitrary, user-defined blob of data that may or may not be structured. If your devices use MQTT, configurations are automatically propagated to them. If your devices connect over HTTP, they must explicitly request configurations.

For details, see the section on configuring devices.

What's next