> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-admin/9.3-administer/manage-the-pentaho-system/manage-pentaho-licenses/manage-licenses-using-the-command-line-interface.md).

# Manage licenses using the command line interface

You can set the license path environment variable, install the license files, update the license files, list the license files, or remove license files.

## Setting the license path environment variable

To ensure that the Pentaho Server uses the same location to store and retrieve your Pentaho licenses, you must create a *PENTAHO\_INSTALLED\_LICENSE\_PATH* system environment variable for your Pentaho user account if it does not exist. It does not matter what location you choose; however, the location needs to be available to the user account(s) that run the Pentaho Server.

* [Set the license path variable on Linux](#set-the-license-path-variable-on-linux)
* [Set the license path environment variable on Windows](#set-the-license-path-environment-variable-on-windows)

### Set the license path variable on Linux

1. Edit your `/etc/environment` file with a text editor.
2. Add this line in a convenient place (changing the path as explained above, if necessary):

   ```
   export PENTAHO_INSTALLED_LICENSE_PATH=/home/pentaho/.installedLicenses.xml
   ```
3. You must log out and log back into the operating system for the change to take effect.
4. Verify that the variable is properly set.

   ```
   env | grep PENTAHO_INSTALLED_LICENSE_PATH
   ```

The *PENTAHO\_INSTALLED\_LICENSE\_PATH* variable is now set.

### Set the license path environment variable on Windows

1. In Windows, right-click on **Computer**, then select **Properties** from context menu, then click **Advanced System Settings**.

   The System Properties window will appear.
2. In the System Properties window, click the **Advanced** tab, then click **Environment Variables**.
3. In the System Variable section, click **New**.

   A dialog box will ask for a variable name and value.
4. Type `PENTAHO_INSTALLED_LICENSE_PATH` into the **name** field, and the directory you intend to install licenses to plus `.installedLicenses.xml` in the **value** field, then click **OK**.

   ```
   C:/pentaho/.installedLicenses.xml
   ```
5. In the parent window, click **Apply Changes**.
6. You must restart your computer for the change to take effect.
7. Verify that the variable is properly set, using a command prompt:

   ```
   echo %PENTAHO_INSTALLED_LICENSE_PATH%
   ```

The *PENTAHO\_INSTALLED\_LICENSE\_PATH* variable is now set.

If you run Tomcat automatically as a Windows service, you must also configure it to run on the Windows user account where the `.installedLicenses.xml` file is located.

## Install or update license files from the command line

To install or update license files, follow the steps below.

1. Download the `.lic` file(s) you want to install.
2. Navigate to the `/license-installer/` directory where Pentaho PDI tool is installed (the `license-installer` subfolder).
3. Copy your `.lic` files to the `/license-installer/` directory.
4. Run the license installation script:
   * Linux:

     Run `install_license.sh` with the install switch and the location and name of your `.lic` file as a parameter. You can specify multiple `.lic` files separated by spaces. Be sure to use backslashes (\\) to escape any spaces in the path or file name.

     ```
      ./install_license.sh install Pentaho\ BI\ Platform\ Enterprise\ Edition.lic 
     ```
   * Windows:

     Run `install_license.bat` with the install switch and the location and name of your license file as a parameter. Be sure to use quotation marks (") to escape any spaces in the path or file name.

     ```
     install_license.bat install "C:\Users\username\Downloads\Pentaho BI Platform Enterprise Edition.lic"
     ```
5. Repeat the previous step for all needed licenses.

## List or remove license files from the command line

To list or remove license files, follow the steps below.

1. Navigate to the `/pentaho/server/license-installer/` directory.
2. Run the following scripts with the `display` switch:

   * Linux:

     ```
     ./install_license.sh display
     ```
   * Windows:

     ```
     install_license.bat dis
     ```

   If you have installed any Enterprise Edition license files, a list of them will appear, along with the products they cover and the duration of the license.
3. To remove a license, run the same script with the `uninstall` switch.

   A list of installed licenses will appear, followed by a prompt for the license ID you would like to remove. If you press Enter at this prompt, it will exit without taking any action.
4. Type in the license ID number that you want to remove, then press Enter.

After removing a file, if you had more than one installed, the list will regenerate and the prompt will reappear. You can choose to remove another license file, or you can press Enter to exit the script.

If you would prefer not to be prompted for confirmation, or if you intend to call this program as part of a script, use the `-q` switch to suppress prompting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-admin/9.3-administer/manage-the-pentaho-system/manage-pentaho-licenses/manage-licenses-using-the-command-line-interface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
