How to run local LLMs in a container with Ollama and Podman
About this republication
Original article by Don Watkins, published October 28, 2026 on We Love Open Source (All Things Open), adapted from the author's “Running Ollama in a container: A beginner's guide”. Source: allthingsopen.org/articles/run-local-llms-container-ollama-podman. The author shares his work under CC BY-SA (the article's screenshot is credited CC BY-SA 4.0); this page republishes the text with attribution under CC BY-SA 4.0. If the author objects to this republication, please contact this site and it will be taken down.
Containers aren't new, but I am new to using them. I'm particularly interested in locally hosted AI, and I've written several articles about using Ollama, GenAI, and other locally installed large language models (LLMs) on my Linux desktop. In this article, I'll share my experience setting up Ollama in a container. Running Ollama in a container simplifies dependency management, prevents conflicts on your workstation, and helps keep your development environment consistent.
An old friend began experimenting with locally hosted AI, and since I'd been working with containers, I thought, why not give Ollama another try in a container environment? I found a good how-to from Fedora Magazine and adapted it for my own use.
Install Podman on Linux
First, you will need to install Podman. I used Flatpak for my installation, but you can use dnf on Fedora or apt on Ubuntu and Debian.
sudo dnf -y install podman
sudo apt-get -y install podman
Create a persistent volume for Ollama models
Once Podman is installed, open a terminal and enter the following:
podman volume create ollama_storage
This creates a storage volume for the models you download. Because LLM weights are large, a persistent volume ensures they aren't lost when the container stops.
Run Ollama in a Podman container
Now you're ready to run the Ollama container. Enter the following command in a terminal:
podman run -d \
--name ollama \
-v ollama_storage:/root/.ollama \
-p 11434:11434 \
docker.io/ollama/ollama:latest
I couldn't run a container on my setup using the specified ports, so I changed the port setting to 4134, and the container ran flawlessly.
Run Ollama with NVIDIA GPU support
I don't have an NVIDIA GPU, which would be ideal for this setup, so the command above is for CPU-only installations. If you do have one, run this command instead:
podman run -d \
--name ollama \
--security-opt=label=disable \
--device nvidia.com/gpu=all \
-v ollama_storage:/root/.ollama \
-p 11434:11434 \
docker.io/ollama/ollama:latest
Check that the Ollama container is running
Now open Podman and make sure your newly created container is running. (The original article has a screenshot here, by Don Watkins, CC BY-SA 4.0; omitted in this republication.)
Pull and run your first model with Llama 3
With the container running, you're ready to pull down your first model and start experimenting with your locally hosted LLM. Do that by entering the following command:
podman exec -it ollama ollama run llama3
Depending on your internet speed, this might take a few minutes, and then you'll be ready to use the Llama 3 model in Ollama. At the prompt, I asked the model for a simple fact about Linux Mint. This was the result:
>>> tell me a fun fact about Linux Mint
Here's a fun fact:
Linux Mint is a Linux distribution that was created by Clement Lefebvre, a
French programmer, in 2006. What's interesting is that Linux Mint was
originally intended to be a Ubuntu-based distribution, but it quickly
gained popularity and became a standalone project in 2009. Today, Linux
Mint is one of the most popular Linux distributions in the world, with
over 3 million users!
Why run Ollama in a container?
Setting up Ollama in a container provides a streamlined way to experiment with locally hosted AI models while managing dependencies and avoiding conflicts. With Podman and a few configuration tweaks, you can create a consistent, isolated setup for running models on your own machine.
— End · By Don Watkins, a free and open source software (FOSS) advocate · CC BY-SA 4.0 —