# Installing Soffid using Docker

Guide to show the installation process os Soffid IAM using Docker

# Installing IAM Console

Guide to install IAM Console using Docker.

## Prerequisites

- Docker
- 8GB RAM
- &gt; 10GB disk space (50GB recomended)
- [Supported database installed](https://bookstack.soffid.com/books/installation/page/initialize-database-using-docker)

## Repositories

Soffid 3 uses the public Docker Hub: [https://hub.docker.com/r/soffid/iam-console/](https://hub.docker.com/r/soffid/iam-console/)

Soffid 4 uses the Google Cloud Artifact Registry, contact to Soffid when you need access to it.

## Video Tutorial

<iframe allowfullscreen="allowfullscreen" height="314" src="//www.youtube.com/embed/pEP76i7nX2M?rel=0" width="560"></iframe>

## Installation

To configure IAM console, the following environment variables can be set:

<table border="1" id="bkmrk-variable-description" style="width: 807px; height: 490.4px;"><tbody><tr bgcolor="#ddd" style="height: 29.6px;"><td align="center" style="width: 179px; height: 29.6px;">Variable</td><td align="center" style="width: 307px; height: 29.6px;">Description</td><td align="center" style="width: 321px; height: 29.6px;">Example</td></tr><tr style="height: 80px;"><td style="width: 179px; height: 80px;">DB\_URL</td><td style="width: 307px; height: 80px;">JDBC URL</td><td style="width: 321px; height: 80px;">jdbc:mariadb://dbcontainer/soffid

jdbc:oracle:thin:@HOST:PORT:SID  
jdbc:oracle:thin:@//HOST:PORT/SERVICENAME

</td></tr><tr style="height: 29.6px;"><td style="width: 179px; height: 29.6px;">DB\_USER</td><td style="width: 307px; height: 29.6px;">Database user</td><td style="width: 321px; height: 29.6px;">Soffid</td></tr><tr style="height: 29.6px;"><td style="width: 179px; height: 29.6px;">DB\_PASSWORD</td><td style="width: 307px; height: 29.6px;">Database password</td><td style="width: 321px; height: 29.6px;">5uper5ecret</td></tr><tr style="height: 29.6px;"><td style="width: 179px; height: 29.6px;">JAVA\_OPT</td><td style="width: 307px; height: 29.6px;">Java virtual machine options</td><td style="width: 321px; height: 29.6px;">-Xmx4096m</td></tr><tr style="height: 29.6px;"><td style="width: 179px; height: 29.6px;">SECURE</td><td style="width: 307px; height: 29.6px;">(optional) Enables the Java Security Manager</td><td style="width: 321px; height: 29.6px;">true</td></tr><tr style="height: 57.6px;"><td style="width: 179px; height: 57.6px;">SOFFID\_TRUSTED\_SCRIPTS</td><td style="width: 307px; height: 57.6px;">(optional) Allows you to use insecure classes.

Available since console version 3.5.6

</td><td style="width: 321px; height: 57.6px;">true

false

</td></tr><tr style="height: 80px;"><td style="width: 179px; height: 80px;">HIDE\_MENU</td><td style="width: 307px; height: 80px;">(optional) Allows you to hide the Console menu options.

Available since console version 3.5.6

</td><td style="width: 321px; height: 80px;">soffid.admin

You can choose the proper option from the Console.yaml file.

</td></tr><tr style="height: 124.8px;"><td style="width: 179px; height: 124.8px;">AUTH\_METHODS</td><td style="width: 307px; height: 124.8px;">(optional) Allows to force the authentication mechanisms. This configuration overrides the one configured in the authentication option of the Soffid console.

Available since console version 3.5.6

</td><td style="width: 321px; height: 124.8px;">Options

SAML

PASSWORD

SAML PASSWORD

</td></tr><tr><td style="width: 179px;">EXTERNAL\_URL</td><td style="width: 307px;">(optional) Allows to override host name configuration when there are two Consoles.

Available since console version 3.5.9.5

</td><td style="width: 321px;">https://soffid.lab.internal.com

</td></tr></tbody></table>

Additional parameters to configure the database connections. Allows you to establish the min and the max of database connections:

<table border="1" id="bkmrk-variable-description-0" style="border-collapse: collapse; width: 100%;"><tbody><tr bgcolor="#ddd"><td align="center" style="width: 26.1987%;">Variable</td><td align="center" style="width: 55.8529%;">Description</td><td align="center" style="width: 17.9237%;">Example</td></tr><tr><td style="width: 26.1987%;">DBPOOL\_MIN\_IDLE</td><td style="width: 55.8529%;">The minimum number of connections should be kept in the pool at all times.</td><td style="width: 17.9237%;">1 or 2</td></tr><tr><td style="width: 26.1987%;">DBPOOL\_MAX\_IDLE</td><td style="width: 55.8529%;">The maximum number of connections should be kept in the pool at all times.</td><td style="width: 17.9237%;">between 10 and 15</td></tr><tr><td style="width: 26.1987%;">DBPOOL\_INITIAL</td><td style="width: 55.8529%;">The connection number will be established when the connection pool is started.</td><td style="width: 17.9237%;">3 or 4</td></tr><tr><td style="width: 26.1987%;">DBPOOL\_MAX</td><td style="width: 55.8529%;">The maximum number of active connections that can be allocated. If no value is indicated, the default value is 30.

The transaction fails if the maximum connections are reached within 30 seconds and no connection is released.

</td><td style="width: 17.9237%;">25</td></tr></tbody></table>

The following volumes must be defined by default:

<table border="1" id="bkmrk-volume-usage-%2Fopt%2Fso"><tbody><tr bgcolor="#ddd"><td align="center" style="width: 267px;">Volume</td><td align="center" style="width: 542px;">Usage</td></tr><tr><td style="width: 267px;">/opt/soffid/iam-console-4/logs</td><td style="width: 542px;">Console log files `/opt/soffid/iam-console-4/logs`</td></tr><tr><td style="width: 267px;">/opt/soffid/iam-console-4/index</td><td style="width: 542px;">Text search engine index files. It can be erased at any time. The engine will regenerate the search engine. `/opt/soffid/iam-console-4/index/`

</td></tr><tr><td style="width: 267px;">/opt/soffid/iam-console-4/conf</td><td style="width: 542px;">Configuration files, including server.xml and tomee.xml files `/opt/soffid/iam-console-4/conf`</td></tr></tbody></table>

Here you have a sample command to start a docker container running IAM console, in this case the docker will be in a docker network, previously created. MariaDB docker is at the same network.<svg height="16" viewbox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"></svg>

```shell
docker run -d \
   -e DB_URL=jdbc:mariadb://mariadb-service/soffid \
   -e DB_USER=soffid \
   -e DB_PASSWORD=soffid \
   --name=iam-console \
   --publish=8080:8080 \
   --network=soffidnet \
   soffid/iam-console
```

To see console log files, execute:

```shell
docker logs -f iam-console
```

<div id="bkmrk-by-default%2C-the-8080"><div><div><div><div>By default, the 8080 port will be exposed. When the TLS connection is going to be configured, add the tag --publish=443:443 to publish the TLS port.</div><div>  
</div></div></div></div></div><p class="callout info">When the console is created, the password for the user *admin* will be *changeit* and it will be valid for 24 hours.</p>

<p class="callout info">Now you can connect the Soffid Console [<span style="text-decoration: underline;">http://localhost:8080/soffid</span>](http://localhost:8080/soffid)/The first thing you must do is to change the admin user password. </p>

<div id="bkmrk--2"></div><div id="bkmrk--3"></div><p class="callout info">Next Step: [Installing Sync server](https://bookstack.soffid.com/books/installation/page/installing-sync-server-b3e "Installing Sync server")</p>

# Installing Sync server

Guide to install Sync server using Docker.

## Prerequisites

Soffid IAM sync server requires the following requirements:

- [Supported database installed](https://bookstack.soffid.com/books/installation/page/initialize-database "Initialize database")
- [Soffid Console Installed](https://bookstack.soffid.com/books/installation/page/installing-iam-console-ef0 "Installing IAM Console")

## Repositories

Soffid 3 uses the public Docker Hub: [https://hub.docker.com/r/soffid/iam-console/](https://hub.docker.com/r/soffid/iam-console/)

Soffid 4 uses the Google Cloud Artifact Registry, contact to Soffid when you need access to it.

## Video Tutorial

### Linux

<iframe allowfullscreen="allowfullscreen" height="314" src="https://www.youtube.com/embed/NHBvdzDWiWA" width="560"></iframe>

## Installation

### Install first Sync server

To configure the first IAM Sync server, the following environment variables can be set for the first server:

<table border="1" id="bkmrk-variable-description" style="width: 769px; height: 220px;"><tbody><tr bgcolor="#ddd" style="height: 29px;"><td align="center" style="width: 170.977px; height: 29px;">Variable</td><td align="center" style="width: 335.997px; height: 29px;">Description</td><td align="center" style="width: 261.989px; height: 29px;">Example</td></tr><tr style="height: 29px;"><td style="width: 170.977px; height: 29px;">DB\_URL</td><td style="width: 335.997px; height: 29px;">JDBC URL</td><td style="width: 261.989px; height: 29px;">jdbc:mariadb://dbcontainer/soffid</td></tr><tr style="height: 29px;"><td style="width: 170.977px; height: 29px;">DB\_USER</td><td style="width: 335.997px; height: 29px;">Database user</td><td style="width: 261.989px; height: 29px;">Soffid</td></tr><tr style="height: 30px;"><td style="width: 170.977px; height: 30px;">DB\_PASSWORD</td><td style="width: 335.997px; height: 30px;">Database password</td><td style="width: 261.989px; height: 30px;">5uper5ecret</td></tr><tr style="height: 29px;"><td style="width: 170.977px; height: 29px;">SOFFID\_HOSTNAME</td><td style="width: 335.997px; height: 29px;">The hostname used to access the sync server</td><td style="width: 261.989px; height: 29px;">syncserver01.soffid.com</td></tr><tr style="height: 29px;"><td style="width: 170.977px; height: 29px;">SOFFID\_PORT</td><td style="width: 335.997px; height: 29px;">TCP port used for incoming connections</td><td style="width: 261.989px; height: 29px;">760</td></tr><tr style="height: 45px;"><td style="width: 170.977px; height: 45px;">**SOFFID\_MAIN**</td><td style="width: 335.997px; height: 45px;">Set to yes for the first sync server, no for the next ones</td><td style="width: 261.989px; height: 45px;">**yes**</td></tr></tbody></table>

Additional parameters to configure the database connections. Allows you to establish the min and the max of database connections:

<table border="1" id="bkmrk-variable-description-0" style="border-collapse: collapse; width: 100%;"><tbody><tr bgcolor="#ddd"><td align="center" style="width: 24.7158%;">Variable</td><td align="center" style="width: 53.4918%;">Description</td><td align="center" style="width: 21.7677%;">Example</td></tr><tr><td style="width: 24.7158%;">DBPOOL\_MIN\_IDLE</td><td style="width: 53.4918%;">The minimum number of connections should be kept in the pool at all times.</td><td style="width: 21.7677%;">1 or 2</td></tr><tr><td style="width: 24.7158%;">DBPOOL\_MAX\_IDLE</td><td style="width: 53.4918%;">The maximum number of connections should be kept in the pool at all times.</td><td style="width: 21.7677%;">between 10 and 15</td></tr><tr><td style="width: 24.7158%;">DBPOOL\_INITIAL</td><td style="width: 53.4918%;">The number of connections will be established when the connection pool is started.</td><td style="width: 21.7677%;">3 or 4</td></tr><tr><td style="width: 24.7158%;">DBPOOL\_MAX</td><td style="width: 53.4918%;">The maximum number of active connections that can be allocated. If no value is indicated, the default value is 30.

The transaction fails if the maximum connections are reached within 30 seconds and no connection is released.

</td><td style="width: 21.7677%;">25</td></tr><tr><td style="width: 24.7158%;">DBPOOL\_MAX\_IDLE\_TIME</td><td style="width: 53.4918%;">Number of seconds that a connection to a DB that is not in use is maintained.

Available since Sync Server version 3.5.4.3

</td><td style="width: 21.7677%;">3600</td></tr></tbody></table>

### Install next Sync servers

To configure the next sync servers, the following environment variables can be set:

<table border="1" id="bkmrk-variable-description-1" style="width: 774px; height: 304.83px;"><tbody><tr bgcolor="#ddd" style="height: 29.7017px;"><td align="center" style="width: 174.943px; height: 29.7017px;">Variable</td><td align="center" style="width: 324.986px; height: 29.7017px;">Description</td><td align="center" style="width: 273.977px; height: 29.7017px;">Example</td></tr><tr style="height: 29.7017px;"><td style="width: 174.943px; height: 29.7017px;">SOFFID\_SERVER</td><td style="width: 324.986px; height: 29.7017px;">First sync server url</td><td style="width: 273.977px; height: 29.7017px;">https://syncserver01.soffid.com:1760</td></tr><tr style="height: 46.5057px;"><td style="width: 174.943px; height: 46.5057px;">SOFFID\_USER</td><td style="width: 324.986px; height: 46.5057px;">Soffid user to join the security domain. If you are working in a tenant, the user of the tenant.</td><td style="width: 273.977px; height: 46.5057px;">admin</td></tr><tr style="height: 46.5057px;"><td style="width: 174.943px; height: 46.5057px;">SOFFID\_PASS</td><td style="width: 324.986px; height: 46.5057px;">Soffid user password. If you are working in a tenant, the user password of the tenant.</td><td style="width: 273.977px; height: 46.5057px;">changeit</td></tr><tr style="height: 46.5057px;"><td style="width: 174.943px; height: 46.5057px;">SOFFID\_HOSTNAME</td><td style="width: 324.986px; height: 46.5057px;">The host name used to access to the sync server</td><td style="width: 273.977px; height: 46.5057px;">syncserver.soffid.com</td></tr><tr style="height: 29.7017px;"><td style="width: 174.943px; height: 29.7017px;">SOFFID\_PORT</td><td style="width: 324.986px; height: 29.7017px;">TCP port used for incomming connections</td><td style="width: 273.977px; height: 29.7017px;">760</td></tr><tr style="height: 29.7017px;"><td style="width: 174.943px; height: 29.7017px;">SOFFID\_TENANT</td><td style="width: 324.986px; height: 29.7017px;">Tenant name</td><td style="width: 273.977px; height: 29.7017px;">master</td></tr><tr style="height: 46.5057px;"><td style="width: 174.943px; height: 46.5057px;">**SOFFID\_MAIN**</td><td style="width: 324.986px; height: 46.5057px;">Set to yes for the first sync server, no for the next ones</td><td style="width: 273.977px; height: 46.5057px;">**no**</td></tr></tbody></table>

### Install Sync server in a private network

To configure a sync server in a private network, not directly accessible from the main sync server, the following environment variables can be set:

<table border="1" id="bkmrk-variable-description-2" style="width: 779px;"><tbody><tr bgcolor="#ddd"><td align="center" style="width: 147px;">Variable</td><td align="center" style="width: 360px;">Description</td><td align="center" style="width: 272px;">Example</td></tr><tr><td style="width: 147px;">SOFFID\_SERVER</td><td style="width: 360px;">First sync server url</td><td style="width: 272px;">https://syncserver01.soffid.com:1760</td></tr><tr><td style="width: 147px;">SOFFID\_USER</td><td style="width: 360px;">Soffid user to join the security domain</td><td style="width: 272px;">admin</td></tr><tr><td style="width: 147px;">SOFFID\_PASS</td><td style="width: 360px;">Soffid user password</td><td style="width: 272px;">changeit</td></tr><tr><td style="width: 147px;">SOFFID\_HOSTNAME</td><td style="width: 360px;">The host name used to access to the sync server</td><td style="width: 272px;">syncserver.soffid.com</td></tr><tr><td style="width: 147px;">SOFFID\_TENANT</td><td style="width: 360px;">Tenant name</td><td style="width: 272px;">master</td></tr><tr><td style="width: 147px;">**SOFFID\_MAIN**</td><td style="width: 360px;">Set to yes for the first sync server, no for the next ones</td><td style="width: 272px;">**no**</td></tr><tr><td style="width: 147px;">**SOFFID\_REMOTE**</td><td style="width: 360px;">Flag to enable cloud protocol</td><td style="width: 272px;">**yes**</td></tr></tbody></table>

You can use this configuration when the main sync server is located in the cloud.

### The following volumes are defined by default

<table border="1" id="bkmrk-volume-usage-%2Fopt%2Fso" style="width: 780px;"><tbody><tr bgcolor="#ddd"><td align="center" style="width: 244px;">Volume</td><td align="center" style="width: 536px;">Usage</td></tr><tr><td style="width: 244px;">/opt/soffid/iam-sync/conf</td><td style="width: 536px;">Configuration files, including private keys and certificates</td></tr></tbody></table>

### Command

Here you have a sample command to start a docker container running IAM sync server. Mind to specify the port number to expose the sync server docker to the outside world. It is not needed when using the cloud connectivity:

```shell
docker run -d \
   -e DB_URL=jdbc:mysql://mariadb-service/soffid \
   -e DB_USER=soffid \
   -e DB_PASSWORD=soffid \
   -e SOFFID_PORT=1760 \
   -e SOFFID_HOSTNAME=iam-sync.soffidnet \
   -e SOFFID_MAIN=yes \
   --name=iam-sync \
   --publish 1760:1760 \
   --network=soffidnet \
   soffid/iam-sync:latest
```

To see sync server log file, execute:

```shell
docker logs -f iam-sync
```

You can also view the log files inside the container. To do this, first enter the container, then you should find the log files in the **/var/log/soffid/** directory.

```
root@soffid:~# docker exec -it iam-sync /bin/bash
root@e1a90ff25d99:/# less /var/log/soffid/syncserver.log
```

<p class="callout info">Now you can connect to the IAM console [http://localhost:8080/soffid](http://%3Cnode-ip%3E%3Cpublish-port%3E/) and chek if Console and Syncserver are connected.</p>

# How to add a certificate to cacerts

## Step by step

<p class="callout warning">This procedure is valid for the docker environment, but it is not for Kubernetes. </p>

How to add the Sync server certificate to the Java key store of Soffid console or Soffid PAM launcher.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>Start by downloading the certificate from the Sync server:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">a. </span>Connect to [<span style="font-weight: 400;">https://&lt;SYNC-SERVER&gt;:1760/SAML/metadata.xml?tenant=&lt;your-tenant&gt;</span>](https://iam-sync.soffidnet:1760/SAML/metadata.xml?tenant=demolab)

<span style="font-weight: 400;">To get the master's certificate:</span>

```
https://iam-sync.soffidnet:1760/SAML/metadata.xml?tenant=master
```

<span style="font-weight: 400;">To get a tenant's certificate:</span>

```
https://iam-sync.soffidnet:1760/SAML/metadata.xml?tenant=demolab
```

<span style="font-weight: 400;"><span style="color: #a6d100; font-weight: bold; font-size: 18px;">b. </span>Download the certificate:</span>

[![image-1652881836064.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652881836064.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652881836064.png)

[![image-1652881869458.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652881869458.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652881869458.png)

[![image-1652881914804.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652881914804.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652881914804.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>Copy the certificate file to the container (Soffid Console or Soffid PAM Launcher):

Sample how to copy the file to the tmp folder:

```shell
sudo docker cp iam-sync.soffidnet iam-console:tmp
```

Sample how to copy the file to the root folder:

```shell
sudo docker cp iam-sync.soffidnet iam-console:/
```

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>Connect to the container

```shell
sudo docker exec -it iam-console /bin/bash
```

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>Import the certiticate:

```shell
keytool -import -file /tmp/iam-sync.soffidnet -cacerts
```

- <span style="font-weight: 400;">password: </span>**changeit**
- <span style="font-weight: 400;">Trust this certificate? \[no\]: </span>**yes**
- <span style="font-weight: 400;">Certificate was added to Keystore</span>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5. </span>**Restart** the container

---

If you want to display the current certificate:

```shell
openssl s_client -connect iam-sync.soffidnet:1760 -showcert
```