Error: mkdir /root/.ollama: read-only file system
-
Hello @nostrdev
Please use
ollama pull $MODELL_NAMEas documented https://docs.cloudron.io/packages/ollama#downloading-models
This correctly downloads the model to/app/data/ollama-home/.Cloudron sets the following environment variable in the start.sh#L23:
export OLLAMA_MODELS=/app/data/ollama-home/modelsOllama is started with a supervisor service https://git.cloudron.io/packages/ollama-app/-/blob/master/supervisor/ollama.conf in which the
HOMEis set:environment=HOME=/app/data/ollama-homeThus, when running
ollamafrom the web terminal, you are running Ollama as user root with its own environment variables.
In order to useollama run $MODELL_NAMEyou will need to run it the following way:gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama run $MODELL_NAME'That
ollama runandpullbehave so different is an upstream issue.
IMHO,ollama runshould also respect the set environment, but it does not and instead usesos.UserHomeDir() -
Now that I thought about it, it makes sense that
ollama runbehaves in such a way when you look at Ollama outside the Cloudron scope.Example, you have an office AI-Server that is running
ollama serveand every user can useollama runon their local shell connecting to the server.
So usertinawill write her ownollama runchat history to/home/tina/.ollamaand usertimwould write to/home/tim/.ollama.
If it was unified to a server sideHOMEyou would have to do the chat separation on the server level.
And that is what the WebUI is for.This does also imply that when using:
gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama run $MODELL_NAME'you will share the chat history with anyone who is also might have access to the web terminal.
-
Yes so I think the issue stems from the fact that ollama has a client/server architecture, where the Cloudron ollama app is acting as the server component (
ollama serve) while if you runollama runfor example, it starts a client talking to that ollama server. The client here tries to save some info in the user's HOME which is /root here for the client.At least so far the package was thought of only acting as the server. This means one uses ollama in client mode on the dev environment or via agentic tools like opencode. Those would not run inside that ollama app instance, but would just connect to the ollama web api and run only the models in the app.
-
using gosu does the trick, thank you
root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama pull qwen3.5:35b pulling manifest pulling 900dde62fb7e: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 23 GB pulling 7339fa418c9a: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 11 KB pulling 9371364b27a5: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 65 B pulling 606ad9f1ecbc: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 482 B verifying sha256 digest writing manifest success root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama ps NAME ID SIZE PROCESSOR CONTEXT UNTIL root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama ls NAME ID SIZE MODIFIED qwen3.5:35b 3460ffeede54 23 GB 50 seconds ago nemotron-3-super:latest 95acc78b3ffd 86 GB 19 hours ago root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama serve Couldn't find '/root/.ollama/id_ed25519'. Generating new private key. Error: could not create directory mkdir /root/.ollama: read-only file system root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama serve' Error: listen tcp 127.0.0.1:11434: bind: address already in use root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama ps' NAME ID SIZE PROCESSOR CONTEXT UNTIL qwen3.5:35b 3460ffeede54 25 GB 100% CPU 4096 4 minutes from now root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# -
using gosu does the trick, thank you
root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama pull qwen3.5:35b pulling manifest pulling 900dde62fb7e: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 23 GB pulling 7339fa418c9a: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 11 KB pulling 9371364b27a5: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 65 B pulling 606ad9f1ecbc: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 482 B verifying sha256 digest writing manifest success root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama ps NAME ID SIZE PROCESSOR CONTEXT UNTIL root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama ls NAME ID SIZE MODIFIED qwen3.5:35b 3460ffeede54 23 GB 50 seconds ago nemotron-3-super:latest 95acc78b3ffd 86 GB 19 hours ago root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# ollama serve Couldn't find '/root/.ollama/id_ed25519'. Generating new private key. Error: could not create directory mkdir /root/.ollama: read-only file system root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama serve' Error: listen tcp 127.0.0.1:11434: bind: address already in use root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code# gosu cloudron:cloudron bash -c 'HOME=/app/data/ollama-home ollama ps' NAME ID SIZE PROCESSOR CONTEXT UNTIL qwen3.5:35b 3460ffeede54 25 GB 100% CPU 4096 4 minutes from now root@4772c55c-cc53-4e23-b90e-d3d8b5687bab:/app/code#
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login