[GH-ISSUE #6300] ollama creates a new ollama runner folder each container restart #3949

Closed
opened 2026-04-12 14:49:34 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @minionflo on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6300

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

If you for example run ollama/ollama with --restart=unless-stopped and it crashes after “extracting embedded files” it creates a new Ollama runner folder in /tmp/ and with each additional restart it creates a new folder. This behavior fills the Host Disk VERY fast.

OS

Docker

GPU

Intel

CPU

AMD

Ollama version

0.3.4

Originally created by @minionflo on GitHub (Aug 10, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6300 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? If you for example run ollama/ollama with `--restart=unless-stopped` and it crashes after “extracting embedded files” it creates a new Ollama runner folder in /tmp/ and with each additional restart it creates a new folder. This behavior fills the Host Disk VERY fast. ### OS Docker ### GPU Intel ### CPU AMD ### Ollama version 0.3.4
GiteaMirror added the dockerlinuxbug labels 2026-04-12 14:49:34 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 11, 2024):

You can tell ollama to use a consistent directory by setting OLLAMA_TMPDIR in the environment, eg --env OLLAMA_TMPDIR=/tmp/ollama.

<!-- gh-comment-id:2282799743 --> @rick-github commented on GitHub (Aug 11, 2024): You can tell ollama to use a consistent directory by setting `OLLAMA_TMPDIR` in the environment, eg `--env OLLAMA_TMPDIR=/tmp/ollama`.
Author
Owner

@minionflo commented on GitHub (Aug 11, 2024):

That works (Thanks), but I think it should not do that in the first place

<!-- gh-comment-id:2282805570 --> @minionflo commented on GitHub (Aug 11, 2024): That works (Thanks), but I think it should not do that in the first place
Author
Owner

@dhiltgen commented on GitHub (Aug 18, 2024):

We fixed some cleanup logic in v0.3.5 which should hopefully resolve this. If you're still seeing this behavior of leaving old tmp dir extracts lying around after a restart on newer versions, please share a server log with OLLAMA_DEBUG=1 set and I'll reopen the issue.

<!-- gh-comment-id:2295316844 --> @dhiltgen commented on GitHub (Aug 18, 2024): We fixed some cleanup logic in v0.3.5 which should hopefully resolve this. If you're still seeing this behavior of leaving old tmp dir extracts lying around after a restart on newer versions, please share a server log with OLLAMA_DEBUG=1 set and I'll reopen the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3949