# Step 1: Prepare your environment

Prepare your Windows or Linux environment for an archive installation of Pentaho by completing the tasks for that environment:

* [Preparing a Windows environment for archive installation](#preparing-a-windows-environment-for-archive-installation)
* [Preparing a Linux environment for archive installation](#preparing-a-linux-environment-for-archive-installation)

## Preparing a Windows environment for archive installation

Prepare a Windows environment for an archive installation by completing the following tasks, in order:

{% stepper %}
{% step %}

### Create the Windows folder structure

1. Sign in to Windows.
2. Create the `pentaho\\server` folder (for example, `C:\\pentaho\\server`).
3. Verify that you have read, write, and execute permissions for the folder.
4. Verify that users can write to the folder where you are installing Pentaho.
   {% endstep %}

{% step %}

### Install Java on Windows

Pentaho requires a supported Java version.

1. Check the [Components Reference](https://docs.pentaho.com/install/components-reference) for supported Java versions.
2. Download and install the supported JRE or JDK from the [Oracle website](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
3. Set the `JAVA_HOME` environmental variable to point to your Java installation folder by running the following command:

   ```shellscript
   set JAVA_HOME="C:\\Program Files\\Java\\<JDK_FOLDER>"
   ```

{% endstep %}

{% step %}

### Install the Pentaho Repository host database on Windows

The Pentaho Repository stores data used for scheduling and security. It also stores metadata and models for reports.

1. Choose a database to host the Pentaho Repository. Pentaho supports the following databases:
   * PostgreSQL
   * MySQL
   * MariaDB
   * Oracle
   * MS SQL Server
2. Check the [Components Reference](https://docs.pentaho.com/install/components-reference) for the supported version of your selected database.
3. Install the selected database.
4. Verify the database is installed correctly.
   {% endstep %}

{% step %}

### Download and unpack installation files in Windows

Pentaho Server and Operations Mart are delivered as compressed files. Installing them requires downloading the files, unpacking them, and placing their contents in the appropriate directories.

#### Download files in Windows

1. Sign in to the [Support Portal](https://support.pentaho.com/hc/en-us) using the credentials from your Pentaho Welcome Packet.
2. In the **Pentaho** card, select **Download**.
3. In the **11.x** list, select **Pentaho 11.0 GA Release**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You might need to select <strong>See all &#x3C;number> articles</strong> to see the full list of 11.x downloads.</p></div>
4. Scroll to the bottom of the **Pentaho 11.0 GA Release** page.
5. In the file component section, go to `Pentaho Server\\Archive Build (Suggested Installation Method)`.
6. Download `pentaho-server-ee-11.0.0.0-<build number>.zip`.
7. In the file component section, go back to `11.0.0.0-GA`.
8. Open the `Operations Mart` folder.
9. Download `pentaho-operations-mart-11.0.0.0-<build number>.zip`.

#### Unpack installation files in Windows

1. Locate the two files you downloaded:
   * `pentaho-server-ee-11.0.0.0-<build number>.zip`
   * `pentaho-operations-mart-11.0.0.0-<build number>.zip`
2. Unpack `pentaho-server-ee-11.0.0.0-<build number>.zip` into the `\\pentaho\\server` folder.
3. Unpack `pentaho-operations-mart-11.0.0.0-<build number>.zip` into the `\\pentaho\\server` folder.
4. Move the folder for your database into the `pentaho\\server\\pentaho-server\\data\\<database name>` folder. Use one of the following folder names for your database:
   * PostgreSQL → `postgresql`
   * MySQL or MariaDB → `mysql5`
   * Oracle → `oracle10g`
   * MS SQL Server → `sqlserver`
5. Delete the other database folders.
6. Complete the steps for installing Data Integration Operations Mart in the **Administer Pentaho Data Integration and Analytics** document before installing your database.

#### Verify folder structure in Windows

Verify that the files are placed in the correct folders.

Your `pentaho` folder should include the following paths:

* `pentaho\\server\\pentaho-server\\`
* `pentaho\\server\\pentaho-server\\data\\<database name>`
  {% endstep %}

{% step %}

### Set environment variables in Windows

If you do not set the required `*_HOME` environment variables, Pentaho might not start correctly.

1. Set `PENTAHO_JAVA_HOME` to your Java installation directory by running the following command:

   ```shellscript
   set PENTAHO_JAVA_HOME="C:\\Program Files\\Java\\<JDK_FOLDER>"
   ```
2. (Optional) If you are using a JRE, also set `JRE_HOME`.
3. Sign out, sign back in, and then verify the variables are set by running the following command:

   ```shellscript
   echo %PENTAHO_JAVA_HOME%
   ```

After you finish preparing your environment, go to [Step 2: Set up the Pentaho Repository](https://docs.pentaho.com/install/pentaho-installation-overview-cp/archive-installation/step-2-set-up-the-pentaho-repository).
{% endstep %}
{% endstepper %}

## Preparing a Linux environment for archive installation

Prepare a Linux environment for an archive installation by completing the following tasks, in order:

{% stepper %}
{% step %}

### Create the Pentaho user in Linux

Create a user account with administrative privileges to use for preparing your Linux environment.

1. Create an administrative user on the server and name it `pentaho`.
2. Verify the `pentaho` user can read, write, and run commands in its home directory.
3. Verify users can write to the directory where you install Pentaho.
   {% endstep %}

{% step %}

### Create the Linux directory structure

1. Sign in to Linux as the `pentaho` user.
2. Create the following directories:
   * ```
     <your home directory>/pentaho/server
     ```
   * ```
     <your home directory>/.pentaho
     ```
3. Verify that you have read, write, and execute permissions for both directories.
   {% endstep %}

{% step %}

### Install Java on Linux

Pentaho requires a supported Java version.

1. Check [Components Reference](https://docs.pentaho.com/install/components-reference) for supported Java versions.
2. Download and install the supported JRE or JDK from the [Oracle website](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
3. Set the `JAVA_HOME` environmental variable to point to your Java installation folder by running the following command:

   ```shellscript
   export JAVA_HOME=/usr/lib/jvm/jdk11.x.x.x
   ```

{% endstep %}

{% step %}

### Install the Pentaho Repository host database on Linux

The Pentaho Repository stores data used for scheduling and security. It also stores metadata and models for reports.

1. Choose a database to host the Pentaho Repository. Pentaho supports the following databases:
   * PostgreSQL
   * MySQL
   * MariaDB
   * Oracle
   * MS SQL Server
2. Check the [Components Reference](https://docs.pentaho.com/install/components-reference) for the supported version of your selected database.
3. Install the selected database.
4. Verify the database is installed correctly.
   {% endstep %}

{% step %}

### Download and unpack installation files in Linux

Pentaho Server and Operations Mart are delivered as compressed files. Installing them requires downloading the files, unpacking them, and placing their contents in the appropriate directories.

#### Download files in Linux

1. Sign in to the [Support Portal](https://support.pentaho.com/hc/en-us) using the credentials from your Pentaho Welcome Packet.
2. In the **Pentaho** card, select **Download**.
3. In the **11.x** list, select **Pentaho 11.0 GA Release**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You might need to select <strong>See all &#x3C;number> articles</strong> to see the full list of 11.x downloads.</p></div>
4. Scroll to the bottom of the **Pentaho 11.0 GA Release** page.
5. In the file component section, go to `Pentaho Server/Archive Build (Suggested Installation Method)`.
6. Download `pentaho-server-ee-11.0.0.0-<build number>.zip`.
7. In the file component section, go back to `11.0.0.0-GA`.
8. Open the `Operations Mart` folder.
9. Download `pentaho-operations-mart-11.0.0.0-<build number>.zip`.

#### Unpack installation files in Linux

1. Locate the two files you downloaded:
   * `pentaho-server-ee-11.0.0.0-<build number>.zip`
   * `pentaho-operations-mart-11.0.0.0-<build number>.zip`
2. Unpack `pentaho-server-ee-11.0.0.0-<build number>.zip` into the `/pentaho/server` directory.
3. Unpack `pentaho-operations-mart-11.0.0.0-<build number>.zip` into the `/pentaho/server` directory.
4. Move the directory for your database into `pentaho/server/pentaho-server/data/<database name>`. Use one of the following folder names for your database:
   * PostgreSQL → `postgresql`
   * MySQL or MariaDB → `mysql5`
   * Oracle → `oracle10g`
   * MS SQL Server → `sqlserver`
5. Delete the other database folders.
6. Complete the steps for installing Data Integration Operations Mart in the **Administer Pentaho Data Integration and Analytics** document before installing your database.

#### Verify directory structure in Linux

Verify that the files are placed in the correct directories.

Your `pentaho` directory should include the following paths:

* `pentaho/server/pentaho-server/`
* `pentaho/server/pentaho-server/data/<database name>`
  {% endstep %}

{% step %}

### Set environment variables in Linux

If you do not set the required `*_HOME` environment variables, Pentaho might not start correctly.

1. Set `PENTAHO_JAVA_HOME` to your Java installation directory:

```
export PENTAHO_JAVA_HOME=/usr/lib/jvm/java-11-oracle
```

2. (Optional) If you are using a JRE, also set `JRE_HOME`.
3. Sign out, sign back in, and then verify the variables are set.
   {% endstep %}

{% step %}

### Review advanced Linux considerations

Some headless server configurations require additional setup, including:

* Linux systems without a video card
* Linux systems with a video card but no X server installed

In some environments, especially systems without a video card, you might need to complete both procedures to generate reports.

#### Linux systems without video cards

{% hint style="warning" %}
**Important:** Startup can fail if any environment variable value is invalid. Double-check settings after edits.
{% endhint %}

Before you start Pentaho Server for the first time, add the following parameter to `CATALINA_OPTS` in your application server startup scripts: `-Djava.awt.headless=true`

{% code overflow="wrap" %}

```shellscript
-Djava.awt.headless=true
```

{% endcode %}

Example:

{% code overflow="wrap" %}

```shellscript
export CATALINA_OPTS="-Djava.awt.headless=true -Xms4096m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
```

{% endcode %}

If you create a service control script, add the same parameter to its `CATALINA_OPTS.dits`.

#### Linux systems without X11

Chart generation requires X11 functions.&#x20;

If you cannot install an X server, install `Xvfb` instead. `Xvfb` emulates X11 in memory.

Install `Xvfb` using your operating system’s package manager.

After you finish preparing your environment, go to [Step 2: Set up the Pentaho Repository](https://docs.pentaho.com/install/pentaho-installation-overview-cp/archive-installation/step-2-set-up-the-pentaho-repository).
{% endstep %}
{% endstepper %}
