

# Create a self-hosted SiteWise Edge gateway
<a name="create-gateway-ggv2"></a>

Use the AWS IoT SiteWise console or AWS CLI to create a self-hosted SiteWise Edge gateway. This procedure details how to create a self-hosted SiteWise Edge gateway that you'll install on your own hardware. For information about creating a SiteWise Edge gateway that runs on Siemens Industrial Edge, see [Host a SiteWise Edge gateway on Siemens Industrial Edge](sitewise-edge-on-siemens.md).

## Create a SiteWise Edge gateway
<a name="configure-gateway-console"></a>

------
#### [ Console ]

1. <a name="sitewise-open-console"></a>Navigate to the [AWS IoT SiteWise console](https://console.aws.amazon.com/iotsitewise/).

1. In the navigation pane, choose **Edge gateways**.

1. Choose **Create gateway**.

1. For **Choose deployment target**, choose **self-hosted gateway**.

1. Select either **MQTT-enabled, V3 gateway** or **Classic streams, V2 gateway**. For more information on each option, see [Self-host an AWS IoT SiteWise Edge gateway with AWS IoT Greengrass V2](gw-self-host-gg2.md). The MQTT-enabled, V3 gateway is recommend for it's future-ready features.

1. In the **Gateway configuration** section, enter a name for your SiteWise Edge gateway or use the name generated by AWS IoT SiteWise.

1. Under **Greengrass device OS**, select the operating system of the device where you'll install this SiteWise Edge gateway.
**Note**  
The data processing pack is only available on x86 platforms. It is only available on the Classic streams, V2 gateway

1. (Optional) To process and organize data at the edge, under **Edge capabilities**, select **Data Processing Pack**.
**Note**  
To grant user groups in your corporate directory access to this SiteWise Edge gateway, see [Set up edge capability in SiteWise Edge](edge-data-collection-and-processing.md#using-sitewise-edge) 

1. (Optional) Under **advanced configuration**, do the following:

   1. For **Greengrass core device**, choose one of the following options:
     + **Default setup** – AWS automatically uses default settings to create a Greengrass core device in AWS IoT Greengrass V2.

       1. Enter a name for the Greengrass core device or use the name generated by AWS IoT SiteWise.
     + **Advanced setup** – Choose this option if you want to use an existing Greengrass core device or to create one manually.

       1. Choose a Greengrass core device or choose **Create Greengrass core device** to create one in the AWS IoT Greengrass V2 console. For more information, see [Setting up AWS IoT Greengrass V2 core devices](https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html) in the *AWS IoT Greengrass Version 2 Developer Guide*.

1. Choose **Create gateway**.

1. In the **Generate SiteWise Edge gateway installer** dialog box, choose **Generate and download**. AWS IoT SiteWise automatically generates an installer that you can use to configure your local device.
**Important**  
You can't regenerate this file. Make sure that you save the installer file in a secure location because you'll use the file later.

------
#### [ AWS CLI ]

To create a self-hosted gateway by using the AWS CLI, provide a name for the gateway, specify the platform, and the gateway version. There are many other options that you can specify when creating a gateway. For more information, see [create-gateway](https://docs.aws.amazon.com/cli/latest/reference/iotsitewise/create-gateway.html) in the *AWS CLI Command Reference* for AWS IoT SiteWise

To use this example, replace the user input placeholders with your own information.

```
aws iotsitewise create-gateway \
    --gateway-name your-gateway-name \
    --gateway-platform greengrassV2={coreDeviceThingName=your-core-device-thing-name, coreDeviceOperatingSystem=LINUX_AMD64} \                        
    --gateway-version 3 \
    [--cli-input-json your-configuration]
```
+ `gateway-name` – A unique name for the gateway.
+ `gateway-platform` – Specifies the gateway platform configuration. For self-hosted gateways, enter `greengrassV2`. For more information, see [Options](https://docs.aws.amazon.com/cli/latest/reference/iotsitewise/create-gateway.html#options) in the create-gateway section of *AWS CLI Command Reference* for AWS IoT SiteWise.
  + `coreDeviceThingName` – The name of the AWS IoT thing for your AWS IoT Greengrass V2 core device.
  + `coreDeviceOperatingSystem` – The operating system of the core device in AWS IoT Greengrass V2. Specifying the operating system is required for `gateway-version 3` and not applicable for `gateway-version 2`. Options include: `LINUX_AARCH64`, `LINUX_AMD64`, and `WINDOWS_AMD64`
+ `gateway-version` – The version of the gateway.
  + To create an MQTT-enabled, V3 gateway, use `3` for the gateway version.
  + To create a Classic streams, V2 gateway, use `2` for the gateway version.
+ `cli-input-json` – A JSON file containing request parameters.

------

Now that you've created the SiteWise Edge gateway, [Install the AWS IoT SiteWise Edge gateway software on your local device](install-gateway-software-on-local-device.md).