> Source: https://docs.cyberelements.io/bastion/4.6/Installation/Docker/EdgeGateway/

# Installation of the Edge Gateway Docker

## Importing the Docker image

Before you can create a Docker Edge Gateway container, you must import the Docker image. To do this, launch a shell from which the Docker commands are available to you, as well as the `cleanroom-gateway-4.6.1-33-v4.tgz` file. From the shell, run the following command, adjusting the path to the `TGZ` file if it is not in the current directory:

```
1
```

Then check that the import was successful with the following command:

```
1
```

The expected output is as follows (the SHA256 ID may vary depending on the operating system on which Docker is installed; the examples are from Debian 13). If this is not the case, then the import has failed:

```
1
2
3
4
5
6
```

> **Complete output**
>
> ```
>  1
>  2
>  3
>  4
>  5
>  6
>  7
>  8
>  9
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> 17
> 18
> 19
> 20
> 21
> 22
> 23
> 24
> 25
> 26
> 27
> 28
> 29
> 30
> 31
> 32
> 33
> 34
> 35
> 36
> 37
> 38
> 39
> 40
> 41
> 42
> 43
> 44
> 45
> 46
> 47
> 48
> 49
> 50
> 51
> 52
> 53
> 54
> 55
> 56
> 57
> 58
> 59
> 60
> 61
> 62
> 63
> 64
> 65
> 66
> 67
> 68
> 69
> 70
> 71
> 72
> 73
> 74
> 75
> 76
> 77
> 78
> 79
> 80
> 81
> 82
> 83
> ```

## Container configuration

### Environment variables

#### Variables for deployment by pairing

| Name | Mandatory | Default value | Comment |
|---|---|---|---|
| `ENV_MEDIATION` | YES |  | Used for pairing connection. DNS name or IP address for connection to the web interface of a CyberElements Bastion platform. |
| `ENV_TOKEN` | YES |  | Used for pairing connection. Indication of the pairing token to be used for connection to the Mediation Controller. |
| `ENV_NO_CHECK_CERT` | NO | `false` | Used for pairing connections. Whether or not to disable Mediation Controller web certificate checking, useful with CyberElements Bastion when accessing via IP address or when the web certificate is not a certificate recognized by the default public certification authorities. Accepted values: `true` or `false`. |

#### Variables for manual deployment

| Name | Mandatory | Default value | Comment |
|---|---|---|---|
| `ENV_GW_CERT_NAME` | YES |  | Used for connection with manual configuration. Name of the certificate file for connecting to the SSL Router. |
| `ENV_GW_CERT_PASSWORD` | YES |  | Used for connection with manual configuration. Certificate file password for connection to the SSL Router. |
| `ENV_CARE_CERT_NAME` | NO | Value of `ENV_GW_CERT_NAME` | Used for connection with manual configuration. Name of the certificate file for the recording service. |
| `ENV_CARE_CERT_PASSWORD` | NO | Value of `ENV_GW_CERT_PASSWORD` | Used for connection with manual configuration. Password for the recording service certificate file. |
| `ENV_SSL_ROUTER_IP` | YES |  | Used for connection with manual configuration. IP address or DNS name of the SSL router to which the Edge Gateway will connect. |
| `ENV_SSL_ROUTER_PORT` | NO | `443` | Used for connection with manual configuration. Port on the SSL Router to which the Edge Gateway will connect. |

#### Various variables

| Name | Mandatory | Default value | Comment |
|---|---|---|---|
| `ENV_DISABLE_RSYSLOG` | NO | `false` | Service deactivation `rsyslog`. Accepted values: `true` or `false`. |
| `ENV_KERBEROS_CONFIG_ENABLE` | NO | `false` | Enable Kerberos settings to allow RDP applications to authenticate in agentless mode using Kerberos. Accepted values: `true` or `false`. If `false` the other Kerberos variables will be ignored. |
| `ENV_KERBEROS_DEFAULT_REALM` | YES (if Kerberos configuration is enabled) |  | Kerberos realm name. |
| `ENV_KERBEROS_DEFAULT_DOMAIN` | YES (if Kerberos configuration is enabled) |  | Kerberos domain name. |
| `ENV_KERBEROS_CONTROLLER_ADDRESS` | YES (if Kerberos configuration is enabled) |  | Connection address to the Kerberos controller. |

### Volumes

| Volume | Comment |
|---|---|
| `/etc/ipdiva/` | Edge Gateway configuration volume. We recommend mounting it on a named volume or on the host machine's file system. |
| `/opt/certificates/` | Volume containing the Edge Gateway certificate(s) in a configuration without pairing. |
| `/var/lib/ipdiva/carerecord/archives/` | Volume containing the graphic archives. We recommend mounting it on a named volume or on the host machine's file system. |
| `/var/ipdiva/care/sshrecord/` | Volume containing the SSH archives. We recommend mounting it on a named volume or on the host machine's file system. |
| `/var/log/` | Volume containing the Edge Gateway logs. |

### Ports

| Port | Comment |
|---|---|
| `2222` (or any other available port chosen by the administrator) | Listening port for the SSH/SFTP direct access service. |
| `3389` | Listening port for the RDP direct access service. |
| `8443` | Listening port for the recording service, to be exposed when using the Windows recording agent. |

## Deployment of the Edge Gateway Docker

### Deployment with pairing

> **Prerequisites**
>
> Before deploying the Edge Gateway Docker, you must [obtain a pairing token](https://docs.cyberelements.io/bastion/4.6/Usage/Configuration/AdminConsole/CreatePairingTokenForEdgeGateway/).

The deployment described below will use all available volumes (except `/opt/certificates/` that is not useful in this context) and expose all ports.
The volumes will be mounted on the host machine's file system with the location `EDGE_GATEWAY_REP`. Inside this location are the following subdirectories:

- config
- graphical_archives
- ssh_archives
- log

You can customize the variables for the following commands:

| Custom value | Variable | Comment |
|---|---|---|
|  | `DOCKER_NAME` | Name of the Docker container. |
|  | `EDGE_GATEWAY_REP` | Location on the file system to mount the volumes. |
|  | `ENV_MEDIATION_VALUE` | Value of the `ENV_MEDIATION` [environment variable](#environment-variables). |
|  | `ENV_TOKEN_VALUE` | Value of the `ENV_TOKEN` [environment variable](#environment-variables). |
|  | `ENV_NO_CHECK_CERT_VALUE` | Value of the `ENV_NO_CHECK_CERT` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_CONFIG_ENABLE_VALUE` | Value of the `ENV_KERBEROS_CONFIG_ENABLE` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_DEFAULT_REALM_VALUE` | Value of the `ENV_KERBEROS_DEFAULT_REALM` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_DEFAULT_DOMAIN_VALUE` | Value of the `ENV_KERBEROS_DEFAULT_DOMAIN` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_CONTROLLER_ADDRESS_VALUE` | Value of the `ENV_KERBEROS_CONTROLLER_ADDRESS` [environment variable](#environment-variables). |

Create the directory tree required for mounting volumes on the file system:

**Bash**

> ```
> 1
> 2
> 3
> 4
> ```

**PowerShell**

> ```
> 1
> ```

And finally, start a new container:

**Bash**

> ```
>  1
>  2
>  3
>  4
>  5
>  6
>  7
>  8
>  9
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> ```

**PowerShell**

> ```
>  1
>  2
>  3
>  4
>  5
>  6
>  7
>  8
>  9
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> ```

The container logs can be viewed using the following command:

```
1
```

### Manual deployment

> **Prerequisites**
>
> Before deploying the Edge Gateway Docker, you must have the required certificates for the Edge Gateway and the recording service.

> **Passwords visible with `docker inspect`**
>
> The environment variables of a container, certificate passwords included, remain readable by anyone allowed to run `docker inspect` on the Docker server. The [deployment with pairing](#deployment-with-pairing), which uses no certificate password, should therefore be preferred.

The deployment described below will use all available volumes and expose all ports.
The volumes will be mounted on the host machine's file system with the location `MANUAL_REP`. Inside this location are the following subdirectories:

- config
- graphical_archives
- ssh_archives
- log
- certificates

You can customize the variables for the following commands:

| Custom value | Variable | Comment |
|---|---|---|
|  | `MANUAL_NAME` | Name of the Docker container. |
|  | `MANUAL_REP` | Location on the file system to mount the volumes. |
|  | `ENV_GW_CERT_NAME_VALUE` | Value of the `ENV_GW_CERT_NAME` [environment variable](#environment-variables). |
|  | `ENV_CARE_CERT_NAME_VALUE` | Value of the `ENV_CARE_CERT_NAME` [environment variable](#environment-variables). |
|  | `ENV_SSL_ROUTER_IP_VALUE` | Value of the `ENV_SSL_ROUTER_IP` [environment variable](#environment-variables). |
|  | `ENV_SSL_ROUTER_PORT_VALUE` | Value of the `ENV_SSL_ROUTER_PORT` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_CONFIG_ENABLE_MANUAL_VALUE` | Value of the `ENV_KERBEROS_CONFIG_ENABLE` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_DEFAULT_REALM_MANUAL_VALUE` | Value of the `ENV_KERBEROS_DEFAULT_REALM` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_DEFAULT_DOMAIN_MANUAL_VALUE` | Value of the `ENV_KERBEROS_DEFAULT_DOMAIN` [environment variable](#environment-variables). |
|  | `ENV_KERBEROS_CONTROLLER_ADDRESS_MANUAL_VALUE` | Value of the `ENV_KERBEROS_CONTROLLER_ADDRESS` [environment variable](#environment-variables). |

Create the directory tree required for mounting volumes on the file system:

**Bash**

> ```
> 1
> 2
> 3
> 4
> 5
> ```

**PowerShell**

> ```
> 1
> ```

Then place the certificates for the Edge Gateway and the recording service in `MANUAL_REP/certificates`.

So that the certificate passwords are not kept in the shell history, enter them in environment variables of the current session (the input is not displayed):

**Bash**

> ```
> 1
> 2
> 3
> ```

**PowerShell**

> ```
> 1
> 2
> ```

Finally, start a new container:

**Bash**

> ```
>  1
>  2
>  3
>  4
>  5
>  6
>  7
>  8
>  9
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> 17
> 18
> 19
> 20
> ```

**PowerShell**

> ```
>  1
>  2
>  3
>  4
>  5
>  6
>  7
>  8
>  9
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> 17
> 18
> 19
> 20
> ```

Once the container has started, remove these variables from the session:

**Bash**

> ```
> 1
> ```

**PowerShell**

> ```
> 1
> ```

The container logs can be viewed using the following command:

```
1
```
