> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manual Installation - Docker Image (Production Use)

> You must have Docker Engine installed. See for information on how to do that. Start a command session to the Docker host and make sure you can run doc

You must have Docker Engine installed. See [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/) for information on how to do that.

Start a command session to the Docker host and make sure you can run docker commands. If necessary sudo to root or other user.

![Image](https://mintcdn.com/flexagon-llc-ce77a95c/s0aZcWvz1eo3cr__/images/cm112/12725916175.png?fit=max\&auto=format\&n=s0aZcWvz1eo3cr__\&q=85\&s=7937bca85d1788be1b10e8f8d2cc5b28)

Here are main steps for this type of docker image. If you are trying to upgrade FlexDeploy for Docker, please following [FlexDeploy Upgrade - Docker](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-upgrade-guide/manual-upgrade-instructions-docker-image-production-use.md).

1. Setup docker volume folder and copy plugins in it from download zip.

2. Setup FlexDeploy Database

3. Pull docker image

4. Start container using specific image.

## Step 1 - Setup Docker Volume Folder on Docker Host

The `application`, `artifacts,` `backups`, `apiext`, and `vsm` folders are stored outside of the container, so when the container is upgraded that data is not lost.

> [!NOTE]
>
> You will need to download (See Flexagon support portal) FlexDeploy Tomcat distribution for database scripts and plugins.

In this step, we will create plugin folder, then copy plugins from download zip in to necessary folder.

```
# adjust folder location as necessary for your Docker Host
mkdir -p /scratch/FlexDeploy
chmod -R 777 /scratch/FlexDeploy
cd /scratch/FlexDeploy
mkdir -p application/plugins
cd application/plugins
cp ~/Tomcat_Complete-11.0.0.0/application/plugins/*.jar .
```

Various folders under docker volume:

* `application/plugins` - copy plugin jars from FlexDeploy download zip. Once application starts, plugin jars from this folder will be automatically uploaded to FlexDeploy.

* `apiext` - copy custom Jar files here which will be incorporated in application. These jar files are only picked up at startup, so if you place something here, restart of docker container will be needed. For example, custom implementation for Issue Tracking, Change Management, Credential Store etc.

* `artifacts` - Artifacts Repository

* `backups` - Backups Repository

* `logs` - application logs are also outside of the container.

## Step 2 - Setup FlexDeploy Database

[Manual Installation Instructions - Database Tier - Oracle](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/manual-installation-instructions/manual-installation-instructions-database-tier-oracle.md)

[Manual Installation Instructions - Database Tier - PostgreSQL](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/manual-installation-instructions/manual-installation-instructions-database-tier-postgresql.md)

## Step 3 - Pull Docker Image

First let's pull docker image `flexdeploy/fd_tcat`. See support portal for \<repository> details.

> [!NOTE]
>
> We recommend selecting a particular version instead of leaving the tag off (which will pull the latest version). That way you know exactly which version you are on.

```
docker pull <repository>/flexdeploy/fd_tcat:VERSION
```

## Step 4 - Run Docker Container

Now let's run FlexDeploy docker image. This particular image contains only FlexDeploy with Tomcat, i.e. database and artifact repository is not part of the container. So we need to pass various details to docker run command.

The following should be configured

1. `p` - in this example 8000 is the port which FlexDeploy will be accessed on mapping to port 8080 in the container

2. `FLEX_DB_URL` - jdbc URL for accessing the database. See below for syntax

3. `FD_ADMIN_PWD` - Password for the fdadmin user in the database

4. `TZ` - Time zone for the container. Given example is America/Chicago.

5. `dbtype` - if you are using postgres or oracle database.

6. `v` - This will set where your application, repository, vsm and logs folders will go on the docker host.

   * Everything before the colon is on the local machine. In our example above this folder was `/scratch/FlexDeploy`

   * Everything after colon indicates folder inside docker container, leave that as `/dockervolume`

7. `MAX_ACTIVE_CONNECTIONS` - The maximum number of active DB connections that can be allocated from the connection pool at the same time. Default value is 100.

8. `MAX_IDLE_CONNECTIONS` - The maximum number of connections that should be kept in the pool at all times. Default is 100.

9. `MAX_WAIT_TIME_MILLIS` - The maximum number of milliseconds that the pool will wait when there are no available connections. Default is 30000(30 Secs).

10. Optionally, you can add a -d to run container in background and print container ID. The -a option can also be added to view logs.

11. Last is the image which will be flexdeploy/fd\_tcat: and the VERSION you want to run. Ensure \<repository> is replaced with proper repository location (available on support portal)

```
docker run --name flexdeploy -p 8000:8080 -e FLEX_DB_URL="jdbc:oracle:thin:@URL:PORT:xe" -e FD_ADMIN_PWD=DATABASEPASSWORD -e TZ=America/Chicago -e dbtype=oracle|postgres -e MAX_ACTIVE_CONNECTIONS=100 -e MAX_IDLE_CONNECTIONS=100 -e MAX_WAIT_TIME_MILLIS=30000 -v /scratch/FlexDeploy:/dockervolume <repository>/flexdeploy/fd_tcat:VERSION
```

> [!TIP]
>
> Example JDBC URL (FLEX\_DB\_URL)
>
> * Oracle
>
>   * Localhost XE connection will look like this. jdbc:oracle:thin:@localhost:1521:XE
>
>   * SID based JDBC URL Syntax - jdbc:oracle:thin:@HOSTNAME:PORT:SID
>
>   * Service Name based JDBC URL Syntax - jdbc:oracle:thin:@//HOSTNAME:PORT/SERVICENAME
> * PostgreSQL
>
>   * Syntax - jdbc:[postgresql://hostname:port/](#)**flexdeploy**
>
>   * Example - jdbc:[postgresql://dkrlp01:5432/flexdeploy](#)

Now you can look at logs and other details in docker volume folder. For example, `/scratch/FlexDeploy/logs`

> [!TIP]
>
> If necessary, make sure to open port 8000 for access from outside docker host.

Now you can launch FlexDeploy using http\://\<docker host>:8000/flexdeploy.

As always when you first launch FlexDeploy, you will need to complete Registration process.

![Image](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590908330.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=1492a428b3ad68a86eeead0c478c0c0d)

Once you complete registration, you are ready to use FlexDeploy.
