# Bitnami Secure Image for Apache Solr

> Apache Solr is an extremely powerful, open source enterprise search platform built on Apache Lucene. It is highly reliable and flexible, scalable, and designed to add value very quickly after launch.

[Overview of Apache Solr](https://solr.apache.org)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

## TL;DR

```console
docker run --name solr bitnami/solr:latest
```

## Using `docker-compose.yml`

The docker-compose.yaml file of this container can be found in the [Bitnami Containers repository](https://github.com/bitnami/containers/).

[https://github.com/bitnami/containers/tree/main/bitnami/solr/docker-compose.yml](https://github.com/bitnami/containers/tree/main/bitnami/solr/docker-compose.yml)

Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/solr).

## Why use Bitnami Secure Images?

Those are hardened, minimal CVE images built and maintained by Bitnami. Bitnami Secure Images are based on the cloud-optimized, security-hardened enterprise [OS Photon Linux](https://vmware.github.io/photon/). Why choose BSI images?

- Hardened secure images of popular open source software with Near-Zero Vulnerabilities
- Vulnerability Triage & Prioritization with VEX Statements, KEV and EPSS Scores
- Compliance focus with FIPS, STIG, and air-gap options, including secure bill of materials (SBOM)
- Software supply chain provenance attestation through in-toto
- First class support for the internet’s favorite Helm charts

Each image comes with valuable security metadata. You can view the metadata in [our public catalog here](https://app-catalog.vmware.com/bitnami/apps). Note: Some data is only available with [commercial subscriptions to BSI](https://bitnami.com/).

![Alt text](https://github.com/bitnami/containers/blob/main/BSI%20UI%201.png?raw=true "Application details")
![Alt text](https://github.com/bitnami/containers/blob/main/BSI%20UI%202.png?raw=true "Packaging report")

If you are looking for our previous generation of images based on Debian Linux, please see the [Bitnami Legacy registry](https://hub.docker.com/u/bitnamilegacy).

## Supported tags and respective `Dockerfile` links

Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-understand-rolling-tags-containers-index.html).

## Get this image

The Bitnami Apache Solr Docker image is only available to [Bitnami Secure Images](https://bitnami.com) customers.

## Persisting your application

If you remove the container all your data and configurations will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should mount a volume at the `/bitnami` path. The above examples define a docker volume namely `solr_data`. The Solr application state will persist as long as this volume is not removed.

To avoid inadvertent removal of this volume you can [mount host directories as data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Alternatively you can make use of volume plugins to host the volume data.

> **NOTE** As this is a non-root container, the mounted files and directories must have the proper permissions for the UID `1001`.

## Connecting to other containers

Using [Docker container networking](https://docs.docker.com/engine/userguide/networking/), a Solr server running inside a container can easily be accessed by your application containers.

Containers attached to the same network can communicate with each other using the container name as the hostname.

## Configuration

The following sections describe environment variables and related settings.

### Environment variables

The following tables list the main variables you can set.

#### Customizable environment variables

| Name                            | Description                                                                   | Default Value                                      |
|---------------------------------|-------------------------------------------------------------------------------|----------------------------------------------------|
| `SOLR_ENABLE_CLOUD_MODE`        | Starts solr in cloud mode                                                     | `no`                                               |
| `SOLR_NUMBER_OF_NODES`          | Number of nodes of the solr cloud cluster                                     | `1`                                                |
| `SOLR_HOST`                     | Solr Host name                                                                | `nil`                                              |
| `SOLR_HOST_BIND`                | Configuration to listen on a specific IP address or host name                 | `0.0.0.0`                                          |
| `SOLR_HEAP`                     | Solr Heap                                                                     | `nil`                                              |
| `SOLR_SECURITY_MANAGER_ENABLED` | Solr Java security manager                                                    | `false`                                            |
| `SOLR_JAVA_MEM`                 | Solr JVM memory                                                               | `-Xms512m -Xmx512m`                                |
| `SOLR_PORT_NUMBER`              | Solr port number                                                              | `8983`                                             |
| `SOLR_CORES`                    | Solr CORE name                                                                | `nil`                                              |
| `SOLR_COLLECTION`               | Solr COLLECTION name                                                          | `nil`                                              |
| `SOLR_COLLECTION_REPLICAS`      | Solar collection replicas                                                     | `1`                                                |
| `SOLR_COLLECTION_SHARDS`        | Solar collection shards                                                       | `1`                                                |
| `SOLR_ENABLE_AUTHENTICATION`    | Enables authentication                                                        | `no`                                               |
| `SOLR_ADMIN_USERNAME`           | Administrator Username                                                        | `admin`                                            |
| `SOLR_ADMIN_PASSWORD`           | Administrator password                                                        | `nil`                                              |
| `SOLR_CLOUD_BOOTSTRAP`          | Indicates if this node is the one that performs the boostraping               | `no`                                               |
| `SOLR_CORE_CONF_DIR`            | Solar CORE configuration directory                                            | `${SOLR_SERVER_DIR}/solr/configsets/_default/conf` |
| `SOLR_SSL_ENABLED`              | Indicates if Solr starts with SSL enabled                                     | `no`                                               |
| `SOLR_SSL_CHECK_PEER_NAME`      | Indicates if Solr should check the peer names                                 | `true`                                             |
| `SOLR_SSL_KEY_STORE_PASSWORD`   | Password for the Solr SSL keystore                                            | `nil`                                              |
| `SOLR_SSL_TRUST_STORE_PASSWORD` | Password for the Solr SSL truststore                                          | `nil`                                              |
| `SOLR_ZK_MAX_RETRIES`           | Maximum retries when waiting for zookeeper configuration operations to finish | `5`                                                |
| `SOLR_ZK_SLEEP_TIME`            | Sleep time when waiting for zookeeper configuration operations to finish      | `5`                                                |
| `SOLR_ZK_CHROOT`                | ZooKeeper ZNode chroot where to store solr data. Default: /solr               | `/solr`                                            |
| `SOLR_ZK_HOSTS`                 | ZooKeeper nodes (comma-separated list of `host:port`)                         | `nil`                                              |

#### Read-only environment variables

| Name                         | Description                            | Value                                          |
|------------------------------|----------------------------------------|------------------------------------------------|
| `BITNAMI_VOLUME_DIR`         | Directory where to mount volumes.      | `/bitnami`                                     |
| `SOLR_BASE_DIR`              | Solr installation directory.           | `${BITNAMI_ROOT_DIR}/solr`                     |
| `SOLR_JAVA_HOME`             | JAVA installation directory.           | `${BITNAMI_ROOT_DIR}/java`                     |
| `SOLR_BIN_DIR`               | Solr directory for binary executables. | `${SOLR_BASE_DIR}/bin`                         |
| `SOLR_TMP_DIR`               | Solr directory for temp files.         | `${SOLR_BASE_DIR}/tmp`                         |
| `SOLR_PID_DIR`               | Solr directory for PID files.          | `${SOLR_BASE_DIR}/tmp`                         |
| `SOLR_LOGS_DIR`              | Solr directory for logs files.         | `${SOLR_BASE_DIR}/logs`                        |
| `SOLR_SERVER_DIR`            | Solr directory for server files.       | `${SOLR_BASE_DIR}/server`                      |
| `SOLR_VOLUME_DIR`            | Solr persistence directory.            | `${BITNAMI_VOLUME_DIR}/solr`                   |
| `SOLR_DATA_TO_PERSIST`       | Solr data to persist.                  | `server/solr`                                  |
| `SOLR_PID_FILE`              | Solr PID file                          | `${SOLR_PID_DIR}/solr-${SOLR_PORT_NUMBER}.pid` |
| `SOLR_DAEMON_USER`           | Solr system user                       | `solr`                                         |
| `SOLR_DAEMON_GROUP`          | Solr system group                      | `solr`                                         |
| `SOLR_ZK_CONNECTION_TIMEOUT` | ZooKeeper connection attempt timeout.  | `10`                                           |

### Using your Apache Solr Cores configuration files

In order to load your own configuration files, you will have to make them available to the container. You can do it mounting a [volume](https://docs.docker.com/engine/tutorials/dockervolumes/) in the desired location and setting the environment variable with the customized value (as it is pointed above, the default value is **data_driven_schema_configs**).

### FIPS configuration in Bitnami Secure Images

The Bitnami Apache Solr Docker image from the [Bitnami Secure Images](https://go-vmware.broadcom.com/contact-us) catalog includes extra features and settings to configure the container with FIPS capabilities. You can configure the next environment variables:

- `OPENSSL_FIPS`: whether OpenSSL runs in FIPS mode or not. `yes` (default), `no`.
- `JAVA_TOOL_OPTIONS`: controls Java FIPS mode. Use `-Djava.security.properties==/opt/bitnami/java/conf/security/java.security.restricted` (restricted), `-Djava.security.properties==/opt/bitnami/java/conf/security/java.security.relaxed` (relaxed), or `-Djava.security.properties==/opt/bitnami/java/conf/security/java.security.original` (off).

## Logging

The Bitnami Apache Solr Docker image sends the container logs to the `stdout`. You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver.

## Notable changes

The following subsections describe notable changes.

### 8.11.3-debian-12-r2 and 9.5.0-debian-12-r7

- Remove HDFS modules due to CVEs

### 8.8.0-debian-10-r11

- Adds SSL support.

### 8.8.0-debian-10-r9

- The Solr container initialization logic has been moved to Bash scripts.
- The size of the container image has been decreased.
- Added the support for cloud mode.
- Added support for authentication and admin user creation.
- Data migration for the upgrades. If you are running an older version of this container, run this version as user `root` and it will migrate your current data.

### 7.4.0-r23

- The Solr container has been migrated to a non-root user approach. Previously the container ran as the `root` user and the Solr daemon was started as the `solr` user. From now on, both the container and the Solr daemon run as user `1001`. As a consequence, the data directory must be writable by that user. You can revert this behavior by changing `USER 1001` to `USER root` in the Dockerfile.

## License

Copyright &copy; 2026 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
