# Instalação e configuração Ollama

# How to locally deploy ollama and Open-WebUI with Docker Compose

<div class="gn go gp gq gr" id="bkmrk-link%3A-https%3A%2F%2Fmedium" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><div><div><div class="speechify-ignore ab cp"><div class="speechify-ignore bh l"><div class="hv hw hx hy hz ab"><div class="bn bh l"><div class="l is"><div class="ab cn it iu iv"><div class="ab ae"><span data-testid="storyPublishDate">Link: [https://medium.com/@edu.ukulelekim/how-to-locally-deploy-ollama-and-open-webui-with-docker-compose-318f0582e01f](https://medium.com/@edu.ukulelekim/how-to-locally-deploy-ollama-and-open-webui-with-docker-compose-318f0582e01f)</span></div><div class="ab ae">  
</div><div class="ab ae"><span data-testid="storyPublishDate">May 21, 2024</span></div></div></div></div></div><div class="ab cp iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn"><div class="h k w fg fh q"><div class="kd l"><div class="ab q ke kf"><div class="pw-multi-vote-icon fj kg kh ki kj">[<div><div aria-describedby="3" aria-hidden="false" aria-labelledby="3" class="bm"><div class="kk ao kl km kn ko am kp kq kr kj"><svg aria-label="clap" height="24" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M11.37.828 12 3.282l.63-2.454zM13.916 3.953l1.523-2.112-1.184-.39zM8.589 1.84l1.522 2.112-.337-2.501zM18.523 18.92c-.86.86-1.75 1.246-2.62 1.33a6 6 0 0 0 .407-.372c2.388-2.389 2.86-4.951 1.399-7.623l-.912-1.603-.79-1.672c-.26-.56-.194-.98.203-1.288a.7.7 0 0 1 .546-.132c.283.046.546.231.728.5l2.363 4.157c.976 1.624 1.141 4.237-1.324 6.702m-10.999-.438L3.37 14.328a.828.828 0 0 1 .585-1.408.83.83 0 0 1 .585.242l2.158 2.157a.365.365 0 0 0 .516-.516l-2.157-2.158-1.449-1.449a.826.826 0 0 1 1.167-1.17l3.438 3.44a.363.363 0 0 0 .516 0 .364.364 0 0 0 0-.516L5.293 9.513l-.97-.97a.826.826 0 0 1 0-1.166.84.84 0 0 1 1.167 0l.97.968 3.437 3.436a.36.36 0 0 0 .517 0 .366.366 0 0 0 0-.516L6.977 7.83a.82.82 0 0 1-.241-.584.82.82 0 0 1 .824-.826c.219 0 .43.087.584.242l5.787 5.787a.366.366 0 0 0 .587-.415l-1.117-2.363c-.26-.56-.194-.98.204-1.289a.7.7 0 0 1 .546-.132c.283.046.545.232.727.501l2.193 3.86c1.302 2.38.883 4.59-1.277 6.75-1.156 1.156-2.602 1.627-4.19 1.367-1.418-.236-2.866-1.033-4.079-2.246M10.75 5.971l2.12 2.12c-.41.502-.465 1.17-.128 1.89l.22.465-3.523-3.523a.8.8 0 0 1-.097-.368c0-.22.086-.428.241-.584a.847.847 0 0 1 1.167 0m7.355 1.705c-.31-.461-.746-.758-1.23-.837a1.44 1.44 0 0 0-1.11.275c-.312.24-.505.543-.59.881a1.74 1.74 0 0 0-.906-.465 1.47 1.47 0 0 0-.82.106l-2.182-2.182a1.56 1.56 0 0 0-2.2 0 1.54 1.54 0 0 0-.396.701 1.56 1.56 0 0 0-2.21-.01 1.55 1.55 0 0 0-.416.753c-.624-.624-1.649-.624-2.237-.037a1.557 1.557 0 0 0 0 2.2c-.239.1-.501.238-.715.453a1.56 1.56 0 0 0 0 2.2l.516.515a1.556 1.556 0 0 0-.753 2.615L7.01 19c1.32 1.319 2.909 2.189 4.475 2.449q.482.08.971.08c.85 0 1.653-.198 2.393-.579.231.033.46.054.686.054 1.266 0 2.457-.52 3.505-1.567 2.763-2.763 2.552-5.734 1.439-7.586z" fill-rule="evenodd"></path></svg></div></div></div>](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2F318f0582e01f&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40edu.ukulelekim%2Fhow-to-locally-deploy-ollama-and-open-webui-with-docker-compose-318f0582e01f&user=Aiden+Kim&userId=503d25fd9782&source=---header_actions--318f0582e01f---------------------clap_footer-----------)</div><div class="pw-multi-vote-count l ks kt ku kv kw kx ky"></div></div></div></div></div></div></div></div></div></div></div></div><div class="gn go gp gq gr" id="bkmrk-ollama-and-open-webu" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="mk ml mm mn mo mp mh mi paragraph-image"><div class="mq mr fj ms bh mt" role="button" tabindex="0"><div class="mh mi mj"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/1*xBIjpwx3XsbfK_xkMzhvuw.png 1400w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/1*xBIjpwx3XsbfK_xkMzhvuw.png 640w, https://miro.medium.com/v2/resize:fit:720/1*xBIjpwx3XsbfK_xkMzhvuw.png 720w, https://miro.medium.com/v2/resize:fit:750/1*xBIjpwx3XsbfK_xkMzhvuw.png 750w, https://miro.medium.com/v2/resize:fit:786/1*xBIjpwx3XsbfK_xkMzhvuw.png 786w, https://miro.medium.com/v2/resize:fit:828/1*xBIjpwx3XsbfK_xkMzhvuw.png 828w, https://miro.medium.com/v2/resize:fit:1100/1*xBIjpwx3XsbfK_xkMzhvuw.png 1100w, https://miro.medium.com/v2/resize:fit:1400/1*xBIjpwx3XsbfK_xkMzhvuw.png 1400w">![](https://miro.medium.com/v2/resize:fit:1040/1*xBIjpwx3XsbfK_xkMzhvuw.png)</source></source></picture></div></div><figcaption class="mv ff mw mh mi mx my bf b bg z du" data-selectable-paragraph="">ollama and Open-WebUI performs like ChatGPT in local.</figcaption></figure></div></div></div>There are so many web services using LLM like ChatGPT, while some tools are developed to run the LLM locally.

One of them is **ollama** which makes you interact with LLM locally. And if you have local LLM rather than the ones based on other remote server, you can…

<div class="gn go gp gq gr" id="bkmrk-avoid-personal-infor" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- Avoid personal information leaks
- Test the open LLM with no additional cost

</div></div></div>So I’ll deploy **ollama** with open LLM, **llama3** on my laptop.

The specification of the laptop is as below:

<div class="gn go gp gq gr" id="bkmrk-cpu%3A-amd-ryzen-7-480" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- CPU: AMD Ryzen 7 4800H with Radeon Graphics 2.90 GHz
- RAM: 32 GB

</div></div></div>And I’ll use **Open-WebUI** which can easily interact with ollama on the web browser.

**Open-WebUI** has a web UI similar to ChatGPT, and you can configure the connected LLM from ollama on the web UI as well.

I run **ollama and Open-WebUI on container** because each tool can provide its feature consistently in the independent environment from the host.

Fortunately, there are official Docker images for both of the tools, so it become easier to deploy them locally.

When deploying containerized ollama and Open-WebUI, I’ll use Docker Compose which can run multiple container with consistent configuration at once.

With this article, you can understand how to deploy ollama and Open-WebUI locally with Docker Compose.

<div class="ab cb of og oh oi" id="bkmrk--2" role="separator" style="text-align: justify;">  
</div>So, let’s start with defining *compose.yaml* file that Docker Compose uses to deploy the containers.

```
services:<br></br>  openWebUI:<br></br>    image: ghcr.io/open-webui/open-webui:main<br></br>    restart: always<br></br>    ports:<br></br>      - "3000:8080"<br></br>    extra_hosts:<br></br>      - "host.docker.internal:host-gateway"<br></br>    volumes:<br></br>      - open-webui-local:/app/backend/data<br></br><br></br>  ollama:<br></br>    image: ollama/ollama:0.1.34<br></br>    ports:<br></br>      - "11434:11434"<br></br>    volumes:<br></br>      - ollama-local:/root/.ollama<br></br><br></br>volumes:<br></br>  ollama-local:<br></br>    external: true<br></br>  open-webui-local:<br></br>    external: true
```

Next step is creating **Docker Volume** with Docker CLI. **Docker Volume** is a storage that Docker Container uses to save their data.

As defining on the above *compose.yaml* file, I need to create two volume *ollama-local* and *open-webui-local*, which are for ollama and open-webui, with the below commands on CLI.

<div class="gn go gp gq gr" id="bkmrk-docker-volume-create" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- **docker volume create ollama-local**
- **docker volume create open-webui-local**

</div></div></div>Now, I’ll deploy these two containers on local with docker compose command. Before that, let’s check if the compose yaml file can run appropriately. We can dry run the yaml file with the below command.

<div class="gn go gp gq gr" id="bkmrk-docker-compose-%E2%80%94-dry" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- **docker compose — dry-run up -d** (On path including the *compose.yaml*)

<figure class="oo op oq or os mp mh mi paragraph-image"><div class="mq mr fj ms bh mt" role="button" tabindex="0"><div class="mh mi pd"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/0*yRVBxCKdVOETKp5a.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/0*yRVBxCKdVOETKp5a.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/0*yRVBxCKdVOETKp5a.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/0*yRVBxCKdVOETKp5a.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/0*yRVBxCKdVOETKp5a.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/0*yRVBxCKdVOETKp5a.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/0*yRVBxCKdVOETKp5a.png 1400w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/0*yRVBxCKdVOETKp5a.png 640w, https://miro.medium.com/v2/resize:fit:720/0*yRVBxCKdVOETKp5a.png 720w, https://miro.medium.com/v2/resize:fit:750/0*yRVBxCKdVOETKp5a.png 750w, https://miro.medium.com/v2/resize:fit:786/0*yRVBxCKdVOETKp5a.png 786w, https://miro.medium.com/v2/resize:fit:828/0*yRVBxCKdVOETKp5a.png 828w, https://miro.medium.com/v2/resize:fit:1100/0*yRVBxCKdVOETKp5a.png 1100w, https://miro.medium.com/v2/resize:fit:1400/0*yRVBxCKdVOETKp5a.png 1400w">![](https://miro.medium.com/v2/resize:fit:1040/0*yRVBxCKdVOETKp5a.png)</source></source></picture></div></div></figure></div></div></div>After dry running, we can see that it runs appropriately. So let’s deploy the containers with the below command

<div class="gn go gp gq gr" id="bkmrk-docker-compose-up--d" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- **docker compose up -d** (On path including the *compose.yaml*)

<figure class="oo op oq or os mp mh mi paragraph-image"><div class="mq mr fj ms bh mt" role="button" tabindex="0"><div class="mh mi pe"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/0*06y6zANWHbUPCvKx.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/0*06y6zANWHbUPCvKx.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/0*06y6zANWHbUPCvKx.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/0*06y6zANWHbUPCvKx.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/0*06y6zANWHbUPCvKx.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/0*06y6zANWHbUPCvKx.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/0*06y6zANWHbUPCvKx.png 1400w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/0*06y6zANWHbUPCvKx.png 640w, https://miro.medium.com/v2/resize:fit:720/0*06y6zANWHbUPCvKx.png 720w, https://miro.medium.com/v2/resize:fit:750/0*06y6zANWHbUPCvKx.png 750w, https://miro.medium.com/v2/resize:fit:786/0*06y6zANWHbUPCvKx.png 786w, https://miro.medium.com/v2/resize:fit:828/0*06y6zANWHbUPCvKx.png 828w, https://miro.medium.com/v2/resize:fit:1100/0*06y6zANWHbUPCvKx.png 1100w, https://miro.medium.com/v2/resize:fit:1400/0*06y6zANWHbUPCvKx.png 1400w">![](https://miro.medium.com/v2/resize:fit:1040/0*06y6zANWHbUPCvKx.png)</source></source></picture></div></div></figure></div></div></div>After checking a message that all of the container start, we can access Open-WebUI on the browser with its port number defined on *compose.yaml* (In this practice, access link is [http://localhost:3000](http://localhost:3000/))

<div class="gn go gp gq gr" id="bkmrk-if-you-access-the-op" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="oo op oq or os mp mh mi paragraph-image"><div class="mh mi pg"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 441px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 1100w, https://miro.medium.com/v2/resize:fit:882/format:webp/1*avHdrebeQbjp_XbVrfUtAg.png 882w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 441px" srcset="https://miro.medium.com/v2/resize:fit:640/1*avHdrebeQbjp_XbVrfUtAg.png 640w, https://miro.medium.com/v2/resize:fit:720/1*avHdrebeQbjp_XbVrfUtAg.png 720w, https://miro.medium.com/v2/resize:fit:750/1*avHdrebeQbjp_XbVrfUtAg.png 750w, https://miro.medium.com/v2/resize:fit:786/1*avHdrebeQbjp_XbVrfUtAg.png 786w, https://miro.medium.com/v2/resize:fit:828/1*avHdrebeQbjp_XbVrfUtAg.png 828w, https://miro.medium.com/v2/resize:fit:1100/1*avHdrebeQbjp_XbVrfUtAg.png 1100w, https://miro.medium.com/v2/resize:fit:882/1*avHdrebeQbjp_XbVrfUtAg.png 882w">![](https://miro.medium.com/v2/resize:fit:655/1*avHdrebeQbjp_XbVrfUtAg.png)</source></source></picture></div><figcaption class="mv ff mw mh mi mx my bf b bg z du" data-selectable-paragraph="">If you access the Open-WebUI first, you need to sign up.</figcaption></figure></div></div></div>After accessing to the Open-WebU, I need to sign up for this system. My account for the system will be stored on its Docker volume, so the sign-up will be required only for the first time.

<div class="gn go gp gq gr" id="bkmrk--3" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="oo op oq or os mp mh mi paragraph-image"><div class="mq mr fj ms bh mt" role="button" tabindex="0"><div class="mh mi ph"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 1400w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 640w, https://miro.medium.com/v2/resize:fit:720/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 720w, https://miro.medium.com/v2/resize:fit:750/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 750w, https://miro.medium.com/v2/resize:fit:786/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 786w, https://miro.medium.com/v2/resize:fit:828/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 828w, https://miro.medium.com/v2/resize:fit:1100/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 1100w, https://miro.medium.com/v2/resize:fit:1400/1*4Tvd8cU2yHRcwiDnBzt5Hg.png 1400w">![](https://miro.medium.com/v2/resize:fit:1040/1*4Tvd8cU2yHRcwiDnBzt5Hg.png)</source></source></picture></div></div></figure></div></div></div>Since there is no LLM model on ollama yet, we need to pull open LLM by inserting its tag on ‘**Pull a model from Ollama.com**’ in **models** menu which will be displayed after pushing a gear button on top right of the home window. The setting window is like below:

<div class="gn go gp gq gr" id="bkmrk--4" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="oo op oq or os mp mh mi paragraph-image"><div class="mh mi pi"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 687px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/0*m71_Mj4dM07zesfF.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/0*m71_Mj4dM07zesfF.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/0*m71_Mj4dM07zesfF.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/0*m71_Mj4dM07zesfF.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/0*m71_Mj4dM07zesfF.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/0*m71_Mj4dM07zesfF.png 1100w, https://miro.medium.com/v2/resize:fit:1374/format:webp/0*m71_Mj4dM07zesfF.png 1374w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 687px" srcset="https://miro.medium.com/v2/resize:fit:640/0*m71_Mj4dM07zesfF.png 640w, https://miro.medium.com/v2/resize:fit:720/0*m71_Mj4dM07zesfF.png 720w, https://miro.medium.com/v2/resize:fit:750/0*m71_Mj4dM07zesfF.png 750w, https://miro.medium.com/v2/resize:fit:786/0*m71_Mj4dM07zesfF.png 786w, https://miro.medium.com/v2/resize:fit:828/0*m71_Mj4dM07zesfF.png 828w, https://miro.medium.com/v2/resize:fit:1100/0*m71_Mj4dM07zesfF.png 1100w, https://miro.medium.com/v2/resize:fit:1374/0*m71_Mj4dM07zesfF.png 1374w">![](https://miro.medium.com/v2/resize:fit:1020/0*m71_Mj4dM07zesfF.png)</source></source></picture></div></figure></div></div></div>If a desired LLM is pulled, you can select downloaded model on top left of the home window like the below capture:

<div class="gn go gp gq gr" id="bkmrk--5" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="oo op oq or os mp mh mi paragraph-image"><div class="mh mi pj"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 540px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/0*LR3Rd7-18K0H_0Ns.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/0*LR3Rd7-18K0H_0Ns.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/0*LR3Rd7-18K0H_0Ns.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/0*LR3Rd7-18K0H_0Ns.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/0*LR3Rd7-18K0H_0Ns.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/0*LR3Rd7-18K0H_0Ns.png 1100w, https://miro.medium.com/v2/resize:fit:1080/format:webp/0*LR3Rd7-18K0H_0Ns.png 1080w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 540px" srcset="https://miro.medium.com/v2/resize:fit:640/0*LR3Rd7-18K0H_0Ns.png 640w, https://miro.medium.com/v2/resize:fit:720/0*LR3Rd7-18K0H_0Ns.png 720w, https://miro.medium.com/v2/resize:fit:750/0*LR3Rd7-18K0H_0Ns.png 750w, https://miro.medium.com/v2/resize:fit:786/0*LR3Rd7-18K0H_0Ns.png 786w, https://miro.medium.com/v2/resize:fit:828/0*LR3Rd7-18K0H_0Ns.png 828w, https://miro.medium.com/v2/resize:fit:1100/0*LR3Rd7-18K0H_0Ns.png 1100w, https://miro.medium.com/v2/resize:fit:1080/0*LR3Rd7-18K0H_0Ns.png 1080w">![](https://miro.medium.com/v2/resize:fit:802/0*LR3Rd7-18K0H_0Ns.png)</source></source></picture></div></figure></div></div></div>Finally, we can chat with the open LLM, llama3 in this practice, like ChatGPT.

<div class="gn go gp gq gr" id="bkmrk--6" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc"><figure class="oo op oq or os mp mh mi paragraph-image"><div class="mq mr fj ms bh mt" role="button" tabindex="0"><div class="mh mi pk"><picture><source sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/0*Po_R2vQUBuW3xnIJ.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/0*Po_R2vQUBuW3xnIJ.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/0*Po_R2vQUBuW3xnIJ.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/0*Po_R2vQUBuW3xnIJ.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/0*Po_R2vQUBuW3xnIJ.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/0*Po_R2vQUBuW3xnIJ.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/0*Po_R2vQUBuW3xnIJ.png 1400w" type="image/webp"><source data-testid="og" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" srcset="https://miro.medium.com/v2/resize:fit:640/0*Po_R2vQUBuW3xnIJ.png 640w, https://miro.medium.com/v2/resize:fit:720/0*Po_R2vQUBuW3xnIJ.png 720w, https://miro.medium.com/v2/resize:fit:750/0*Po_R2vQUBuW3xnIJ.png 750w, https://miro.medium.com/v2/resize:fit:786/0*Po_R2vQUBuW3xnIJ.png 786w, https://miro.medium.com/v2/resize:fit:828/0*Po_R2vQUBuW3xnIJ.png 828w, https://miro.medium.com/v2/resize:fit:1100/0*Po_R2vQUBuW3xnIJ.png 1100w, https://miro.medium.com/v2/resize:fit:1400/0*Po_R2vQUBuW3xnIJ.png 1400w">![](https://miro.medium.com/v2/resize:fit:1040/0*Po_R2vQUBuW3xnIJ.png)</source></source></picture></div></div></figure></div></div></div><div class="ab cb of og oh oi" id="bkmrk--7" role="separator" style="text-align: justify;">  
</div>There are some additional Docker commands that you can use to manage containers.

If you want to stop and remove containers with Docker Compose, use the below command.

<div class="gn go gp gq gr" id="bkmrk-docker-compose-down%C2%A0" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- **docker compose down** (On path including the *compose.yaml*)

</div></div></div>If you want to remove the Docker volumes which ollama and Open-WebUI are using, for the further storage management, use the below command. (**Warning: You can’t restore the removed volumes which not backed up.**)

<div class="gn go gp gq gr" id="bkmrk-docker-volume-rm%C2%A0oll" style="text-align: justify;"><div class="ab cb"><div class="ci bh fz ga gb gc">- **docker volume rm** **ollama-local**
- **docker volume rm open-webui-local**

</div></div></div><div class="ab cb of og oh oi" id="bkmrk--8" role="separator" style="text-align: justify;">  
</div>That’s all. I think the local LLM service is pretty interesting project.

I’ll share if there are any awesome use cases with the local LLM.

Please let me know what you think :)

**References**

<div class="gn go gp gq gr" id="bkmrk-https%3A%2F%2Fgithub.com%2Fo"><div class="ab cb"><div class="ci bh fz ga gb gc">- [https://github.com/ollama/ollama](https://github.com/ollama/ollama)
- [https://github.com/open-webui/open-webui](https://github.com/open-webui/open-webui)

</div></div></div>

# Monitoração DeepSeek Ollama

Link: [https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/](https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/)

<header class="header" id="bkmrk-is-deepseek-safe-to-"><nav class="navigation-menu">[Is DeepSeek Safe To Run (locally)](https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/)

</nav></header><div class="content" id="bkmrk-2025-01-31-%23networkc"><article class="post"><div class="post-meta" style="text-align: justify;"><time class="post-date">2025-01-31</time></div><span class="post-tags">\#[NetworkChuck](https://blog.networkchuck.com/tags/networkchuck/) </span>#### Monitor Network Connections

##### Windows

```powershell
while($true) {
    Get-Process ollama | ForEach-Object { 
        $id = $_.Id
        Write-Host "`nConnections for Ollama process $id" -ForegroundColor Green
        Get-NetTCPConnection | Where-Object OwningProcess -eq $id | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State 
    }
    Start-Sleep -Seconds 2
    Clear-Host
}

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>##### Mac

```bash
# One-time check
pid=$(pgrep ollama)
lsof -i -P -n | grep ollama

# For continuous monitoring
while true; do
    echo "$(date): Ollama Connections"
    lsof -i -P -n | grep ollama
    sleep 2
    clear
done

# Alternative using netstat
netstat -p tcp -v | grep ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>#### Linux

```bash
# One-time check
pid=$(pgrep ollama)
lsof -i -P -n | grep ollama

# Or for continuous monitoring
watch -n 2 "lsof -i -P -n | grep ollama"

# Alternative using netstat
netstat -np | grep ollama

# Or using ss (more modern)
ss -np | grep ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>#### Running Ollama Inside Docker

```bash
docker run -d \
--gpus all \
-v ollama:/root/.ollama \
-p 11434:11434 \
--security-opt=no-new-privileges \
--cap-drop=ALL \
--cap-add=SYS_NICE \
--memory=8g \
--memory-swap=8g \
--cpus=4 \
--read-only \
--name ollama \
ollama/ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div><div class="pagination"><div class="pagination__title" style="text-align: justify;">  
</div></div></article></div>