---
schema_version: "1"
id: bd2517193375ffe5750021305c58be8e0bedd65f4f5e352c96d64b78bbc804d1
title: Getting Started with Managed Omni Gateway on CloudHub 2.0
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/gateway-managed-getting-started.md
canonical_url: https://docs.mulesoft.com/gateway/latest/gateway-managed-getting-started
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4b6df3db5d0108f6a83c0decdd0706f72b5e42584b37713c22939c015d964477
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
---

# Getting Started with Managed Omni Gateway on CloudHub 2.0

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Get started with Anypoint Managed Omni Gateway on CloudHub 2.0. Create and deploy a Managed Omni
Gateway, publish an API, and secure the API with a basic authentication policy.

## Before You Begin

Before getting started with Omni Gateway, complete these steps:

- Review the [Requirements and Limits for Omni Gateway](https://docs.mulesoft.com/gateway/latest/review-prerequisites) and verify that you
  have the necessary Managed Omni Gateway permissions.

- Create a private space in CloudHub 2.0 or verify that you can access an existing private space. To
  create a private space, see [Creating Private Spaces](https://docs.mulesoft.com/cloudhub-2/ps-create-configure).

## Deploy a Managed Omni Gateway

1.  From Anypoint Platform, select **Runtime Manager**.

2.  Click **Omni Gateways** in the sidebar.

3.  Click **Managed Omni Gateway**.

4.  Click **Add Managed Omni Gateway**.

5.  Enter a **Gateway name**.

6.  Select a your private space as your **Deployment target**.

7.  Click **Advanced options**.

8.  Copy and save the Managed Omni Gateway public endpoint for later testing. This is the HTTP or
    HTTPs URL that appears in the **Public endpoint** UI block, for example,
    `[https://my-gateway-abc123.edf456.us-east1.anypoint.mulesoft.com/](https://my-gateway-abc123.edf456.us-east1.anypoint.mulesoft.com/)`.

9.  Click **Save & deploy**.

    The UI returns to the dashboard of your new Managed Omni Gateway.

10. Wait until your gateway’s **Status** is **Running**.

## Publish a Simple API

1.  From your Managed Gateway’s dashboard, click **Add API instance**.

2.  From the **Add API** page, select **Omni Gateway** as your runtime.

3.  Select your deployed Managed Omni Gateway in the **Select a gateway** section.

4.  Click **Next**.

5.  Click **Create New API**.

6.  Specify an API name and select **HTTP API** as the asset type.

7.  Click **Next**.

8.  Don’t configure any downstream options.

9.  Click **Next**.

10. From the **Upstream** page:

    1.  Enter this URL in the **Upstream URL** field:

        ```none
        https://jsonplaceholder.typicode.com/
        ```

11. Click **Next**.

12. Click **Save & Deploy**.

    The UI takes you to the **API Summary** page of the newly created API instance.

    All HTTP requests made to the public endpoint are now proxied to the `jsonplaceholder` service.

13. To test the API instance, replace the public endpoint placeholder and run this command in a new
    terminal window:

    ```ssh
    curl -s -o /dev/null -w "%{http_code}\n" --request GET '<publicEndpoint>'
    ```

    The command executes a `GET` request to the API, and then prints the resulting `200` status
    code, indicating success.

## Secure Your API Using the Basic Authentication Policy

1.  From the **API Summary** page, select **Policies** from the side navigation panel.

2.  In the **Policies** page, click **Add inbound policy**.

3.  Select the **Basic Authentication - Simple** policy.

4.  Click **Next**.

5.  For **User Name**, enter `user`.

6.  For **User Password**, enter `password`.

7.  Click **Apply**.

8.  To test the API Instance _without_ authentication, replace the public endpoint placeholder and
    run this command in the terminal window:

    ```ssh
    curl -s -o /dev/null -w "%{http_code}\n" --request GET '<publicEndpoint>'
    ```

    The command prints a resulting `401 (Unauthorized)` status code, because the request does not
    include the Authentication context.

9.  To test the API Instance _with_ authentication, replace the public endpoint placeholder and run
    this command in the terminal window:

    ```ssh
    curl -s -o /dev/null -w "%{http_code}\n" --request GET '<publicEndpoint>' -u user:password
    ```

    > [!NOTE] The `user` and `password` parameters must match what was specified when you applied
    > the policy via **API Manager**.

    The command prints the resulting `200` status code, indicating success.

## Next Steps

- [Requirements and Limits for Omni Gateway](https://docs.mulesoft.com/gateway/latest/review-prerequisites)

- [Setting Up Self-Managed Omni Gateway](https://docs.mulesoft.com/gateway/latest/gateway-set-up)
