# DeepSeek

# Instalação e configuração DeepSeek

# Using DeepSeek-R1 Locally

<div class="" id="bkmrk-" style="text-align: justify;"><div class="addtoany_shortcode"></div></div>Link: [https://www.kdnuggets.com/using-deepseek-r1-locally](https://www.kdnuggets.com/using-deepseek-r1-locally)

Run powerful reasoning models locally, matching the performance of OpenAI's o1 capabilities, completely free, and avoid paying $200 a month for a pro subscription.

<div class="author-link" id="bkmrk-by%C2%A0abid-ali-awan%2C-kd">By **[Abid Ali Awan](https://www.kdnuggets.com/author/abidali-awan "Posts by Abid Ali Awan")**, KDnuggets Assistant Editor on January 27, 2025 in [Language Models](https://www.kdnuggets.com/tag/language-models)</div><div class="author-link" id="bkmrk--1"></div><div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk-image-by-author%C2%A0" style="text-align: justify;"><center>![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_4.png)  
<span>Image by Author</span></center>  
 </div>Many professionals are buzzing about the new DeepSeek model, claiming it could be an "OpenAI killer," and the hype surrounding it seems justified. Recently, DeepSeek launched the DeepSeek-R1-Zero and DeepSeek-R1 models in various versions. These models deliver performance comparable to OpenAI's o1 on benchmarks like MMLU, Math-500, Codeforces, and more.

In this short tutorial, we will explore the DeepSeek-R1 model and walk through how to run its Distill version locally using Ollama, Docker, and Open WebUI. This means you will be able to use a reasoning model with a user interface similar to ChatGPT—completely free and without needing an internet connection.

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--2" style="text-align: justify;"><div class="kdnug-c731d947d6623a54afc4dd42e8f1a2f7 kdnug-in-content-1" id="bkmrk--3"><div class="kdnug-in-content-1" id="bkmrk--4"><div class="kdnug-target" data-kdnug-trackbid="1" data-kdnug-trackid="185464" id="bkmrk--5"></div></div></div></div>## What is DeepSeek-R1?

DeepSeek has introduced first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1. The DeepSeek-R1 was built upon its predecessor, DeepSeek-R1-Zero, which was trained exclusively with large-scale reinforcement learning (RL) without supervised fine-tuning (SFT). While DeepSeek-R1-Zero showcased advanced reasoning behaviors such as self-verification and generating long chain-of-thoughts (CoTs), it faced challenges like repetitive responses, poor readability, and language mixing. To address these limitations, DeepSeek-R1 incorporates cold-start data before RL, enhancing reasoning performance across math, code, and logic tasks. It achieves results similar to OpenAI-o1 and has led to developing smaller, high-performing distilled models, such as DeepSeek-R1-Distill-Qwen-32B, which achieves state-of-the-art results on reasoning benchmarks.

## Setting up Open WebUI

Before we install[ Open WebUI](https://docs.openwebui.com/), an open-source chat user interface similar to ChatGPT, we have to download and install Docker desktop by going to the official website:[ https://www.docker.com/](https://www.docker.com/).

After that, you can pull the Open WebUI image from the GitHub container repository by typing the following command in the terminal.

```
docker pull <a class="vglnk" href="http://ghcr.io/open-webui/open-webui:main" rel="nofollow">ghcr.io/open-webui/open-webui:main</a>
```

After successfully pulling the Docker image, we need to run the Docker container using the Open WebUI image. We will map the volume for persistent data storage with the option `-v open-webui:/app/backend/data`. Additionally, we will map the port using `-p 9783:8080`, which exposes the WebUI on port 9783 of your local machine.

```
docker run -d -p 9783:8080 -v open-webui:/app/backend/data --name open-webui <a class="vglnk" href="http://ghcr.io/open-webui/open-webui:main" rel="nofollow">ghcr.io/open-webui/open-webui:main</a>
```

 ![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_3.png)

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk-%C2%A0wait-a-few-seconds%2C" style="text-align: justify;">  
 Wait a few seconds, then access the web app by copying and pasting the URL [http://localhost:9783/](http://localhost:9783/) into your browser. It will prompt you to create an account, and after that, you will be redirected to the main chat menu. As you can see, there are no models available for selection. To resolve this, we will set up Ollama next.</div><div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--6" style="text-align: justify;"><center>![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_8.png)</center></div><div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--7" style="text-align: justify;"><div class="adthrive-ad adthrive-content adthrive-content-1 adthrive-ad-cls up-show" data-google-query-id="CJ-WoennmIsDFZSHYQYdgTwaVw" id="bkmrk--8"><div id="bkmrk--9"></div></div></div>## Setting up Ollama

Go to the official website,[ https://ollama.com/](https://ollama.com/), to download and install Ollama. Afterward, go to the “Models” menu and select the[ deepseek-r1](https://ollama.com/library/deepseek-r1) option. This page will contain a run command to download and run various versions of the DeepSeek R1 models.

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk-%C2%A0-4" style="text-align: justify;"><center>![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_6.png)</center>  
 </div>In our case, we will be downloading the 8B Llama DeepSeek R1 model by typing the following command in the terminal.

```
ollama run deepseek-r1:8b
```

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk-%C2%A0-7" style="text-align: justify;"><center>![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_1.png)</center>  
 </div><div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--10" style="text-align: justify;"><div class="adthrive-ad adthrive-content adthrive-content-1 adthrive-ad-cls up-show" id="bkmrk--11"><div id="bkmrk--12"></div></div></div>## Using DeepSeek-R1 Locally

Refresh the Open WebUI page, and you will see the `deespseek-r1:8b` model. Select the model and start using it.

 ![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_5.png)

After typing the default prompt, it took the model 18 seconds to think before responding, which is great and similar to the o1 model.

 ![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_2.png)

You can see the thought process by clicking on the “Thought for 18 Second” drop-down menu.

 ![Using DeepSeek-R1 Locally](https://www.kdnuggets.com/wp-content/uploads/awan_deepseekr1_locally_7.png)

The model response generation was fast, close to 54 tokens per second. This is the best performance you can achieve from the 8B parameter quantized model.

To test the full version of the DeepSeek-R1 model, please visit[ https://chat.deepseek.com/](https://chat.deepseek.com/) and select the `DeepThink (R1)` option.

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--13" style="text-align: justify;"><div class="adthrive-ad adthrive-content adthrive-content-1 adthrive-ad-cls up-show" data-google-query-id="CPHH4OLomIsDFdxwuAQdQAs8Ng" id="bkmrk--14"><div id="bkmrk--15"></div></div></div>## Conclusion

Open-source AI is the future, and even big tech giants recognize this. With companies from China entering the scene, we, as users and everyday people, have a great opportunity to take advantage of advanced AI models privately using local resources.

All you need to do is install Ollama and Docker, then pull the Docker image of the Open WebUI application using a simple Docker command. Trust me, it’s that straightforward! This setup requires limited computing resources, so even a laptop with 8GB of RAM and no GPU can run these models effectively.

So, what are you waiting for? Start building and integrating these tools into your workspace.  
   
 **[Abid Ali Awan](https://www.polywork.com/kingabzpro)** ([@1abidaliawan](https://www.linkedin.com/in/1abidaliawan)) is a certified data scientist professional who loves building machine learning models. Currently, he is focusing on content creation and writing technical blogs on machine learning and data science technologies. Abid holds a Master's degree in technology management and a bachelor's degree in telecommunication engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk--16" style="text-align: justify;"></div>### More On This Topic

<div class="post-189533 post type-post status-publish format-standard has-post-thumbnail hentry category-kdnuggets-originals tag-language-models" id="bkmrk-using-groq-llama-3-7"><div class="crp_related     crp-text-only">- [<span class="crp_title">Using Groq Llama 3 70B Locally: Step by Step Guide</span>](https://www.kdnuggets.com/using-groq-llama-3-70b-locally-step-by-step-guide)
- [<span class="crp_title">Using FLUX.1 Locally</span>](https://www.kdnuggets.com/using-flux-1-locally)
- [<span class="crp_title">Using Llama 3.2 Locally</span>](https://www.kdnuggets.com/using-llama-3-2-locally)
- [<span class="crp_title">Run an LLM Locally with LM Studio</span>](https://www.kdnuggets.com/run-an-llm-locally-with-lm-studio)
- [<span class="crp_title">Use (Almost) Any Language Model Locally with Ollama and Hugging Face Hub</span>](https://www.kdnuggets.com/use-almost-any-language-model-locally-with-ollama-and-hugging-face-hub)
- [<span class="crp_title">Ollama Tutorial: Running LLMs Locally Made Super Simple</span>](https://www.kdnuggets.com/ollama-tutorial-running-llms-locally-made-super-simple)

</div></div>

# Run DeepSeek-R1 locally with Ollama on Docker

Link: [https://www.linkedin.com/pulse/run-deepseek-r1-locally-ollama-docker-adrian-escutia-wtikc/](https://www.linkedin.com/pulse/run-deepseek-r1-locally-ollama-docker-adrian-escutia-wtikc/)

<header aria-label="Cabeçalho do artigo" class="pt4" id="bkmrk-"><figure class="relative"><div class="reader-cover-image__wrapper-right-rail-layout">![](https://media.licdn.com/dms/image/v2/D5612AQGPMZgoXGO0Lg/article-cover_image-shrink_720_1280/article-cover_image-shrink_720_1280/0/1737477586142?e=1743638400&v=beta&t=7GKSOqUiTNSJ5Gi52rJ6k_VgGnKtnI5kzHbmc-unakY)</div></figure></header><div class="relative reader__grid" id="bkmrk--2" style="text-align: justify;"><div class="reader-author-info__container"><div class="display-flex align-items-center justify-space-between"><div class="reader-author-info__inner-container"><div class="artdeco-entity-lockup artdeco-entity-lockup--size-3 ember-view"><div class="artdeco-entity-lockup__image artdeco-entity-lockup__image--type-circle ember-view" id="bkmrk--3" type="circle">[](https://www.linkedin.com/in/adrianescutia/)</div></div></div></div></div></div>## Adrian Escutia

<div class="relative reader__grid" id="bkmrk-simplifying-solution" style="text-align: justify;"><div class="reader-author-info__container"><div class="display-flex align-items-center justify-space-between"><div class="reader-author-info__inner-container"><div class="artdeco-entity-lockup artdeco-entity-lockup--size-3 ember-view" id="bkmrk-simplifying-solution-1"><div class="reader-author-info__content artdeco-entity-lockup__content ember-view" id="bkmrk-simplifying-solution-2"><div class="artdeco-entity-lockup__subtitle ember-view" id="bkmrk-simplifying-solution-3"><div class="ember-view lt-line-clamp lt-line-clamp--multi-line text-body-small t-black--light break-words" id="bkmrk-simplifying-solution-4">Simplifying Solutions in Airgap and Enterprise-Restricted Environments</div></div></div></div></div><div class="display-flex ml8"><span class="artdeco-hoverable-trigger artdeco-hoverable-trigger--content-placed-top artdeco-hoverable-trigger--is-hoverable ember-view" tabindex="-1"><button aria-describedby="artdeco-hoverable-artdeco-gen-42" aria-label="Abrir Leitor imersivo" class="artdeco-button artdeco-button--secondary artdeco-button--muted
        artdeco-button--1
        artdeco-button--circle" type="button"><svg aria-hidden="true" class="artdeco-button__icon" data-supported-dps="16x16" data-test-icon="book-open-small" height="16" role="none" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"></svg></button></span><div class="ember-view" id="bkmrk--5"><div class="ember-view" id="bkmrk--6"></div></div><span class="artdeco-hoverable-trigger artdeco-hoverable-trigger--content-placed-top artdeco-hoverable-trigger--is-hoverable ember-view" id="bkmrk--7" tabindex="-1"></span><span class="artdeco-hoverable-trigger artdeco-hoverable-trigger--content-placed-top artdeco-hoverable-trigger--is-hoverable ember-view" tabindex="-1"><button aria-describedby="artdeco-hoverable-artdeco-gen-43" aria-label="Salvar" class="artdeco-button artdeco-button--circle artdeco-button--muted artdeco-button--1 artdeco-button--secondary ember-view ml2" id="bkmrk--8"><svg aria-hidden="true" class="artdeco-button__icon " data-supported-dps="16x16" data-test-icon="bookmark-outline-small" height="16" role="none" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"></svg></button></span><div class="ember-view" id="bkmrk--9"><div class="ember-view" id="bkmrk--10"></div></div><span class="artdeco-hoverable-trigger artdeco-hoverable-trigger--content-placed-top artdeco-hoverable-trigger--is-hoverable ember-view" id="bkmrk--11" tabindex="-1"></span></div></div><div class="mt4"><time class="text-body-small-open t-black--light">21 de janeiro de 2025</time></div></div><div data-scaffold-immersive-reader-content=""><div><div class="reader-article-content reader-article-content--content-blocks" dir="ltr"><div class="reader-content-blocks-container" data-artdeco-is-focused="true" tabindex="0">  
</div></div></div></div></div>Would you like to run local LLMs, here is how you can do it with Ollama and the new [DeepSeek](https://www.deepseek.com/)-R1 model that is breaking the boundaries of AI. 🚀

For those of us passionate about pushing the boundaries of AI, this is a game changer. 💡

Being able to run powerful language models locally, with the flexibility to fine-tune and experiment in a more personalized and secure environment, opens up so many possibilities.

Steps to run [DeepSeek AI](https://www.linkedin.com/company/deepseek-ai/) locally with [Ollama](https://www.linkedin.com/company/ollama/) on Docker:

```
# Install Ollama
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
# Pull the DeepSeek-R1 model
docker exec -it ollama ollama run deepseek-r1:7b
# Start chatting with DeepSeek-R1 - Web UI
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
```

Open [http://localhost:3000](http://localhost:3000/) in your browser, and you are done!

Let's make AI work for us, locally, efficiently, and creatively

<div class="relative reader__grid" id="bkmrk--12" style="text-align: justify;"><div data-scaffold-immersive-reader-content=""><div><div class="reader-article-content reader-article-content--content-blocks" dir="ltr"><div class="reader-content-blocks-container" data-artdeco-is-focused="true" tabindex="0"><div class="reader-image-block reader-image-block--full-width"></div></div></div></div></div></div>