An article about how to easily install and run local Open Source AI🤖 models using Ollama🦙 on a PC running Linux🐧.
AI has already become part of everyday life for IT specialists, and today I invite you to join this trend 🧑💻, but with a greater emphasis on privacy 🛡️.
🖐️Hey!
Subscribe to our Telegram channel @r4ven_me📱, so you don’t miss new posts on the website 😉. If you have questions or just want to chat about the topic, feel free to join the Raven chat at @r4ven_me_chat🧐.
The actions in the article were tested on Linux Mint 22 (Ubuntu 24) and LMDE6 (Debian 12) distributions on a PC with this configuration.
What are local AI models for?
Among the obvious advantages, we can highlight:
- Privacy — all data is processed and stored locally on your computer;
- Independence from external services — can work without an internet connection;
- Flexibility — you can change models, customize them for yourself;
- Cost savings — no need to pay for an API or subscriptions (especially when there isn’t even a way to make a payment 🤷♂️).
Besides the above, my interest in Ollama is related to the ability to use local models as an AI assistant/agent. For example, for integration with ShellGPT or the code editor Neovim with this plugin.
What is an LLM and Ollama

Ollama is an open source tool and platform for locally running and interacting with LLMs (Large Language Models) on your computer 🧑💻. This software makes it easy and convenient to work with models such as LLaMA, DeepSeek, Mistral, Gemma, and others. And all this without a connection to the cloud or even the internet 🌐.
For models to work correctly you’ll need a GPU — a graphics card (the more powerful, the better). You can use a CPU, but in that case performance will be significantly lower 😐.
Installing Ollama on Debian
💡By default, the installation and configuration of
ollamaon Linux is done via the terminal. If you prefer an exclusively GUI approach, consider the option described in the “Alternative to Ollama and open-webui — LM Studio” section below.
On the official Ollama project website, in the downloads section for Linux systems, it is suggested to install the program using a shell script. The script is downloaded using the curl utility and immediately passed for execution to the command interpreter (sh or bash).
💡 Tip
💡If you don’t have the curl utility installed, run this in the terminal:
sudo apt update && sudo apt install -y curlBefore running such scripts from the internet, it is recommended to check them for safety.
👇Under the spoiler is an instruction on how to check the script for safety
1) Viewing the script’s content:
curl -fsSL https://ollama.com/install.sh | less2) Comparing the hash sum of the script from the link and the script from the official repository using sha256sum:
curl -fsSL https://ollama.com/install.sh | sha256sum
curl -fsSL https://raw.githubusercontent.com/ollama/ollama/main/scripts/install.sh | sha256sum3) Uploading the script to a free online service — VirusTotal, which checks files and links for malicious code, viruses, trojans, worms, spyware, and other threats.
Save the script to a file in the user’s home directory (this action is safe):
curl -fsSL https://ollama.com/install.sh -o ~/install.shThen go to the VirusTotal uploads section and submit the previously saved file, install.sh, for analysis.
After the check, the service will provide detailed information about the analysis of the script file, describing what it does:
Main actions of the Ollama installation script:
- Creating the system user
ollamawith the home directory/usr/share/ollama; - Adding the user to the
renderandvideogroups; - Adding the current user to the
ollamagroup; - Configuring and starting the Systemd service;
- Handling cases without Systemd;
- Installing the binary file into
/usr/local/bin;
After understanding what will happen, open the terminal and run:
curl -fsSL https://ollama.com/install.sh | shSuccessful Ollama installation on a PC with an AMD GPU
If you don’t have a discrete GPU, you’ll get a notification like this:
In that case ollama will still work, but with lower performance 😥.
Choosing a model and running it in the console
Go to the Models section of the official Ollama project website to search for the model you need. The project provides the ability to download and use a large number of them.
💡See the list of supported models here.

In this article I’ll only cover an example with a model that speaks Russian fairly well and is oriented towards working with various programming languages, including shell languages such as Shell/Bash/Zsh, etc. — deepseek-coder-v2. Yes, one of the variations of that very hyped Chinese open source AI model 👌.
This model has ~16 billion parameters, takes up ~9GB of disk space, and requires ~10GB of RAM while running. So make sure you have enough free resources before installing.
💡Less demanding models are also available on the Ollama website, but they rarely speak Russian 🤷♂️.
The model’s page shows the command to download/run it:
ollama run deepseek-coder-v2After the parameter files are downloaded, an interactive console mode for interacting with the model will launch. Here you can ask various questions and set tasks. For example:
Write a bash function that takes a color as the 1st argument and text as the 2nd, and prints the text on screen in that color.
Let’s check the function in a neighboring terminal:
It works, which is already not bad 😉!
You can see the list of models installed on the computer with the command:
ollama listYou can delete a selected model like this:
ollama rm deepseek-coder-v2💡Model files are stored in
/usr/share/ollama/.ollama/models.
Download the latest version of a model like this:
ollama pull deepseek-coder-v2:latestAfter starting, the ollama service runs in the background and listens on port 11434 on the local interface:
ss -tlnp | grep 11434You can send API requests to this address, for example using curl+jq:
# install jq - a utility for working with json
sudo apt install -y jq
curl -s http://localhost:11434/api/generate -d '{
"model": "deepseek-coder-v2",
"prompt": "What is 150+150",
"stream": false
}' | jq -r .responseYou can make a handy shell function for quick access from the console:
ai() {
local model="deepseek-coder-v2"
local prompt="$*"
local host="http://localhost:11434"
if [ -z "$prompt" ]; then
echo "Usage: ai <your question>"
return 1
fi
curl -s "$host/api/generate" -d '{
"model": "'"$model"'",
"prompt": "'"$prompt"'",
"stream": false
}' | jq -r .response
}Add it to your .*shrc file and use it 😇:
Not much of a comedian 🤷♂️.
Autoloading the model into RAM on login
⚠️This step is optional.
You’ve probably noticed that on the first request to the AI in a session, ollama loads the model’s parameters into RAM. The more of them there are, the longer they take to load, accordingly. If you have enough RAM and video memory, to speed up responses you can configure the model to auto-load into memory when the user’s graphical session starts.
One way to auto-launch applications on login is to create a special .desktop file in the ~/.config/autostart directory:
cat << EOF > ~/.config/autostart/ollama.desktop
[Desktop Entry]
Type=Application
Name=Ollama
Comment=Launching ollama on system startup
Exec=env OLLAMA_KEEP_ALIVE="-1" bash -c 'ollama run deepseek-coder-v2 ping &> /dev/null'
Terminal=false
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=60
EOF- The
OLLAMA_KEEP_ALIVE="-1"variable tellsollamanot to unload the model’s parameters from memory. Read more about the loading/unloading process in the documentation. - The
X-GNOME-Autostart-Delay=60parameter sets a delay before the command executes.
💡 Tip
💡If you need to unload the model from memory, use the command:
ollama stop deepseek-coder-v2To verify that autostart works, you need to log out and back into the desktop.
GUI for working with Ollama
Many different graphical interfaces are available for convenient work with ollama. One of the popular and feature-rich ones is the open-webui project.
open-webui is a web interface for interacting with local language models (LLMs), such as the ones ollama runs: llama, deepseek, etc. In short, it’s like ChatGPT, but with blackjack and local AI models.
The open-webui backend is written in Python, so it can be installed using pip/pipx. Let’s use the latter.
💡
pipxis a tool for installing and running Python applications in an isolated environment (venv), which it automatically creates and configures for each program.
The pipx package is in the standard repositories of Debian 12. Install it the usual way:
sudo apt install -y pipxNow let’s use it to install open-webui:
⚠️Keep in mind that
open-webuiweighs about 8GB. The installation will take some time.
pipx install open-webui💡
pipxwill installopen-webuiinto the user’s local directory~/.local/pipx/venvs/open-webuiand create a symlink in~/.local/bin/open-webui.💡See alternative installation methods here. You can remove
open-webuiwith the command:pipx uninstall open-webui.
To run open-webui from the console, the ~/.local/bin directory needs to be added to the system $PATH variable. Let’s add it as needed and start the UI:
# temporarily add
export PATH="$PATH:$HOME/.local/bin"
open-webui serveNow let’s open the browser and go to: http://localhost:8080. Set the administrator’s name, email, and password:
And finally we end up in the chat window. As you can see, the UI connected to Ollama and DeepSeek is already used as the default model:
A pretty familiar interface 🤔
Let’s check the model’s work (and turn on dark theme in the settings 😎):
Looks pretty good 👌.
To make open-webui start automatically on login, let’s create a special .desktop file in the autostart directory:
cat << EOF > ~/.config/autostart/open-webui.desktop
[Desktop Entry]
Type=Application
Name=Open WebUI
Comment=Launching open-webui on system startup
Exec=bash -c '$HOME/.local/bin/open-webui serve'
Terminal=false
X-GNOME-Autostart-enabled=true
EOFTo verify autostart, you need to log back into the graphical user session.
Alternative to Ollama and open-webui — LM Studio
⚠️Warning!⚠️
Please note that LM Studio is proprietary software. This limits the transparency of data processing.
LM Studio is also a desktop GUI application for locally running and chatting with language models (LLMs). Out of the box it offers both a backend for running AI and an interface for interacting with it.
For deb based systems, the LM Studio developers have prepared an installation package. To install the application go to the download page and download it:
Then open it and install it:
You can launch LM Studio from the main menu:
Let’s skip the welcome screen:
Click the model selection button:
Type the name of the model you need in the search, in my example deepseek coder v2 lite:
And click “Download”:
Now the model is available for use:
Everything works 👍.
Conclusion
Don’t forget to thank the AI if it helped you. Who knows, maybe this fact will save your life someday 🙄.

Useful materials
- Ollama project source code repository | GitHub
- Ollama downloads page | ollama.com
- open-webui project source code repository | GitHub
- LM Studio downloads page | lmstudio.ai
- shellGPT – ChatGPT bot in your Linux terminal | Raven blog
👨💻And…
Don’t forget about our Telegram channel 📱 and chat
Or maybe you want to become a co-author? Then click here🔗
💬 All the best ✌️
That should be it. If not, check the logs 🙂






























