Why does `ollama push mymodel` fail with "not authorized to push to this namespace", and how do you publish it for teammates?
answer
- who owns the default namespace
- an ollama.com username
- the public key on your account
- rename with a cheap copy
- push uploads blobs, then the manifest
basics
~10 sAn unqualified name lands in the library namespace, which you do not own. Add Ollama's public key to your ollama.com account, rename with ollama cp mymodel myuser/mymodel, push that name, and teammates pull myuser/mymodel.
solid answer
~40 s`mymodel` expands to `registry.ollama.ai/library/mymodel`, and `library` is the curated namespace, so the registry refuses it and the CLI prints "you are not authorized to push to this namespace, create the model under a namespace you own". Push needs three things: an ollama.com account, whose username becomes the namespace; Ollama's public key added to that account, by `ollama signin` or by pasting `id_ed25519.pub` into the keys settings page; and the model named under that username. `ollama cp mymodel myuser/mymodel` does the rename by writing one manifest, then `ollama push myuser/mymodel` uploads each layer and finally the manifest and prints the model's page on ollama.com. Teammates run `ollama pull myuser/mymodel`, or an explicit tag you pushed.
go deeper
Recall that a bare name lives in the library namespace and that pushing needs a name under your own ollama.com username.
Explain the account, the registered public key and the cp-then-push rename, and why the copy is free on disk.
Set up pushes from headless build machines by registering each server's key, and publish under new tags so teammates never drift onto a rebuilt latest.
Decide whether ollama.com namespaces are an acceptable distribution channel for a team's models or whether weights must stay on infrastructure you control, weighing convenience against exposure.
## Why the first push fails Every Ollama model name has a host, a namespace, a model and a tag, and the short form fills in the gaps: host `registry.ollama.ai`, namespace `library`, tag `latest`. A model you built locally and called `mymodel` is therefore stored as `registry.ollama.ai/library/mymodel:latest`. Pushing it asks the registry to write into `library`, the curated catalogue, which only its maintainers can do. The registry answers with an access-denied error and the CLI turns it into: > you are not authorized to push to this namespace, create the model under a namespace you own Nothing is wrong with the model. The **name** points at someone else's namespace. ## What push needs 1. **An ollama.com account.** The username you choose at sign-up becomes the namespace in your model names (`myuser/mymodel`), so pick one you are happy to see in every pull command. 2. **Ollama's public key on that account.** The local Ollama install has its own ed25519 key pair. Its public half, `id_ed25519.pub`, must be registered with ollama.com. Either run `ollama signin` (or sign in from the desktop app's settings), or paste the key into the keys settings page on ollama.com. The key file lives at `~/.ollama/id_ed25519.pub` on macOS, `/usr/share/ollama/.ollama/id_ed25519.pub` for the Linux service, and `C:\Users\<username>\.ollama\id_ed25519.pub` on Windows. 3. **The right name.** Rename with `ollama cp`, which writes a second manifest pointing at the same blobs, so it costs no disk and leaves the original name in place. ```bash ollama cp mymodel myuser/mymodel ollama push myuser/mymodel ``` To publish a specific variant rather than `latest`, give the copy a tag, for example `myuser/mymodel:v2`, and push that. ## What push actually sends Push works layer by layer, like a pull in reverse: - It reads the local manifest for the name. - It uploads each blob the manifest lists, showing a progress bar per digest. - It then sends the manifest itself, which is what makes the name resolvable on the registry. - On success it prints where the model can be found, for example `https://ollama.com/myuser/mymodel`. Because the manifest is sent last, a push that fails part-way does not change what the name resolves to for teammates. The `--insecure` flag exists for pushing to a registry reached over plain HTTP; it has nothing to do with authorisation on ollama.com. ## Getting it onto teammates' machines Once pushed, the model is addressed like any library model, with the namespace in front: | Step | Command | |---|---| | first install | `ollama pull myuser/mymodel` | | run, pulling if missing | `ollama run myuser/mymodel` | | pin a variant | `ollama pull myuser/mymodel:v2` | | confirm everyone matches | compare the `ID` column of `ollama ls` | Pulling **private** models from ollama.com also relies on the puller's Ollama public key being registered with an account that has access, so the same key setup applies to each teammate. ## Operating notes - A pushed tag is still mutable: pushing again under `myuser/mymodel:latest` changes what the next pull brings. Push new builds under new tags when teammates must not drift. - The push is of whatever the local manifest says. If the model was built from a Modelfile, that build step is the Modelfile material's subject; push only publishes the result. - Publishing to ollama.com sends the model's layers off your machine. Whether a given base model's licence allows redistribution, and whether consumers should trust what they pull, are questions for the licensing and supply-chain material. ## Reading the failures | Symptom | Likely cause | Fix | |---|---|---| | "not authorized to push to this namespace" | the name is in `library` or another user's namespace | `ollama cp` to `myuser/...` and push that | | the same error under `myuser/...` | this machine's public key is not on the account | `ollama signin`, or paste `id_ed25519.pub` into the keys page | | teammates pull an old build | they pulled a tag you later pushed over, or never re-pulled | push new builds under new tags and pull them explicitly | The second row catches people who signed in on one laptop and then push from a different machine: every machine that pushes has its own key.
- Does `ollama cp mymodel myuser/mymodel` double the disk used before the push?No. `ollama cp` writes one new manifest file under the new name; the layers it lists are content-addressed blobs already in the store, so both names share them. You can keep or `ollama rm` the old name afterwards, and removal frees nothing while the other name still references the blobs.
- You signed in on your laptop, but the same push fails from a Linux build server running the Ollama service. What is missing?That server has its own key pair, in the service user's home at `/usr/share/ollama/.ollama/id_ed25519.pub`. Its public key has to be added to the ollama.com account too, by `ollama signin` on that machine or by pasting the key into the keys settings page, before the registry will accept pushes from it.
- The push failed because the model file is too large for ollama.com.
- Passing --insecure to ollama push gets around the namespace error.
- ollama cp duplicates the weights before you can push under a new name.
- Pushing an unqualified name publishes it under your username automatically.
- Once pushed, a tag such as latest can never point at a different build.