Running AI in Raspberry Pi
|

Run AI on Raspberry Pi Locally 2026 with Ollama (LLM) + Open WebUI (My Real Setup, Issues, Fixes)

Run AI locally on Raspberry Pi using Ollama and Open WebUI. Real setup, real issues, storage limits, memory crashes, overheating – and fixes that actually work.

We demonstrates how to run AI locally on Raspberry Pi using Ollama and Open WebUI, based on real hands-on testing rather than theory. This guide explains model selection, local setup, and practical fixes for common issues like storage limits, memory crashes, and overheating. It shows what actually works on Raspberry Pi when deploying lightweight LLMs for offline learning and demos.

Running AI Locally in a Raspberry Pi

This guide is written directly for you, based entirely on what I personally tested and faced during the setup. To be honest, I didn’t start this journey by blindly experimenting – I was mostly following the official Raspberry Pi documentation for running large language models, expecting a smooth, plug-and-play experience. Spoiler alert: it wasn’t. If you’re curious, here’s the original Raspberry Pi guide I started with.


Why I Wanted to Run AI on Raspberry Pi

Running AI models locally on a Raspberry Pi may sound unrealistic at first, but I wanted to see how far I could really push this tiny device. In this article, I’m sharing my complete hands-on experience running AI on Raspberry Pi using Ollama and Open WebUI-what worked well, what failed badly, and how I fixed real issues like storage running out, memory crashes, and overheating.

I wanted a way to demonstrate AI locally, without cloud dependency, subscriptions, or internet access once the model is downloaded. Raspberry Pi is affordable, widely available, and perfect for learning and demos, so it felt like the right platform to experiment with local AI.

Running AI on Raspberry Pi also helps you understand the real hardware limits of AI, which you never see when using cloud-based tools.


Tools I Used in This Setup

Ollama

Ollama became the foundation of my setup. It made running AI models surprisingly simple by handling model downloads, execution, and switching models without complicated configuration. On a low-powered system like Raspberry Pi, that simplicity matters a lot.

What exactly is Ollama? Well it is a local AI runtime that lets you download, manage, and run large language models directly on your own machine, instead of relying on cloud services. Think of it as a lightweight engine that takes care of all the complicated parts of running AI models—loading model files, managing memory, starting inference, and handling prompts—so you don’t have to manually compile or configure anything.

TinyLlama (AI Model)

I tested multiple models, but I finally settled on TinyLlama for this demo. The main reason is that it actually runs reliably on Raspberry Pi without crashing the system immediately.

From my experience, TinyLlama works well for summaries, rewriting text, checklists, and small code snippets. However, it has clear limitations—it struggles with reasoning, identity questions, and complex tasks. Understanding these limits is important to avoid unrealistic expectations during demos.

Docker

I used Docker to run the WebUI in an isolated container. This kept my Raspberry Pi OS clean and avoided dependency issues that are common when installing web applications directly on the system.

Open WebUI

Open WebUI gave me a clean, ChatGPT-like interface in the browser while still using my local Ollama models. This made demos much easier, especially when showing AI to non-technical users.


Hardware and System Setup I Recommend

Based on what I personally tested, here’s what I strongly recommend:

  • Raspberry Pi 4 (4GB or 8GB) or Raspberry Pi 5
  • At least 32GB SD card (16GB caused serious problems for me)
  • Proper power supply
  • Heatsink and fan
  • Raspberry Pi OS 64-bit

Step-by-Step: How I Ran AI on Raspberry Pi

Steps to run AI in a Raspberry Pi

Step 1: Updating Raspberry Pi OS

Before installing anything AI-related, I made sure my Raspberry Pi OS was fully updated. This step is easy to skip, but from experience, outdated packages can cause unexpected issues later when installing Ollama or Docker.

sudo apt update && sudo apt upgrade -y
sudo reboot

Step 2: Installing Ollama

Ollama is the core component that actually runs the AI models. I chose it because it removes most of the complexity involved in managing language models, which is especially important on hardware with limited resources.

curl-fsSL https://ollama.com/install.sh | sh

After installation, I verified it with:

ollama --version

Step 3: Pulling and Running a Model

Pulling a model simply means downloading it so that it can run locally. On Raspberry Pi, model choice matters a lot. Bigger models may download successfully but crash during execution.

For my demo, I chose TinyLlama because it loads reliably and stays within Raspberry Pi’s memory limits.

ollama run tinyllama

Once it loaded, I tested it with structured prompts like summaries, rewrites, and checklists. These worked consistently well. I avoided asking open-ended questions like “Who are you?” because TinyLlama is not designed for that level of interaction.

Exit the session using Ctrl + D.


Step 4: Installing Docker

I installed Docker to run Open WebUI in a container. This approach kept the setup clean and made it easy to restart or remove the WebUI without affecting the rest of my system.

sudo apt install docker.io -y
sudo systemctl enable docker
sudo systemctl start docker

I confirmed Docker was working with:

docker --version

Step 5: Installing Open WebUI

Open WebUI gave me a proper chat interface in the browser while still using local AI models. This made the entire setup feel much more polished for demos.

sudo docker run -d \
-p3000:8080 \
-v ollama:/root/.ollama \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:ollama

After this, I accessed the UI at:


Troubleshooting: Real Problems I Faced

SD Card Running Out of Space (16GB Failed)

This was one of the biggest mistakes I made initially. With a 16GB SD card, the system quickly ran out of space after pulling models and installing Docker. When this happened, the Pi became unresponsive and commands started hanging.

I checked disk usage using:

df -h

Cleaning helped temporarily, but the real fix was upgrading to a 16 GB or 64 GB SD card.


Memory Crashes and “signal: killed” Errors

While running models, I repeatedly hit errors where Ollama was killed by the system. This happens when Linux runs out of RAM and activates the OOM killer.

I confirmed this using:

dmesg -T | tail -n80 | egrep -i"oom|killed"
free -h

Adding swap memory significantly improved stability:

sudo fallocate -l 4G /swapfile
sudochmod600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Overheating During Model Loads

While pulling and running models, I noticed the Raspberry Pi getting noticeably hot. Without proper cooling, performance dropped due to thermal throttling.

I monitored temperature using:

vcgencmd measure_temp

Adding a heatsink and fan made a clear difference.


Managing Models

Whenever I needed to free space or switch demos, I removed unused models:

ollama list
ollama rm tinyllama

Final Thoughts From My Experience

Running AI on Raspberry Pi is absolutely possible if you respect the hardware limits. From my experience, the key lessons are simple:

  • Storage matters more than you expect
  • Swap is essential on low-RAM systems
  • Cooling is not optional
  • Small models require structured prompts

This setup is not meant to replace cloud AI, but it is perfect for learning, demos, and understanding AI under real constraints. This kind of hands-on experimentation is exactly what I aim to share through RootSaid.

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *