> ## 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 Instructions

> The FlexDeploy distribution contains the following components: A tomcat 9 server with required libraries, and base configurations The FlexDeploy WAR T

The FlexDeploy distribution contains the following components:

* A tomcat 9 server with required libraries, and base configurations

* The FlexDeploy WAR

* The FlexDeploy database installation scripts

* The FlexDeploy database migration scripts (for upgrading an existing FlexDeploy Tomcat installation)

* The FlexDeploy plugins

> [!WARNING]
>
> **Unless you are running on Windows or have been advised by Flexagon Support, consider using the** [**Automated Linux installer**](https://flexagon.atlassian.net/wiki/spaces/SHAR/pages/10125805231/Automated+Linux+Install+Upgrade) **instead.**

# Requirements 

> [!NOTE]
>
> See [FlexDeploy System Requirements](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-system-requirements.md) for details on software and hardware requirements

# Installation Instructions

Adjust for Windows path if you are installing on Windows platform.

## Step 1. Ensure Java 21 or 17 is installed on the server.

In this example, JAVA\_HOME is /u01/java/jdk21 but it can be any path you want.

***

## Step 2. Prepare software

FlexDeploy can be downloaded from the [Flexagon Support Site](http://support.flexagon.com). You will download specific version of FlexDeploy, download file is named Tomcat\_Complete-X.X.X.X.zip, where X.X.X.X represents four digit version number.

Extract the zip file in the desired location (referred to as "**FLEXDEPLOY\_HOME**" in this document). See example below, where zip was extracted in **/u01/flexdeploy** folder.

> [!NOTE]
>
> We recommend use of folder structure without any space in name.

```
cd /u01
mkdir -p flexdeploy
cd flexdeploy
unzip <location of distribution zip>/Tomcat_Complete-X.X.X.X.zip
```

Here is how it will look like after unzip.

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

***

## Step 3. Setup database and schemas

Setup the appropriate database, if you not already done so.

[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 4. Update Tomcat context.xml

Modify Tomcat configuration file (context.xml) for database connectivity depending on your database type.

* Replace the contents of context.xml with the contents the context-\<type>.xml if using PostgreSQL.

* Replace URL and Password with the actual values.

File - **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/conf/context.xml**

> [!NOTE]
>
> ### Example JDBC URL (CONNECT\_STRING)
>
> * Oracle
>
>   * The JDBC short format of host:sid:port should not be used. URL must be in the format listed below as we are requiring use of UCP based connection pooling.
>
>     * Example - `jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=**HOSTNAME**)(PORT=**PORT**)))(CONNECT_DATA=(SERVICE_NAME=**SERVICE_NAME**)))`
>
>     * If RAC is used for the database, multiple nodes can be listed in the address list of the URL or it can point to the scan listener for the cluster. See below sample URL for a RAC implementation that has a primary and secondary scan listener connecting to to a service name GOLD-CLOUD. This includes connection timeout, retry, and retry delay settings.
>
>     * Example - `jdbc:oracle:thin:@(DESCRIPTION = CONNECT_TIMEOUT=120) (RETRY_COUNT=20) (RETRY_DELAY=3) (TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=primary-scan) (PORT=1521))) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=secondary-scan) (PORT=1521))) (CONNECT_DATA=(SERVICE_NAME = gold-cloud)))`
> * PostgreSQL
>
>   * Syntax - jdbc:[postgresql://hostname:port/](#)**flexdeploy**
>
>   * Example - `jdbc:`[postgresql://dkrlp01:5432/flexdeploy](#)
>
>   * If you are using database name other than flexdeploy, then update URL accordingly.

Follow the instructions provided [here](https://docs.flexagon.com/hidden/using-wallet-with-oracle-database.md) to connect to Oracle Autonomous databases.

### Oracle

```
<Resource name="jdbc/flexdbDS" auth="Container"
    type="oracle.ucp.jdbc.PoolDataSource"
    factory="oracle.ucp.jdbc.PoolDataSourceImpl"
 
    connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource"
    minPoolSize="0"
    maxPoolSize="100"
    initialPoolSize="0"
    autoCommit="false"
    inactiveConnectionTimeout="300"
 
    url="**CONNECT_STRING**"
    user="fd_admin"
    password="**FD_ADMIN_PASSWORD**"
 
    fastConnectionFailoverEnabled="true"
 
    validationQuery="select 1 from dual"
    testOnBorrow="true"
 
    useLocalSessionState="true"
    defaultAutoCommit="false"/>
```

### PostgreSQL

```
<Resource name="jdbc/flexdbDS" auth="Container"
    type="javax.sql.DataSource"
    factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
    driverClassName="org.postgresql.Driver"
    
    url="**CONNECT_STRING**"
    username="fd_admin"
    password="**FD_ADMIN_PASSWORD**"
    
    maxTotal="100"
    maxIdle="20"
    
    validationQuery="select 1"
    testOnBorrow="true"
    
    defaultTransactionIsolation="READ_COMMITTED"
    useLocalSessionState="true"
    defaultAutoCommit="false"/>
```

***

## Step 5. (Optional) Update Tomcat server.xml

Modify Tomcat server.xml if necessary. If you want to use different port or setup https, the you would need to update server.xml.

File - **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/conf/server.xml**

* By default, the Tomcat server is configured to run on port 8000. If this port is in use, change to some other unused port. Search for **\<Connector port="8000" protocol="HTTP/1.1"** if you want to change it.

* There are other ports referenced in the server.xml file as well. If the logs contain a port in use error, you can find the open ports on your machine and then search this file for ports that you find are in use and change them.

***

## Step 6. (Optional) Update setenvoverride

Modify Tomcat Environment script (setenvoverride.sh or setenvoverride.bat) for FlexDeploy server side directories, memory specifications or JAVA\_HOME.

File - **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/bin/setenvoverride.sh** (setenvoverride.bat on windows). Main reason to modify this file is to configure specific JAVA\_HOME. Other variables can be left as is for default configurations.

* Configure variable **JAVA\_HOME** to use specific version of Java for FlexDeploy tomcat process.

Following other variables are recommended to be left unchanged from default.

* Configure variable **FD\_APPLICATION\_DIRECTORY** with directory to use as the FlexDeploy application directory (See [System Requirements](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-system-requirements.md) for more information about how much space is needed.)

* Configure variable **FD\_REPOSITORY\_DIRECTORY** with the directory to host the FlexDeploy artifact repository (See [System Requirements](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-system-requirements.md) for more information about how much space is needed.)

Below are default artifact and working directories created under FLEXDEPLOY\_HOME when you extracted zip file.

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

Default setenvoverride.sh is shown below.

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

***

Modify Tomcat Environment script (setenvoverride.sh or setenvoverride.bat) for JAVA\_HOME.

File - **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/bin/setenvoverride.sh** (setenvoverride.bat on windows)

> [!NOTE]
>
> If JAVA\_HOME is already set in your environment, you can skip this step.
>
> Unix Example - JAVA\_HOME=/u01/java/jdk21
>
> Windows Example - set JAVA\_HOME=c:/installs/Java/jdk21

 If you were also setting JAVA\_HOME, this file would look like this.

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

***

## Step 7. Update database driver (Only if using Oracle Database)

* Download the latest Oracle JDBC driver from [https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html](https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html).  Click on the driver link matching your Oracle database version, and download the driver compatible with your JDK. For example, `ojdbc8-full.tar.gz`.

> [!NOTE]
>
> Be sure to download the JDBC driver matching your Oracle Database version and one which is compiled and compatible your Java version.  If you download the driver which is compiled with a newer JDK you will get errors on server startup similar to the following:

```
Caused by: java.lang.UnsupportedClassVersionError: oracle/jdbc/OracleClob has been compiled by a more recent version of the Java Runtime 
       (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 57.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
```

* Clean up old ojdbc jars from **\<FLEXDEPLOY\_HOME>\apache-tomcat-flexdeploy\lib**.

* Save new driver jars from downloaded jdbc driver to **\<FLEXDEPLOY\_HOME>\apache-tomcat-flexdeploy\libext**. You may have done this already as part of Step 4. Make sure that if you copied the jars for libext of your backup to your new libext, you don’t end up with multiple versions of the Oracle JDBC jars. If migrating from an old version of FlexDeploy, you may want to clean your libext folder and start with a new Oracle Database driver download.

* UCP is now required for Oracle Database connections.

### Linux

```
unzip <ojdbc8 download locaton>/ojdbc8-full.zip

cd $FLEXDEPLOY_HOME/apache-tomcat-flexdeploy/lib
rm ojdbc*.jar
cd ..
mkdir -p libext
cd libext
cp <jdbc driver extract location>/ojdbc-full/*.jar .
```

### Windows

```
unzip <ojdbc8 download locaton>\ojdbc8-full.zip

cd %FLEXDEPLOY_HOME%\apache-tomcat-flexdeploy\lib
del /f ojdbc*.jar
cd ..
mkdir libext
cd ..\libext
copy <jdbc driver extract location>\ojdbc-full\*.jar .
```

Please put any extra libraries required inside of **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/libext** not **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/lib**. You may need to create this directory.

***

## Step 8. Set execute permission (Linux only)

Set the shell scripts executable with this command.

```
chmod +x $FLEXDEPLOY_HOME/apache-tomcat-flexdeploy/bin/*.sh
chmod +x $FLEXDEPLOY_HOME/*.sh
```

***

## Step 9. Adjust for non-default server side directories

> [!NOTE]
>
> Skip this step if you did not modify setenvoverride for FD\_APPLICATION\_DIRECTORY in **Step 6**.

If you are using non-default server side directories, then move all the jar files from \<FLEXDEPLOY\_HOME>/application/plugins to FD\_APPLICATION\_DIRECTORY/plugins. At startup, FlexDeploy will load all the plugins.

***

## Step 10. Configure Influx database

> [!NOTE]
>
> This is a **required step that must be executed.**

Download links for the influx database software and client, if not already downloaded.

Linux

[Influx database software (Linux)](https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-linux-amd64.tar.gz)

[Influx database client (Linux)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.2.1-linux-amd64.tar.gz)

Windows

[Influx database software (Windows)](https://dl.influxdata.com/influxdb/releases/influxdb2-2.2.0-windows-amd64.zip)

[Influx database client (Windows)](https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.2.1-windows-amd64.zip)

Untar the influx database software and client to the desired location.

```
tar xf <tar file directory>/influxdb2-2.7.12_linux_amd64.tar.gz  --strip-components 1 -C $FLEXDEPLOY_HOME/influxdb
tar xf <tar file directory>/influxdb2-client-2.7.5-linux-amd64.tar.gz  --strip-components 1 -C $FLEXDEPLOY_HOME/influxdb
```

Adjust the influx database configuration file. **\<FLEXDEPLOY\_HOME>/influxdb/config/config.yaml**

### Linux

```
cd $FLEXDEPLOY_HOME
mkdir -p application/vsm
cd influxdb/config
vi config.yaml
```

Check your open file limits. Influx opens a large number of files to complete its work.

`ulimit -Hn`

will show the open file limit for the current user. Make sure you run it as the user who will be executing FlexDeploy and Influx.

If it is less that 65536, we recommend raising it.

`sudo vi /etc/security/limits.conf`

where oracle is the user logged into the box to run FlexDeploy:

`oracle soft nofile 16384`

`oracle hard nofile 65536`

### Windows

```
cd %FLEXDEPLOY_HOME%
mkdir application\vsm
cd influxdb\config
edit config.yaml
```

Change the following locations: You must put absolute path as no environment variables are allowed in this file.

### Linux

* bolt-path: from \<FLEXDEPLOY\_HOME>/influxdb/data/influxd.bolt to \<FLEXDEPLOY\_HOME>/application/vsm/data/influxd.bolt

* engine-path: from \<FLEXDEPLOY\_HOME>/influxdb/data/engine to \<FLEXDEPLOY\_HOME>/application/vsm/data/engine

* sqlite-path: \<FLEXDEPLOY\_HOME>/influxdb/data/influxd.sqlite to \<FLEXDEPLOY\_HOME>/application/vsm/data/influxd.sqlite

### Windows

* bolt-path: from \<FLEXDEPLOY\_HOME>\influxdb\data\influxd.bolt to \<FLEXDEPLOY\_HOME>\application\vsm\data\influxd.bolt

* engine-path: from \<FLEXDEPLOY\_HOME>\influxdb\data\engine to \<FLEXDEPLOY\_HOME>\application\vsm\data\engine

* sqlite-path: \<FLEXDEPLOY\_HOME>\influxdb\data\influxd.sqlite to \<FLEXDEPLOY\_HOME>\application\vsm\data\influxd.sqlite

### Setup the config file for FlexDeploy to connect to influxdb.

Create the file \<FLEXDEPLOY\_HOME>/influxdb/config/fdinflux.config with the following contents, modifed appropriately for your install.

```
INFLUXDB_URL=http://localhost:8086
INFLUXDB_BUCKET=flexbucket
INFLUXDB_ORG=flexdeploy
```

## Step 11. Start tomcat

> [!NOTE]
>
> If running FlexDeploy 6.0 or higher, do not use startup.sh as this will not start the influx database.

Linux

```
cd $FLEXDEPLOY_HOME
# this will be automatically updated within a FlexDeploy credential (FD_INFLUXDB_ADMIN_TOKEN) on startup so FlexDeploy can connect with the influx database. 
# This will be used in the next setup step.
 export INFLUX_DB_TOKEN=<arbitrary value>  
echo ${INFLUX_DB_TOKEN} > application/vsm/.token
./StartFlexDeploy.sh
```

Windows

```
cd %FLEXDEPLOY_HOME%
# this will be automatically updated within a FlexDeploy credential (FD_INFLUXDB_ADMIN_TOKEN) on startup so FlexDeploy can connect with the influx database.  
# This will be used in the next setup step.
set INFLUX_DB_TOKEN=<arbitrary value>  
echo %INFLUX_DB_TOKEN% > application\vsm\.token
StartFlexDeploy.bat
```

> [!NOTE]
>
> Once influx and tomcat servers are up, we need to run setup on the influx database.

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

### Linux

```
cd $FLEXDEPLOY_HOME/influxdb
INFLUX_DB_PASSWORD=<arbitrary value>
rm -rf ~/.influxdbv2
./influx setup --bucket flexbucket --token ${INFLUX_DB_TOKEN} --org flexdeploy --username=flexuser --password=${INFLUX_DB_PASSWORD} --host=http://localhost:8086 --force

./influx bucket list
ID                      Name            Retention       Shard group duration    Organization ID Schema Type
8eec65b90f79c55e        _monitoring     168h0m0s        24h0m0s                 9050d0dddc192df9implicit
4d6413cbaad04850        _tasks          72h0m0s         24h0m0s                 9050d0dddc192df9implicit
a3521682726cd901        flexbucket      infinite        168h0m0s                9050d0dddc192df9implicit

# take the ID value for the flexbucket (Name) so we can update the retention policy to 104 weeks or 2 years
./influx bucket update --id a3521682726cd901 --retention 104w
```

### Windows

```
cd %FLEXDEPLOY_HOME%\influxdb
set INFLUX_DB_PASSWORD=<arbitrary value>
rmdir /s <user directory>\.influxdbv2
influx setup --bucket flexbucket --token %INFLUX_DB_TOKEN% --org flexdeploy --username=flexuser --password=%INFLUX_DB_PASSWORD% --host=http://localhost:8086 --force

influx bucket list
ID                      Name            Retention       Shard group duration    Organization ID Schema Type
8eec65b90f79c55e        _monitoring     168h0m0s        24h0m0s                 9050d0dddc192df9implicit
4d6413cbaad04850        _tasks          72h0m0s         24h0m0s                 9050d0dddc192df9implicit
a3521682726cd901        flexbucket      infinite        168h0m0s                9050d0dddc192df9implicit

# take the ID value for the flexbucket (Name) so we can update the retention policy to 104 weeks or 2 years
influx bucket update --id a3521682726cd901 --retention 104w
```

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

### Note for Oracle XE Database

> [!NOTE]
>
> After starting your server, check the **\<FLEXDEPLOY\_HOME>/apache-tomcat-flexdeploy/logs/flexdeploy.0.log** file for the following error message:
>
> * ORA-12519, TNS:no appropriate service handler found
>
> If present, increase the number of processes for the database
>
> * Using SQLPlus update processes setting.
>
>   * alter system set processes=200 scope=spfile;
>
> * Stop Tomcat
>
> * Restart the XE Database
>
> * Start Tomcat

***

## Step 12. Launch FlexDeploy in your browser.

* http\://***hostname***:8000/flexdeploy

  * Update hostname in URL to indicate host where FlexDeploy is installed.

  * Update port if you had modified server.xml for different port number.

* You will need to complete [Initial Registration](https://docs.flexagon.com/hidden/initial-registration.md) process, where you will create admin user for login.

***

## Step 13. Verification

Go to Administration - Plugins on FlexDeploy. Verify that Plugins are loaded. You should not see any files remaining in ***FD\_APPLICATION\_DIRECTORY***\*\*/plugins\*\* folder after a few minutes.

***

## Step 14. FlexDeploy configuration

Now that you have installed FlexDeploy, let's get start with configuration. You can do this in matter of minutes by using [Blueprints](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-users-guide/blueprints.md) concept, which is very simple configuration wizard for most common use cases.

# Related Topics

* [Change FlexDeploy process user on Linux](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/change-flexdeploy-process-user-on-linux.md)
* [Enabling HTTPS on FlexDeploy (Tomcat)](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/enabling-https-on-flexdeploy-tomcat.md)
* [Security Hardening options for FlexDeploy](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/security-hardening-options-for-flexdeploy.md)
* [Tuning Postgres for better performance if "cold" reads are slow](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/tuning-postgres-for-better-performance-if-cold-reads-are-slow.md)
* [FlexDeploy Backups Repository](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/flexdeploy-backups-repository.md)
* [Using Amazon RDS for PostgreSQL with FlexDeploy](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/using-amazon-rds-for-postgresql-with-flexdeploy.md)
* [Using FlexDeploy with a load Balancer that offloads HTTPS](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/using-flexdeploy-with-a-load-balancer-that-offloads-https.md)
* [Using FlexDeploy to access external services through a proxy](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/using-flexdeploy-to-access-external-services-through-a-proxy.md)
* [Enabling HSTS on FlexDeploy (Tomcat)](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-installation-guide/advanced/enabling-hsts-on-flexdeploy-tomcat.md)
