Running Deepseek Locally
This guide is crafted for curious minds like yours who are eager to bring AI to life on their own machines. Specifically, I’ll walk you through the journey of setting up Ollama and OpenWebUI to enable DeepSeek-R1 locally, all on Arch Linux.
Get ready to unlock the potential of AI with this step-by-step tutorial designed for users like you—whether you’re a seasoned developer or just diving into AI exploration for the first time. By the end of this guide, you’ll not only have successfully installed and configured Ollama and OpenWebUI but also be well-equipped to explore and expand your knowledge of DeepSeek-R1.
Are you ready to take control of your AI environment? Follow along as we delve into the intricacies of setting up an AI stack tailored for Arch Linux."
1. Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
2. Set Up Ollama:
After ollama is installed it will be automatically started as a service, but in order for the docker network to connect to it we have to tell ollama to serve on more than just the 127.0.0.1 interface.
sudo systemctl edit ollama.service
and insert the section
[Service]
Environment="OLLAMA_HOST=0.0.0.0"
Save and run
sudo systemctl daemon-reload
sudo systemctl restart ollama
We should now be able to run an AI model from CLI
ollama -v
We can test deepseek-r1 in the CLI with
ollama run deepseek-r1
3. Configure OpenWebUI:
Now, we need to install Docker on our system. Here’s how you install Docker in Arch Linux:
sudo pacman -S docker
Then start the Docker Daemon:
sudo systemctl start docker.service
Optionally, you can enable it to start when the system boots:
sudo systemctl enable docker.service
Then, add yourself to the docker group:
sudo usermod -aG docker $USER
Then log out and re-login your user should be able to run docker containers. You can check with
docker run hello-world
Start the Open WebUI container with
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
Browse to http://localhost:3000/, create your account and start playing with your local AI