<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Curious on Medium]]></title>
        <description><![CDATA[Stories by Curious on Medium]]></description>
        <link>https://medium.com/@always_curi0us?source=rss-2dd08e7597d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Curious on Medium</title>
            <link>https://medium.com/@always_curi0us?source=rss-2dd08e7597d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 17:02:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@always_curi0us/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How did I setup Ollama with SearXNG?]]></title>
            <link>https://medium.com/@always_curi0us/how-did-i-setup-ollama-with-searxng-ea713f94f179?source=rss-2dd08e7597d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea713f94f179</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[local-llm]]></category>
            <dc:creator><![CDATA[Curious]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 15:53:32 GMT</pubDate>
            <atom:updated>2025-11-28T14:26:52.225Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*-oTRiOWriTd-2IETuM-B6g.png" /></figure><p>Like most people, I also wanted to use a local LLM. My motivation was privacy. I ended up using ollama and openweb-ui. Even after setting them up, I used to go back to some online services. The major reason was hallucination and the absence of up-to-date info. With ‘web search’ feature available in many online services, I used to end up there very frequently. Then I realized that openweb-ui had the ‘web search’ feature. I could have used some APIs for search, but again the main motive was privacy. As I surfed the internet, I came across <strong>SearXNG</strong>, a meta-search engine which respects your privacy.</p><p>I use a laptop and I always find myself using my college wifi. What I wanted was to setup SearXNG and openweb-ui in docker so that they are isolated(incase if I mess up something, and to later clean them up easily) and also keep those services available only on the loopback interface since there was no reason for making those services available on my local network. During the setup, I learnt some docker networking, which I am not so good, but I think I can help my sharing what I did so that people in my situation can benefit.</p><p>First I just launched the SearXNG and openweb-ui containers using the commands mentioned in the documentation, but those commands made those services available on all interfaces which I didn’t want to happen. I started seeing some docker networking videos and ended up watching some part of this video which was enough for my setup.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbKFMS5C4CG0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbKFMS5C4CG0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbKFMS5C4CG0%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a80b4b033a45945652ca7fc55205d100/href">https://medium.com/media/a80b4b033a45945652ca7fc55205d100/href</a></iframe><ol><li>I created a docker network(which by default it bridge) so that my SearXNG and openweb-ui containers can talk to each other.</li></ol><pre>  docker network create packet</pre><p>‘packet’ is just my network name here.</p><p>2. Next, I started the SearXNG container. To make it available on the host machine, I bind it to the localhost of my host machine.</p><pre>mkdir -p ./searxng/config/ ./searxng/data/<br>cd ./searxng/<br>docker run \<br>  --network packet \<br>  -p 127.0.0.1:16000:8080 \<br>  -d \<br>  --name searxng \<br>  -v &quot;./config/:/etc/searxng/&quot; \<br>  -v &quot;./data/:/var/cache/searxng/&quot; \<br>  docker.io/searxng/searxng:latest</pre><p><em>16000</em> is just the port number which I choose, since it is rarely used by other services.</p><p>3. openweb-ui expects search results in json, so now I had to configure SearXNG to return json with html.</p><pre>docker container exec -it --user root searxng /bin/sh -l<br>cd /etc/searxng/<br>vi settings.yml</pre><p>Add <em>json</em> in the <em>format</em> section. After that exit and restart the container.</p><p>4. Now its time to start the openweb-ui container.</p><pre>docker run \<br>  -d \<br>  --network packet \<br>  -p 127.0.0.1:15000:8080 \<br>  --gpus all \<br>  --add-host=host.docker.internal:host-gateway \<br>  -v open-webui:/app/backend/data \<br>  --name open-webui \<br>  ghcr.io/open-webui/open-webui:cuda</pre><p>In my setup, ollama is on my host machine. So for openweb-ui to talk to ollama.service, it should be able to resolve the local machine’s address which is why I added this line <em>— add-host=host.docker.internal:host-gateway.</em></p><p>5. I should also inform openweb-ui about SearXNG and ollama.service.</p><p>To configure these, open the openweb-ui application,</p><p>settings &gt; admin settings &gt; connections &gt; ollama</p><p>By default, it is already set to the port 11434 which is the same as ollama.service’s default port.</p><p>For SearXNG,</p><p>settings &gt; admin settings &gt; web search</p><p>Enable search and add this link <a href="http://searxng:8080/search?q="><em>http://searxng:8080/search?q=</em></a><em>&lt;query&gt;</em></p><p>Here we are using searxng, since they both are in the custom network which we created and address is resolved just with the container name.</p><p>6. Last thing left is to bind ollama.service to docker interface. By default it is bind only to the local machine, and not available to the containers.</p><pre>sudo systemctl edit ollama.service</pre><p>Now add these lines, so that systemd knows on which interface to start the ollama service,</p><pre>[Service]<br>Environment=&quot;OLLAMA_HOST=172.17.0.1:11434&quot;</pre><p>Note that the address here I used is the docker interface address. If you no idea what I am talking about, I would recommend to go through some short networking videos, since I might not be the best person to explain networks. I got this by doing <em>ip a</em>, which would be different in your case. Just SearXNG on how to view the network interfaces in your case.</p><p>If you try to use ollama from your terminal now, you might get some error, since it isn’t bind to the local machine anymore. Just add this line to your shell config file now.</p><pre>export OLLAMA_HOST=&quot;http://172.17.0.1:11434&quot;</pre><p>Note that this <em>172.17.0.1</em> might be different in your case.</p><p>Voilà! My setup was ready and I hope this is useful. I just came up with this with my limited knowledge better solutions are welcome. If I have made some mistakes in networking(which I am not good at, just learnt some things to set this up), please correct me.</p><p>Useful Links:</p><ul><li><a href="https://docs.searxng.org/admin/installation.html">https://docs.searxng.org/admin/installation.html</a></li><li>docs.searxng.org/admin/settings/index.html</li><li><a href="https://github.com/open-webui/open-webui">https://github.com/open-webui/open-webui</a></li><li><a href="https://docs.docker.com/engine/network/">https://docs.docker.com/engine/network/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea713f94f179" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>