> For the complete documentation index, see [llms.txt](https://docs.jcore.io/clarity-gateway/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jcore.io/clarity-gateway/installation/installing-on-3rd-party-devices/runnning-clarity-gateway-on-a-3rd-party-device.md).

# Bring Your Own Docker

Clarity Gateway runs on a wide range of devices that have a modern Linux OS and Docker runtime.

### Running with `docker compose`

Docker Compose allows you to create a short yaml configuration file that defines the container version, TCP port mappings, and volume mappings you'll be using. Create a directory for Clarity Gateway, e.g. `/opt/clarity-gateway`, and create a `compose.yaml` file inside that directory. Here's the format of a `compose.yaml` file that runs Clarity Gateway:

```yaml
services:
  clarity-gateway:
    image: jcoreio/clarity-gateway:<VERSION>
    ports:
      - <TCP PORT>:3030
    volumes:
      - <DATA DIRECTORY>:/data
```

If you choose version `10.3.1`, port `5000`, and `./data` for your data directory, your compose.yaml will look like:

```yaml
services:
  clarity-gateway:
    image: jcoreio/clarity-gateway:7.5.3
    ports:
      - 5000:3030
    volumes:
      - ./data:/data
```

{% hint style="info" %}
In the example above, `./data` is a relative path to your data directory. If your `compose.yaml` is located in `/opt/clarity-gateway`, and you choose `./data` as your data directory, the absolute path of your data directory will be `/opt/clarity-gateway/data`. You can also enter the absolute path of a data directory, e.g. `/var/clarity-gateway`.
{% endhint %}

### Running with `docker run`

When running Clarity Gateway on the command line, you'll need to choose a location for your data directory, and map that directory into your container. To use `/opt/clarity-gateway/data` as your data directory, run:

`sudo mkdir -p /opt/clarity-gateway/data`

To pull and run the Clarity Gateway container, type the following command:

`docker run --name clarity-gateway -p 3030:3030 -v <DATA DIRECTORY>:/data --restart unless-stopped -d jcoreio/clarity-gateway:<VERSION>`

If your data directory is `/var/clarity-gateway` and you want to run version `10.3.1`, the command would be:

`docker run --name clarity-gateway -p 3030:3030 -v /var/clarity-gateway:/data --restart unless-stopped -d jcoreio/clarity-gateway:10.3.1`

Check the [Clarity Gateway page on Docker Hub](https://hub.docker.com/r/jcoreio/clarity-gateway) for a list of available versions.

Run the `docker ps` command to check that Clarity Gateway is running:

```
$ docker ps
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS          PORTS                                         NAMES
e06d61cd2321   jcoreio/clarity-gateway:10.3.1   "docker-entrypoint.s…"   33 minutes ago   Up 33 minutes   0.0.0.0:3030->3030/tcp, [::]:3030->3030/tcp   clarity-gateway
```

### Accessing the Web Interface

Point your browser to `http://<DEVICE IP ADDRESS>:<PORT>` (for example, `http://192.168.1.220:3030`) to access the Clarity Gateway web interface.

The default password is `password`.

{% hint style="danger" %}
Please secure your device by changing your password immediately after starting Clarity Gateway!
{% endhint %}

After you've successfully logged in, you will see the license entry screen. Enter your license key if you have one, or click "Start Trial" to try Clarity Gateway free for 2 hours:

![](https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-81698e73f5afd7c2b1c1ee0a46a6c522eb881a1e%2F06%20License.png?alt=media)

After entering your license or starting the trial, you can get data flowing through Clarity Gateway by creating connectors:

![](https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-6c45e529081354e45e6b392d5ca91bb0fdaa68f0%2F07%20create%20connector.png?alt=media)

### Container logs

Run the `docker logs clarity-gateway`  to see the container's logs:

![](https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-6a65cfc9295df6c7e61b6f9555fb5ec1c276aafb%2F04%20docker%20logs.png?alt=media)

In the example above, the container started successfully. You can safely ignore the error message about the local I/O driver: that driver only runs on the Iron Pi, and Clarity Gateway can operate without it.
