# Run the Trust1Gateway as a Container

We've made running the Trust1Gateway and all of its components as a Docker container a cinch for you.

## Prerequisites

* If you aren't familiar with Docker, or haven't installed it yet, visit [Docker's Guide](https://docs.docker.com/install/) and read up on it/install the appropriate version for your OS.
* In order to function, the Trust1Gateway Docker Container requires the following ports to be available at a minimum:
  * 28080
  * 8000
  * 3000
  * 3003

## Getting the Trust1Gateway Docker Container Running

**1**. Head on over to the [Trust1Gateway Docker Hub](https://hub.docker.com/r/trust1team/trust1gateway-with-ui/)\
**2**. Take a look at the \`Tags\` tab to see what versions are available:

![](https://4235119821-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9iuwg0BMqcPp9J4NHu%2F-L9ixn3s4uBQyT4_WXVm%2F-L9j5_OGRO5ZPDXdYwcP%2Fdocker-hub-tags.png?alt=media\&token=3d6bba58-e672-4d1a-ab25-3c457c3f726d)

**3**. Pull the container to your machine by copy pasting the `pull` command below (or from Docker Hub)

```bash
docker pull trust1team/trust1gateway-with-ui
```

![](https://4235119821-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9iuwg0BMqcPp9J4NHu%2F-L9ixn3s4uBQyT4_WXVm%2F-L9j5nrUacKhYUnloVan%2Fdocker-hub-pull.png?alt=media\&token=acd933b2-e435-44a6-be5c-b8729d3a031b)

By default Docker will pull the version tagged as `latest`, but you can specify a different version if you wish.&#x20;

In your console terminal or command prompt, you'll see something like this:

![](https://4235119821-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9iuwg0BMqcPp9J4NHu%2F-L9ixn3s4uBQyT4_WXVm%2F-L9j63y2whHKHmFaLPbm%2Fdocker-terminal-pull.png?alt=media\&token=8da7e879-865e-440d-ab77-4f3c0ab6bb19)

**4**. Once the image is downloaded, run it as a container by executing the following command:

```bash
docker run -dit -p 127.0.0.1:5433:5432 -p 127.0.0.1:8443:8443 -p 127.0.0.1:8000:8000 -p 127.0.0.1:8001:8001 -p 127.0.0.1:28080:28080 -p 127.0.0.1:28443:28443 -p 127.0.0.1:29990:29990 -p 127.0.0.1:29993:29993 -p 127.0.0.1:3000:3000 -p 127.0.0.1:3003:3003 --name t1g-ui trust1team/trust1gateway-with-ui
```

We'll briefly explain what the command line options mean:

| **Option**                             | **Example**                            | **Description**                                                                                                                                                                |
| -------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `run`                                  | `run trust1team/trust1gateway-with-ui` | Run the specified image in a container                                                                                                                                         |
| `-dit`                                 | N/A                                    | Run the image in detached, interactive mode and allocate a pseudo-TTY (See [Docker documentation](https://docs.docker.com/engine/reference/commandline/run/) for more details) |
| `-p [ip]:[host port]:[container port]` | `-p 127.0.0.1:5433:5432`               | Maps an host port (i.e. the machine you are running docker in) to a port exposed by the docker container                                                                       |
| `--name [container-name]`              | `--name t1g-ui`                        | Gives a name to the container that we are about to create                                                                                                                      |

After executing the command, you should see the following:

![](https://4235119821-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9iuwg0BMqcPp9J4NHu%2F-L9ixn3s4uBQyT4_WXVm%2F-L9jBNIaP55jOtnYebnT%2Fdocker-terminal-run.png?alt=media\&token=dd1233e6-9222-4efb-b7cc-7ba55f8da23a)

**5**. Let's verify the container is running. We can do this by executing the following command:

```bash
docker ps -a
```

&#x20;You should see something similar to this:

![](https://4235119821-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9iuwg0BMqcPp9J4NHu%2F-L9ixn3s4uBQyT4_WXVm%2F-L9jB_-7jhG8OCAcYDAB%2Fdocker-terminal-show-containers.png?alt=media\&token=e3a37d73-70d5-44c3-b567-7c172dee07dd)

**6**. Congratulations, you are now running the entire Trust1Gateway as a Docker container. Now let's look at the next chapters to see how we can use it.
