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.
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