# Customize installation directories

```json metadata
{
  "schema_version": 2,
  "title": "Customize installation directories",
  "description": "Customize Redis Software installation directories.",
  "categories": ["docs","operate","rs"],
  "tableOfContents": {"sections":[{"id":"considerations","title":"Considerations"},{"id":"specify-file-locations","title":"Specify file locations"},{"id":"config-diff-data-log-dirs","title":"Configure different mount points for data and log directories"},{"id":"customize-storage-paths","title":"Customize storage paths"},{"id":"limitations","title":"Limitations"}]}

,
  "codeExamples": []
}
```


When you install Redis Software on Red Hat Enterprise Linux, you can customize the installation directories.

The files are installed in the `redislabs` directory located in the path that you specify.

## Considerations

- When you install with custom directories, the installation does not run as an RPM file.

- If a `redislabs` directory already exists in the path that you specify, the installation fails.

- All nodes in a cluster must be installed with the same file locations.

- Custom installation directories are not supported for databases using Auto Tiering.

- [Configure different mount points for data and log directories](#config-diff-data-log-dirs).

## Specify file locations

You can specify these file locations:

| Files               | Installer flag | Example parameter | Example file location |
| ------------------- | -------------- | ----------------- | --------------------- |
| Binaries files      | --install-dir  | /opt              | /opt/redislabs        |
| Configuration files | --config-dir   | /etc/opt          | /etc/opt/redislabs    |
| Data and log files  | --var-dir      | /var/opt          | /var/opt/redislabs    |

These files are not in the custom directories:

- OS files
    - /etc/cron.d/redislabs
    - /etc/firewalld/services
    - /etc/firewalld/services/redislabs-clients.xml
    - /etc/firewalld/services/redislabs.xml
    - /etc/ld.so.conf.d/redislabs_ldconfig.conf.tmpl
    - /etc/logrotate.d/redislabs
    - /etc/profile.d/redislabs_env.sh
    - /usr/lib/systemd/system/rlec_supervisor.service.tmpl
    - /usr/share/selinux/mls/redislabs.pp
    - /usr/share/selinux/targeted/redislabs.pp

- Installation reference files
    - /etc/opt/redislabs/redislabs_custom_install_version
    - /etc/opt/redislabs/redislabs_env_config.sh

To specify directories during [installation](https://redis.io/docs/latest/operate/rs/installing-upgrading/install/install-on-linux), include installer flags as [command-line options](https://redis.io/docs/latest/operate/rs/installing-upgrading/install/install-script) when you run the `install.sh` script. For example:

```sh
sudo ./install.sh --install-dir <path> --config-dir <path> --var-dir <path>
```

## Configure different mount points for data and log directories {#config-diff-data-log-dirs}

To configure different mount points for data and log directories, use symbolic links:

1. Create a symbolic link for the data directory:

    ```sh
    ln -s /var/opt/redislabs/data </path/to/data/mount/point>
    ```

1. Create a symbolic link for the log directory:

    ```sh
    ln -s /var/opt/redislabs/log </path/to/log/mount/point>
    ```

## Customize storage paths

When you install Redis Software to custom directories, you can specify custom storage paths for persistent and ephemeral storage during [cluster setup](https://redis.io/docs/latest/operate/rs/clusters/new-cluster-setup) or when [adding nodes](https://redis.io/docs/latest/operate/rs/clusters/add-node).


1. Specify the custom file location with the `--var-dir` option when you install Redis Software:

    ```sh
    sudo ./install.sh --var-dir <path>
    ```

2. Grant the `redislabs` user access to the custom directories:
   ```sh
   $ sudo chown -R redislabs:redislabs /path/to/custom/storage
   $ sudo chmod -R 755 /path/to/custom/storage
   ```

3. Confirm the storage path is properly mounted:
   ```sh
   $ df -h /path/to/custom/storage
   $ mount | grep /path/to/custom/storage
   ```

4. Verify the directory exists and is accessible:
   ```sh
   ls -l /path/to/custom/storage
   ```

For more information about storage requirements, see [Persistent and ephemeral node storage](https://redis.io/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage).

## Limitations

Several Redis Software installation reference files are installed to the directory `/etc/opt/redislabs/` even if you use custom installation directories.

As a workaround to install Redis Software without using any root directories, do the following before installing Redis Software:

1. Create all custom, non-root directories you want to use with Redis Software.

1. Mount `/etc/opt/redislabs` to one of the custom, non-root directories.

