> Source: https://docs.cyberelements.io/bastion/4.7/no/Installation/BrowserIsolationDockerServer/

# Installation of the Browser Isolation Docker server from scratch

This page describes the installation of the Browser Isolation Docker server on a Debian 13 machine, then its declaration in the administration console. The role of the server and its installation modes are presented in [Installation of the Browser Isolation Docker server](https://docs.cyberelements.io/bastion/4.7/no/Installation/BrowserIsolation/Introduction/), its prerequisites in [Prerequisites of the Browser Isolation Docker server](https://docs.cyberelements.io/bastion/4.7/no/Installation/BrowserIsolation/Prerequisites/).

## Preparing the platform

### Enabling Browser Isolation

Browser Isolation is a product option, disabled at installation. On **each** Mediation Controller (both nodes of a cluster), set the `isolate_enabled` key of the `[resource]` section of the `/etc/ipdiva/care/djangosettings.ini` file to `True`, as `root`:

```
1
2
```

Then apply the change:

```
1
```

The administration console then shows the **Virtual machine hosts** tile, which gives access to the **Container or virtualization hosts** and **Image templates** modules, and offers the Isolate (Web) application type: see [`[resource]` section of djangosettings.ini](https://docs.cyberelements.io/bastion/4.7/no/Usage/Reference/ConfigurationFiles/MediationController/DjangoSettings/#resource).

### Site of the Edge Gateways

The Edge Gateways that launch the Isolate applications belong to a [site](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/SitesAndGateways/Sites/): the Mediation Controller reaches the Docker server through them, and the access contracts that grant the Isolate (Web) applications reference this site. Create it beforehand if needed.

### Preparing the Edge Gateways

The recording of the URLs visited in the privileged Isolate (Web) applications goes through the `isoweb` Apache site of the Edge Gateways. On each Edge Gateway allowed to launch the Isolate applications, as `root`:

1. By default, Apache listens on the `127.0.0.1` address only on the Edge Gateways. In the `/etc/apache2/ports.conf` file, add under each `Listen 127.0.0.1:443` line a line with the address of the Edge Gateway:

   | Value | Variable | Definition |
   |---|---|---|
   |  | `IP_GW` | IP address of the Edge Gateway server. |

   ```
   1
   ```

   Then check the configuration and restart Apache:

   ```
   1
   2
   ```
2. Check that the `isoweb` site is enabled:

   ```
   1
   ```

   The site is enabled at the installation of the Edge Gateway only if its recording certificate is already in place. If the file is absent (certificate applied afterwards, for example by hand), extract the certificate for Apache and enable the site:

   ```
   1
   2
   3
   ```

## Package

The installation package of the Docker server is available in the **Toolbox** of the administration console, on the **Isolate Engine (DEB) - Debian 13** line (`cleanroom-vdi-isolate-engine_<version>.deb`), displayed once Browser Isolation is [enabled](#enabling-browser-isolation): [Toolbox](https://docs.cyberelements.io/bastion/4.7/no/Usage/Reference/AdminConsole/Toolbox/).

## Installation

> **Note**
>
> As a reminder, switching to `root` on Debian machines must be done with the following command:
>
> ```
> 1
> ```

### Preparing the system

Configure the static IP address and the name of the machine, then disable the installation of unnecessary packages and update the system as `root`:

```
1
2
3
```

Check that the full name of the machine is the one by which the Mediation Controller and the Edge Gateways will reach it:

```
1
```

### Installing the package

Send the `cleanroom-vdi-isolate-engine_<version>.deb` file to the `/tmp/` directory of the server with an SCP client, then install it as `root`. APT installs at the same time its dependencies taken from the Debian repositories (Docker, PostgreSQL, Apache2):

```
1
```

During the first installation, the package:

- creates a local PostgreSQL database, used by the Docker server only;
- installs its Python components (access to `pypi.org` required);
- generates the **API key** of the Docker server;
- generates a self-signed **TLS certificate**, valid for 10 years, for the name and the IP addresses of the machine;
- enables the Apache2 site of the API, listening on TCP port `56654` in TLS only, and starts the `cleanroom-vdi-isolate-engine-scheduler` service.

> **Note the API key**
>
> At the end of the first installation, the API key is displayed between two lines of dashes, under `IMPORTANT: Your API Key (save this securely)`. It is required to declare the Docker server in the administration console. It remains readable afterwards, as `root`, on the `API_KEY` line of the `/etc/ipdiva/cleanroom-vdi-isolate-engine/djangosettings.env` file.

### Retrieving the certificate of the API

The Mediation Controller validates the certificate of the API with the certificate generated during the installation, which acts as its own certification authority. Retrieve the `/etc/ipdiva/cleanroom-vdi-isolate-engine/tls/engine.crt` file (with an SCP client, or by copying its content):

```
1
```

### Checking the installation

The `docker`, `apache2` and `cleanroom-vdi-isolate-engine-scheduler` services must be active, and the API must listen on port `56654`:

```
1
2
```

The logs of the Docker server are written in the `/var/log/ipdiva/cleanroom-vdi-isolate-engine/` directory.

### Range of display ports

Each session publishes its display on a local port of the server, taken from the range set by the `PORTS_POOL_START` and `PORTS_POOL_END` parameters of the `/etc/ipdiva/cleanroom-vdi-isolate-engine/djangosettings.env` file (`40000` and `40050` when they are absent). To change the range, add or modify these two lines, then apply the change by reconfiguring the package:

```
1
```

## Declaration in the administration console

The Docker server is declared in each organisation that uses Browser Isolation, from the [Container or virtualization hosts](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/VirtualMachines/ContainerOrVirtualizationHosts/) module, with the **Docker server configuration** button of its toolbar:

| Field | Value |
|---|---|
| **Docker server** | Name of the Docker server, followed by the port `56654`. The name must be one of those carried by the certificate of the API (the full name of the machine or one of its IP addresses): the certificate is checked against it. |
| **Docker server API key** | The API key noted at the end of the installation. |
| **Use specific certificate authorities to validate the server certificate** | Ticked, with the `engine.crt` file retrieved previously in **Certificate authorities to validate the server certificate (base64 encoding)**. |
| **Perform communications through a site** | Ticked, with the [site of the Edge Gateways](#site-of-the-edge-gateways) (or one of these Edge Gateways): the Mediation Controller reaches the API through an Edge Gateway of this site. |
| **Gateways allowed to launch isolate applications** | Edge Gateways through which the sessions are launched and their display relayed, distributed between the **Master** and **Slave** columns. |

> **Recording of privileged Isolate (Web) applications**
>
> The recording certificate of the Edge Gateways that record these sessions must allow TLS server use, and have the name of the **FQDN** field of the Edge Gateway as its CN. When the configuration is saved, the console names the Edge Gateways whose certificate does not allow TLS server use: see [Gateways management](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/SitesAndGateways/Gateways/). The Edge Gateways must also be [prepared](#preparing-the-edge-gateways) for the recording of the visited URLs.

Then complete the configuration of Browser Isolation:

1. Declare the CyberElements registry that hosts the browser image as a new host, in the same module:

   | Field | Value |
   |---|---|
   | **Manager type** | **Container**. |
   | **Name** | Free name of the registry. |
   | **Server** | `https://pub-oci-registry.cyberelements.io` |
   | **Login** and **Password** | The registry account, provided by CyberElements support, to whom you communicate the public outgoing IP addresses of the Docker server. |
2. Create an [image template](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/VirtualMachines/ImageTemplates/) based on this registry:

   | Field | Value |
   |---|---|
   | **Host** | The registry declared previously. |
   | **Image** | `pub-oci-registry.cyberelements.io/isolate/chromium` |
   | **Tag** | `145.0.7632.116-1_14` |
   | **Memory(Mo)** | `512` at least; increase it if the browser is unstable. |
   | **Security options** | The two pairs below. |

   | Key | Value |
   |---|---|
   | `apparmor` | `chromium` |
   | `seccomp` | `{"comment":"Allow create user namespaces","names":["clone","setns","unshare"],"action":"SCMP_ACT_ALLOW","args":[],"includes":{},"excludes":{}}` |
3. Create the Isolate (Web) applications, [standard](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/Applications/StandardApplications/IsolateWebStandard/) or [privileged](https://docs.cyberelements.io/bastion/4.7/no/Usage/Administration/AdminConsole/MainWorkPanel/Applications/PrivilegedApplications/IsolateWebPrivileged/), and grant them through an access contract that references the [site of the Edge Gateways](#site-of-the-edge-gateways).

At the first session, the Docker server downloads the image from the registry (about 0.6 GB): the opening of the session waits for the end of the download.

> **Pop-ups**
>
> The session opens in a new window of the user's browser: allow pop-ups for the address of the user portal, otherwise the browser blocks the window.

> **Recommendation**
>
> The security hardening guide details the local firewall rules and the automation of the Debian security updates, which also apply to the Docker server: see [Local firewall](https://docs.cyberelements.io/bastion/4.7/no/Security/LocalFirewall/) and [R7](https://docs.cyberelements.io/bastion/4.7/no/Security/SystemHardening/SystemInstallation/#r7).
