[GH-ISSUE #8937] Unable to make OLLAMA_KEEP_ALIVE effective in the ollama official docker #5799

Closed
opened 2026-04-12 17:08:32 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @DY-ATL on GitHub (Feb 8, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8937

What is the issue?

I add env variable when starting the docker (-e OLLAMA_KEEP_ALIVE='60'), it doesn't work.
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 -e OLLAMA_KEEP_ALIVE='60' --name ollama ollama/ollama
But the env variable has been passed in and can be checked by echo $OLLAMA_KEEP_ALIVE.
Also, I cannot restart the ollama via systemctl restart ollama because there is no systemctl. service ollama restart doesn't work too.

Relevant log output


OS

Docker

GPU

Nvidia

CPU

Intel

Ollama version

0.5.7-0-ga420a45-dirty

Originally created by @DY-ATL on GitHub (Feb 8, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8937 ### What is the issue? I add env variable when starting the docker (`-e OLLAMA_KEEP_ALIVE='60'`), it doesn't work. `docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 -e OLLAMA_KEEP_ALIVE='60' --name ollama ollama/ollama` But the env variable has been passed in and can be checked by `echo $OLLAMA_KEEP_ALIVE`. Also, I cannot restart the ollama via `systemctl restart ollama` because there is no `systemctl`. `service ollama restart` doesn't work too. ### Relevant log output ```shell ``` ### OS Docker ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.7-0-ga420a45-dirty
GiteaMirror added the bug label 2026-04-12 17:08:32 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 8, 2025):

What do the logs (docker logs ollama) show?

Also, I cannot restart the ollama via systemctl restart ollama because there is no systemctl

docker restart ollama

<!-- gh-comment-id:2644446781 --> @rick-github commented on GitHub (Feb 8, 2025): What do the logs (`docker logs ollama`) show? > Also, I cannot restart the ollama via systemctl restart ollama because there is no systemctl `docker restart ollama`
Author
Owner

@DY-ATL commented on GitHub (Feb 8, 2025):

It works! Restarting the docker docker restart ollama after docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 -e OLLAMA_KEEP_ALIVE='60' --name ollama ollama/ollama works!

<!-- gh-comment-id:2644447659 --> @DY-ATL commented on GitHub (Feb 8, 2025): It works! Restarting the docker `docker restart ollama` after `docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 -e OLLAMA_KEEP_ALIVE='60' --name ollama ollama/ollama` works!
Author
Owner

@DY-ATL commented on GitHub (Feb 8, 2025):

I had the same problem as https://github.com/ollama/ollama/issues/5272#issuecomment-2188709424. If I run ollama run deepseek-r1:671b, then the UNTIL is as expected. However, if I use Chrome extension Page Assist, the UNTIL is still default 5 min.

<!-- gh-comment-id:2644493623 --> @DY-ATL commented on GitHub (Feb 8, 2025): I had the same problem as https://github.com/ollama/ollama/issues/5272#issuecomment-2188709424. If I run `ollama run deepseek-r1:671b`, then the UNTIL is as expected. However, if I use Chrome extension **Page Assist**, the UNTIL is still default 5 min.
Author
Owner

@rick-github commented on GitHub (Feb 8, 2025):

The extension is setting keep_alive in the API call. Configure it so that it doesn't.

<!-- gh-comment-id:2644733711 --> @rick-github commented on GitHub (Feb 8, 2025): The extension is setting `keep_alive` in the API call. Configure it so that it doesn't.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5799