How to Run a Local LLM in Proxmox LXC: Ollama, GPU Passthrough and Open WebUI Setup Guide 14 min read

How to Run a Local LLM in Proxmox LXC: Ollama, GPU Passthrough and Open WebUI Setup Guide

If you already run Proxmox at home, you own a perfect host for a private local LLM. Most homelab servers sit idle for hours, and a local LLM puts those spare cores, memory and GPU to work. You keep every prompt on your own hardware, you pay nothing per query, and you can swap models whenever you like.

How to Run a Local LLM in Proxmox LXC: Ollama, GPU Passthrough and Open WebUI Setup Guide

This guide shows you how to build that setup inside an LXC container. You will create the container, install Ollama, give the container access to your GPU, open the API to your network and add a chat interface. Each step works on a CPU-only box too, so you can start without a graphics card and add one later.

LXC vs VM for Local LLMs: Which Should You Use?

A virtual machine emulates a full computer with its own kernel. An LXC container skips that layer and shares the Proxmox host kernel, which brings three practical gains for AI work:

  • Almost no overhead. The model gets nearly all the CPU and RAM you assign instead of losing a slice to a guest OS.
  • Simple GPU sharing. You expose the GPU device files to the container, and it talks to the driver the host already loaded. You do not hand the whole card over with PCIe passthrough.
  • Fast snapshots and clones. A container boots in a second or two, and you can snapshot it before every upgrade or experiment.

The shared kernel also explains the main limitation. A container depends on the host driver, so the driver inside and outside must match exactly. A VM still makes more sense when several people you do not trust share the server, because a VM draws a harder security boundary.

Hardware and Software Requirements for Running LLMs in Proxmox

Check these items first:

  • Proxmox VE 8.x or 9.x. Both versions follow the same container steps.
  • A Debian or Ubuntu template. Debian 13 or Ubuntu 24.04 works well.
  • RAM to spare. Plan for at least 8 GB for the container, and 16 GB or more if you want 7B to 14B models.
  • Disk space. Models take a lot of room. A 7B model at 4-bit quantization uses roughly 4 to 5 GB, and a 70B model can pass 40 GB.
  • An optional GPU. NVIDIA cards work through the CUDA stack, and AMD cards and APUs work through ROCm.

How Much RAM and VRAM Each Model Size Needs

Model size Example RAM or VRAM at 4-bit Runs well on
1B to 3B llama3.2:1b, llama3.2:3b 2 to 4 GB Any modern CPU
7B to 9B llama3.1:8b, qwen2.5-coder:7b 5 to 8 GB Fast CPU or 8 GB GPU
14B deepseek-r1:14b 9 to 11 GB 12 GB GPU
30B MoE qwen3-coder:30b 18 to 20 GB 24 GB GPU or large unified memory
70B and up llama3.3:70b, gpt-oss-120b 40 to 65 GB Multi-GPU or 128 GB unified memory

Mixture of Experts (MoE) models deserve a special mention. They hold many parameters but activate only a few billion per token. That design lets a 30B MoE model generate text faster on a CPU than a dense 14B model, so always check the architecture before you judge a model by its size.

Download a Debian or Ubuntu Template for the Container

Open a shell on the Proxmox host and refresh the template list:

pveam update
pveam available --section system | grep -E "debian-13|ubuntu-24"

Download the file name the command shows you. The version number changes over time, so copy it from your own output:

pveam download local debian-13-standard_13.1-2_amd64.tar.zst

You can also download templates from the web UI. Select your storage, open CT Templates, click Templates and search for the image.

Create the LXC Container for Ollama

Run one pct create command to build the container. Change the ID, storage name and sizes to fit your system:

pct create 120 local:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst \
  --hostname llm \
  --cores 6 \
  --memory 16384 \
  --swap 0 \
  --rootfs local-lvm:80 \
  --net0 name=eth0,bridge=vmbr0,ip=dhcp \
  --features nesting=1 \
  --unprivileged 1 \
  --start 1

A few choices here matter:

  • Swap set to 0. A model that spills into swap slows to a crawl. Give the container real RAM instead.
  • nesting=1. You need it only if you plan to run Docker inside the container for Open WebUI. Turning it on now saves a config edit later.
  • Unprivileged. Keep the container unprivileged whenever you can. Newer Proxmox releases let you pass GPU device files to unprivileged containers, which Step 6 covers.

Plan the disk carefully. Proxmox can grow a container disk in seconds, but it cannot shrink one easily. Start modest and grow it from Resources > Root Disk > Volume Action > Resize when you need more room.

Install Ollama in the Proxmox LXC Container

Enter the container from the host:

pct enter 120

Update the system and run the official installer from Ollama:

apt update && apt upgrade -y
apt install -y curl
curl -fsSL https://ollama.com/install.sh | sh

The script installs the binary, creates an ollama user and registers a systemd service that starts on boot. Confirm that it runs:

systemctl status ollama
ollama -v

A green "active (running)" line means you can move on.

Pull and Test Your First Local Model

Start with a small model to confirm everything works:

ollama pull llama3.2:3b
ollama run llama3.2:3b "Explain an LXC container in two sentences."

You should see an answer within a few seconds on a modern CPU. Type /bye to leave an interactive session.

Once the basics work, pull models that match your tasks:

ollama pull llama3.1:8b          # general chat with a long context window
ollama pull qwen2.5-coder:7b     # code generation
ollama pull nomic-embed-text     # embeddings for document search (RAG)

Run ollama ps while a model answers. The PROCESSOR column tells you whether the model runs on the CPU, the GPU or a split of both.

Make the Ollama API Reachable From Other Devices Securely

Ollama listens only on 127.0.0.1:11434 by default, so other machines cannot reach it. Create a systemd override to change the bind address:

systemctl edit ollama

Add these lines in the editor:

[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"

Save the file and restart the service:

systemctl daemon-reload
systemctl restart ollama

Test it from your laptop or another server:

curl http://192.168.1.50:11434/api/generate \
  -d '{"model":"llama3.2:3b","prompt":"Say hello","stream":false}'

Ollama ships without any login. Anyone who reaches port 11434 can use your models and your compute, the same exposure that fuels LLMjacking attacks. Keep the port inside your home network, restrict it with the Proxmox firewall, and put a reverse proxy with authentication or a VPN like Tailscale in front of it if you want remote access.

Proxmox LXC GPU Passthrough for Ollama (NVIDIA and AMD)

A GPU changes the experience completely. Text generation depends on memory bandwidth, and even an older gaming card beats a fast CPU by several times when the model fits in VRAM.

NVIDIA GPUs

1. Install the driver on the host. The host owns the kernel module, so install the driver there first. Recent Proxmox kernels often outpace the driver in the Debian repositories, so use either the official .run installer from NVIDIA or NVIDIA's CUDA apt repository. Install kernel headers before you start:

apt install -y proxmox-default-headers proxmox-headers-$(uname -r) dkms build-essential

Then block the open source nouveau module so it cannot grab the card:

echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u -k all
reboot

After the reboot, run the NVIDIA installer with DKMS so the module rebuilds after kernel updates:

chmod +x NVIDIA-Linux-x86_64-*.run
./NVIDIA-Linux-x86_64-*.run --dkms
nvidia-smi

Note the driver version that nvidia-smi prints. You need the exact same version inside the container.

2. Keep the device nodes alive. Some device files such as /dev/nvidia-uvm appear only after a CUDA program runs. Enable the persistence daemon so the host creates them at boot:

systemctl enable --now nvidia-persistenced

3. Pass the devices to the container. Stop the container and add these lines to /etc/pve/lxc/120.conf:

dev0: /dev/nvidia0,gid=44
dev1: /dev/nvidiactl,gid=44
dev2: /dev/nvidia-uvm,gid=44
dev3: /dev/nvidia-uvm-tools,gid=44

Add one more devN line for each extra card, such as /dev/nvidia1. You can also add these entries in the web UI under Resources > Add > Device Passthrough. Older guides use lxc.cgroup2.devices.allow and lxc.mount.entry lines in a privileged container. That method still works, but the dev syntax is cleaner and supports unprivileged containers.

Stop and start the container. A simple restart does not always apply new device entries.

4. Install the matching userspace libraries. Copy the same installer into the container and skip the kernel module, because the container uses the host module:

pct push 120 NVIDIA-Linux-x86_64-595.80.run /root/NVIDIA-Linux-x86_64-595.80.run
pct enter 120
chmod +x /root/NVIDIA-Linux-x86_64-595.80.run
/root/NVIDIA-Linux-x86_64-595.80.run --no-kernel-module
nvidia-smi

When nvidia-smi shows your card inside the container, restart Ollama. It detects CUDA automatically:

systemctl restart ollama
ollama run llama3.1:8b "What is 12 times 12?"

Watch nvidia-smi in a second shell. VRAM use and GPU load should climb while the model answers.

AMD GPUs and APUs

AMD hardware uses ROCm, and the setup takes fewer steps because the amdgpu driver ships with the Linux kernel. Map the compute interface and the render node into the container:

dev0: /dev/kfd,gid=104
dev1: /dev/dri/renderD128,gid=104

Find the right group ID by running getent group render inside the container, and use that number in place of 104. Then install Ollama as usual. The installer detects the AMD card and downloads the ROCm build.

APUs with unified memory, such as the Ryzen AI Max series, need one extra tweak. The BIOS often reserves a large fixed block of RAM as VRAM by default. Set a small reservation in the BIOS and raise the ttm.pages_limit kernel parameter on the Proxmox host instead. The GPU then borrows system memory only while a model runs and returns it when the model unloads, which leaves more RAM for your other containers.

Some runtimes pick the Vulkan backend by default on AMD hardware. Inside a container, Vulkan sometimes barely touches the GPU, so benchmark ROCm and Vulkan on each model you care about and lock in the faster one.

Add Open WebUI for a ChatGPT-Style Interface

The command line works, but Open WebUI gives you a browser chat window with history, user accounts, file uploads for RAG and model switching. You can run it with Docker inside the same container, since you enabled nesting earlier:

curl -fsSL https://get.docker.com | sh
docker run -d \
  --name open-webui \
  --restart always \
  --network host \
  -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \
  -v open-webui:/app/backend/data \
  ghcr.io/open-webui/open-webui:main

Open http://<container-ip>:8080 in a browser. The first account you create becomes the admin. If you prefer to keep things tidy, run Open WebUI in its own container and point OLLAMA_BASE_URL at the Ollama container's IP address.

Store Models on a Bigger Disk or NAS

Ollama stores models under the service user's home folder by default. If your root disk sits on small or expensive storage, mount a bigger volume from the host and point Ollama at it.

On the host, add a mount point:

pct set 120 -mp0 /tank/llm-models,mp=/models

Inside the container, give the ollama user ownership and set the path in the same override file you edited earlier:

chown -R ollama:ollama /models
systemctl edit ollama
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_MODELS=/models"

Fast storage matters most when a model loads cold. An NVMe drive wired to the CPU lanes loads a 20 GB model in a few seconds, while a hard drive or a busy network share makes you wait much longer.

Tune Context Length and KV Cache for Faster Responses

Ollama picks a modest context window by default. Coding agents and long documents need much more. Build a custom model with a Modelfile to set your own defaults:

FROM qwen2.5-coder:7b
PARAMETER num_ctx 32768
PARAMETER temperature 0.2
ollama create coder-32k -f Modelfile
ollama run coder-32k

A bigger context window eats VRAM fast because the key-value cache grows with it. Two server settings shrink that cost:

Environment="OLLAMA_FLASH_ATTENTION=1"
Environment="OLLAMA_KV_CACHE_TYPE=q8_0"

Flash attention speeds up long prompts, and an 8-bit cache roughly halves cache memory with little loss in quality. When a model still does not fit in VRAM, Ollama splits the layers between GPU and CPU. That hybrid mode runs slower than full GPU offload but much faster than CPU alone.

If you need finer control, you can run llama.cpp directly in the same container. Its llama-server binary lets you set the exact number of GPU layers with -ngl and exposes an OpenAI-compatible API, which suits coding tools that expect that format.

Is a Proxmox LXC Slower Than Bare Metal for LLMs?

For most setups, no. The container runs on the host kernel and uses the host GPU driver, so token generation lands very close to a bare metal install. You will not find a big speed penalty from the container layer itself.

One owner of an AMD Ryzen AI Max mini PC tested this with gpt-oss-120b. The model generated roughly 36 to 42 tokens per second inside an LXC container, and a laptop with the same chip running Windows and Ollama managed about 32. The comparison is loose, since the software, the operating system and the prompt length all differed. It still shows that a container does not hold a large model back.

The backend you pick changes speed far more than the container does. On that same machine, a 9B model ran at about 33 tokens per second on ROCm and about 11 on Vulkan. Vulkan barely used the GPU inside the container, and the first token took ten times longer in the heaviest test. If your runtime offers a backend choice, test both and save the winner, because some tools quietly fall back to the slower one when a model reloads.

Hybrid CPU and GPU loading also helps on small cards. An 8 GB laptop GPU that held only 12 of a model's 30 layers still lifted generation from the high teens to about 21 tokens per second, and it sped up prompt processing the most. Plan your VRAM around that: even partial offload pays off, and full offload pays off more.

Not every model behaves the same way. One 30B coding model ran faster on Vulkan than on ROCm on a bare metal mini PC, but it crawled on Vulkan inside a container. Run a quick benchmark on each model you care about before you decide whether it belongs in a container or on bare metal.

Snapshot and Update Ollama Without Losing Your Models

Take a snapshot as soon as your GPU setup works. From the host:

pct snapshot 120 gpu-working

Ollama updates often. To upgrade, snapshot first, then run the installer again inside the container:

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

Your downloaded models stay in place. If anything breaks, roll back in seconds with pct rollback 120 gpu-working.

Host kernel updates need more care with NVIDIA. DKMS rebuilds the module for the new kernel, but if you also upgrade the host driver, you must install the same version inside the container before the GPU works again.

Common Ollama and GPU Errors in Proxmox LXC and How to Fix Them

Symptom Likely cause Fix
Failed to initialize NVML in the container Driver version mismatch Install the exact host driver version with --no-kernel-module
/dev/nvidia-uvm missing Node not created at boot Enable nvidia-persistenced on the host
connection refused from another machine Ollama bound to localhost Set OLLAMA_HOST=0.0.0.0:11434 and restart
Model runs on CPU despite a GPU Devices not mapped or wrong group Check ls -la /dev/nvidia* or /dev/dri and the gid values
Container fails to start after DNS tweaks chattr +i on /etc/resolv.conf Mount the rootfs from the host and run chattr -i on the file
Container freezes under load Memory limit reached Raise the RAM limit, unload extra models or pick a smaller quant
Very slow replies Model too large for RAM or VRAM Use a smaller model, a MoE model or a lower quantization

Read the service log first whenever Ollama misbehaves:

journalctl -u ollama -n 80 --no-pager

The log shows which GPU Ollama detected, which backend it chose and why a model failed to load.

Frequently Asked Questions

Can I run a local LLM in Proxmox without a GPU?

Yes. You can run an LLM locally on CPU alone with Ollama, and models from 1B to 8B respond at usable speeds on most modern processors. MoE models also perform surprisingly well on CPU because they compute only a small part of their weights for each token.

Does an LXC container slow down the model compared to bare metal?

Hardly at all. The container shares the host kernel and talks to the GPU through the same driver, so performance lands very close to a bare metal install. The runtime and backend you choose affect speed far more than the container does.

Do I need a privileged container for GPU access?

Not on current Proxmox releases. The dev0: style device entries work with unprivileged containers, which keeps the host safer. Older guides required a privileged container because they relied on raw cgroup rules.

Can several containers share one GPU?

Yes. You can map the same device files into more than one container, and each one can run its own workload. They share VRAM, though, so two large models loaded at once can run the card out of memory.

Which model should I try first?

Start with llama3.2:3b to confirm the setup works. Move to llama3.1:8b for general chat or qwen2.5-coder:7b for programming once you know how your hardware performs. Our list of the best LLMs for developers helps you compare more options.

Is my data private with this setup?

Your prompts and documents never leave your network unless you expose the API yourself. Remember that Ollama has no login, so anyone on your LAN can use it unless you add a firewall rule or an authenticated proxy.

Was this guide helpful?
Fdaytalk

The Fdaytalk editorial team tests games, apps and devices and writes clear, step-by-step fixes and guides.

More from Fdaytalk →

Related reading

More in Dev Codes →