SOLR_HOST is for handling oddball networking cases where, due to NAT or other trickery, the Solr node is unable to see the IP or resolve a host name that will be required for it to be addressed by other Solr nodes.
We are not responsible for whatever ChatGPT is smoking ;) Typically the env variables are documented by comments in the Solr.in.sh script, or the primary solr control script where they are used. If we haven't documented it well enough, feel free to point how we can do better, and supply a PR if you are able :) Also note that SOLR_HOST is already slated to be renamed to SOLR_HOST_ADVERTISE I offer https://issues.apache.org/jira/browse/SOLR-7977 and https://issues.apache.org/jira/browse/SOLR-17864 for your reading enjoyment On Wed, Feb 4, 2026 at 3:17 AM Matthias Apitz <[email protected]> wrote: > El día lunes, febrero 02, 2026 a las 02:22:49p. m. +0100, Alastair Porter > escribió: > > > Hi matthias, > > SOLR_HOST is not the same as SOLR_JETTY_HOST, see > > > https://solr.apache.org/guide/solr/latest/deployment-guide/taking-solr-to-production.html#security-considerations > > > > Regards, > > Alastair > > Hello Alastai, et all, > > Thanks! SOLR_JETTY_HOST did the trick. > > Btw: I (and my colleagues) have been confused by the env var SOLR_HOST. > And even ChatGPT spelled the nonsense attched below. For what is > SOLR_HOST exactly used for? Only for cosmetic purpos the show some > string in clients connecting? > > Thanks again > > > matthias > > > ChatGPT about this issue: > > In Apache Solr, the **interface (host/IP)** and **port** it listens on are > controlled at startup. How you set them depends on **how you run Solr** > (standalone vs SolrCloud, script vs service). > > --- > > ## 1. The most common way: `solr.in.sh` (recommended) > > Edit (or create) this file: > > ``` > $SOLR_HOME/bin/solr.in.sh > ``` > > Set these variables: > > ```bash > SOLR_HOST=0.0.0.0 > SOLR_PORT=8983 > ``` > > ### What they mean > > * **`SOLR_HOST`** > > * `127.0.0.1` → listen only on localhost > * `0.0.0.0` → listen on all network interfaces > * `192.168.1.10` → listen on a specific IP > * **`SOLR_PORT`** > > * Default is `8983` > > After editing, restart Solr: > > ```bash > bin/solr restart > ``` > > --- > > ## 2. Set host and port on the command line > > You can override everything at startup: > > ```bash > bin/solr start -h 0.0.0.0 -p 8984 > ``` > > Or explicitly: > > ```bash > bin/solr start -Dsolr.host=0.0.0.0 -Djetty.port=8984 > ``` > > --- > > ## 3. Systemd service (Linux servers) > > If Solr runs as a service: > > ```bash > sudo systemctl edit solr > ``` > > Add or override: > > ```ini > [Service] > Environment="SOLR_HOST=0.0.0.0" > Environment="SOLR_PORT=8983" > ``` > > Then reload and restart: > > ```bash > sudo systemctl daemon-reload > sudo systemctl restart solr > ``` > > --- > > ## 4. Verify Solr is listening > > ```bash > ss -lntp | grep 8983 > ``` > > or > > ```bash > netstat -lntp | grep 8983 > ``` > > You should see something like: > > ``` > LISTEN 0 128 0.0.0.0:8983 > ``` > > --- > > ## 5. Important security note ⚠️ > > If you set: > > ```bash > SOLR_HOST=0.0.0.0 > ``` > > **do not expose Solr directly to the internet** unless: > > * Authentication is enabled > * Firewall rules restrict access > * You’re behind a reverse proxy > > Solr has had many real-world breaches from open ports. > > --- > > If you want, tell me: > > * **Standalone or SolrCloud?** > * **Linux service or manual startup?** > * **Behind Nginx/Apache or direct access?** > > I can tailor the exact setup for your environment. > > -- > Matthias Apitz, ✉ [email protected], http://www.unixarea.de/ > +49-176-38902045 > Public GnuPG key: http://www.unixarea.de/key.pub > > Jens Spahn (CDU, 11.3.2025 in FAZ): > "Wir können uns verteidigen lernen oder alle Russisch lernen." > "We can learn to defend ourselves or we can all learn Russian." > "Podemos aprender a defendernos o todos podemos aprender ruso." > > Ich ziehe vor, Russisch zu lernen. I prefer to learn Russian. > Prefiero aprender ruso. > -- http://www.needhamsoftware.com (work) https://a.co/d/b2sZLD9 (my fantasy fiction book)
