[GH-ISSUE #7421] Docs: Add Linux manual instructions that can run without root / sudo #66776

Open
opened 2026-05-04 08:09:32 -05:00 by GiteaMirror · 15 comments
Owner

Originally created by @gabe-l-hart on GitHub (Oct 30, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7421

Description

In the Linux manual install instructions, the commands are shown requiring sudo access. This is usually fine with personal machines, but often isn't for shared or managed machines. The request here is to add instructions on how to install without root access.

Proposal

I'm happy to contribute the README PR. Here are my suggested changes:


Manual install

Download and extract the package:

curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgz

Non-root install

For those installing without root/sudo access, the install can also be done in user space with the appropriate additions to PATH and LD_LIBRARY_PATH:

curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
# Substitute any place you have write access for ~/.local
mkdir -p ~/.local
tar -C ~/.local -xzf ollama-linux-amd64.tgz
# Place this in your ~/.bashrc to persist
export PATH=$HOME/.local/bin:$PATH
export LD_LIBRARY_PATH=$HOME/.local/lib/ollama:$LD_LIBRARY_PATH

Start Ollama:

ollama serve

In another terminal, verify that Ollama is running:

ollama -v
Originally created by @gabe-l-hart on GitHub (Oct 30, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7421 ## Description In the [Linux manual install instructions](https://github.com/ollama/ollama/blob/main/docs/linux.md#manual-install), the commands are shown requiring `sudo` access. This is usually fine with personal machines, but often isn't for shared or managed machines. The request here is to add instructions on how to install without `root` access. ## Proposal I'm happy to contribute the README PR. Here are my suggested changes: --- ## Manual install ### Download and extract the package: ```shell curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz sudo tar -C /usr -xzf ollama-linux-amd64.tgz ``` ### Non-root install For those installing without root/sudo access, the install can also be done in user space with the appropriate additions to `PATH` and `LD_LIBRARY_PATH`: ```shell curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz # Substitute any place you have write access for ~/.local mkdir -p ~/.local tar -C ~/.local -xzf ollama-linux-amd64.tgz # Place this in your ~/.bashrc to persist export PATH=$HOME/.local/bin:$PATH export LD_LIBRARY_PATH=$HOME/.local/lib/ollama:$LD_LIBRARY_PATH ``` ### Start Ollama: ```shell ollama serve ``` In another terminal, verify that Ollama is running: ```shell ollama -v ```
GiteaMirror added the feature request label 2026-05-04 08:09:32 -05:00
Author
Owner

@1907010218 commented on GitHub (Nov 1, 2024):

What about "ollama-linux-amd64.tgz"? Same as "sudo tar -C/usr-xzf ollama-linux-amd64.tgz" but without "sudo"?

<!-- gh-comment-id:2451462349 --> @1907010218 commented on GitHub (Nov 1, 2024): What about "ollama-linux-amd64.tgz"? Same as "sudo tar -C/usr-xzf ollama-linux-amd64.tgz" but without "sudo"?
Author
Owner

@gabe-l-hart commented on GitHub (Nov 1, 2024):

Shoot, yes, definitely missing/incorrect tar command in my issue and in my PR. Will fix that. Thanks for catching it!

<!-- gh-comment-id:2452210314 --> @gabe-l-hart commented on GitHub (Nov 1, 2024): Shoot, yes, definitely missing/incorrect `tar` command in my issue and in my PR. Will fix that. Thanks for catching it!
Author
Owner

@Kunssi commented on GitHub (Nov 2, 2024):

如何在没有访问权限的情况下安装

May I ask how to install Olama without access permission? If possible, could you tell me? This question has been bothering me for a long time, and your answer will be very important to me! If you could answer me, I would be very grateful

<!-- gh-comment-id:2452911889 --> @Kunssi commented on GitHub (Nov 2, 2024): > 如何在没有访问权限的情况下安装 May I ask how to install Olama without access permission? If possible, could you tell me? This question has been bothering me for a long time, and your answer will be very important to me! If you could answer me, I would be very grateful
Author
Owner

@1907010218 commented on GitHub (Nov 2, 2024):

如何在没有访问权限的情况下安装

May I ask how to install Olama without access permission? If possible, could you tell me? This question has been bothering me for a long time, and your answer will be very important to me! If you could answer me, I would be very grateful

You can try the "Non-root install" step to install

<!-- gh-comment-id:2452937656 --> @1907010218 commented on GitHub (Nov 2, 2024): > > 如何在没有访问权限的情况下安装 > > May I ask how to install Olama without access permission? If possible, could you tell me? This question has been bothering me for a long time, and your answer will be very important to me! If you could answer me, I would be very grateful You can try the "Non-root install" step to install
Author
Owner

@zengxiaofei commented on GitHub (Nov 2, 2024):

Great! It helps me a lot! 👍

<!-- gh-comment-id:2452949936 --> @zengxiaofei commented on GitHub (Nov 2, 2024): Great! It helps me a lot! 👍
Author
Owner

@adbenitez commented on GitHub (Nov 13, 2024):

after a horrible experience with the script, running out of space in / and no clean way to uninstall, I installed it on Linux using nix, command:
nix profile install nixpkgs#ollama

no root/sudo required, installation was super fast, easy to uninstall in a clean way and everything is in my home partition

the nix package is not in the latest version, would be nice if it is updated

<!-- gh-comment-id:2472216679 --> @adbenitez commented on GitHub (Nov 13, 2024): after a horrible experience with the script, running out of space in `/` and no clean way to uninstall, I installed it on Linux using `nix`, command: `nix profile install nixpkgs#ollama` no root/sudo required, installation was super fast, easy to uninstall in a clean way and everything is in my `home` partition the nix package is not in the latest version, would be nice if it is updated
Author
Owner

@SynapseScribe commented on GitHub (Dec 16, 2024):

seems to go into
/usr/local/lib/ollama
~/.ollama
/usr/local/bin/ollama
/etc/systemd/system/ollama.service

might be other places i am not aware

<!-- gh-comment-id:2546648240 --> @SynapseScribe commented on GitHub (Dec 16, 2024): seems to go into /usr/local/lib/ollama ~/.ollama /usr/local/bin/ollama /etc/systemd/system/ollama.service might be other places i am not aware
Author
Owner

@alin256 commented on GitHub (Dec 18, 2024):

Would be great if this one is fixed.

<!-- gh-comment-id:2551125351 --> @alin256 commented on GitHub (Dec 18, 2024): Would be great if this one is fixed.
Author
Owner

@iuriguilherme commented on GitHub (Jan 30, 2025):

I don't think this is gonna do what you expect because ollama will still try to write to /usr/share/ollama anyway

You would have to compile it and include the proper path flags (for example ./configure --prefix=$HOME/.local)

<!-- gh-comment-id:2623327298 --> @iuriguilherme commented on GitHub (Jan 30, 2025): I don't think this is gonna do what you expect because ollama will still try to write to **/usr/share/ollama** anyway You would have to compile it and include the proper path flags (for example `./configure --prefix=$HOME/.local`)
Author
Owner

@gabe-l-hart commented on GitHub (Jan 30, 2025):

Interesting. This issue is quite old at this point, so it's possible that the build/install has changed since I opened it. Last I checked, once installed ollama does not write to any restricted paths at runtime, but it seems like the paths within their prebuilt tarballs may attempt to extract themselves to /usr/share automatically?

<!-- gh-comment-id:2625152940 --> @gabe-l-hart commented on GitHub (Jan 30, 2025): Interesting. This issue is quite old at this point, so it's possible that the build/install has changed since I opened it. Last I checked, once installed `ollama` does not write to any restricted paths at runtime, but it seems like the paths within their prebuilt tarballs may attempt to extract themselves to `/usr/share` automatically?
Author
Owner

@godmar commented on GitHub (Feb 5, 2025):

My experience as of today, using today's available build:

  • The original instructions (setting PATH and LD_LIBRARY_PATH) still work.
  • Models, however, are downloaded to ~/.ollama - that is, into the current user's home directory.
  • Setting OLLAMA_MODELS for the current user, however, will cause ollama to download models into that directory.
<!-- gh-comment-id:2637509800 --> @godmar commented on GitHub (Feb 5, 2025): My experience as of today, using today's available build: - The original instructions (setting `PATH` and `LD_LIBRARY_PATH`) still work. - Models, however, are downloaded to `~/.ollama` - that is, into the current user's home directory. - Setting `OLLAMA_MODELS` for the current user, however, will cause ollama to download models into that directory.
Author
Owner

@brossanova commented on GitHub (Feb 6, 2025):

I would add to the "Non-root install" that after adding both export lines to .bashrc you may have to use the source command to apply .bashrc changes (for non expert this is not obvious):

source .bashrc

<!-- gh-comment-id:2640354124 --> @brossanova commented on GitHub (Feb 6, 2025): I would add to the "Non-root install" that after adding both export lines to .bashrc you may have to use the source command to apply .bashrc changes (for non expert this is not obvious): `source .bashrc`
Author
Owner

@dmhowcroft commented on GitHub (Sep 19, 2025):

What I did today:

# Navigate to preferred install location
cd ~/my-location
# Make an ollama dir and switch to it
mkdir ollama
cd ollama
# Download the tarball
curl -LO https://ollama.com/download/ollama-linux-amd64.tgz
# Extract the files
tar xzvf ollama-linux-amd64.tgz

That gives me the ollama binary at ~/my-location/ollama/bin/ollama, so I added ~/my-location/ollama/bin to my PATH in my .bashrc to be able to run it anywhere instead of having to navigate to ~/my-location/ollama/bin and run ./ollama.

This seems to work when I run ollama serve, ollama pull, and ollama run with different models on an HP Zbook running Ubuntu 24.04 with an NVIDIA RTX 2000 (~8GB VRAM), but I have not run extensive tests.

<!-- gh-comment-id:3311757642 --> @dmhowcroft commented on GitHub (Sep 19, 2025): What I did today: ```bash # Navigate to preferred install location cd ~/my-location # Make an ollama dir and switch to it mkdir ollama cd ollama # Download the tarball curl -LO https://ollama.com/download/ollama-linux-amd64.tgz # Extract the files tar xzvf ollama-linux-amd64.tgz ``` That gives me the `ollama` binary at `~/my-location/ollama/bin/ollama`, so I added `~/my-location/ollama/bin` to my `PATH` in my `.bashrc` to be able to run it anywhere instead of having to navigate to `~/my-location/ollama/bin` and run `./ollama`. This seems to work when I run `ollama serve`, `ollama pull`, and `ollama run` with different models on an HP Zbook running Ubuntu 24.04 with an NVIDIA RTX 2000 (~8GB VRAM), but I have not run extensive tests.
Author
Owner

@sumeromer commented on GitHub (Feb 4, 2026):

I needed to install Ollama on a machine where I did not have sudo access. The suggested approach works in principle, but recent releases no longer provide a .tgz archive.

For Linux/Ubuntu, I could install Ollama successfully into a local directory using the script below:


#!/usr/bin/env bash

VERSION="v0.15.5-rc2"
INSTALL_DIR="${LOCAL_ROOT_FOLDER}/.local"

mkdir -p "${INSTALL_DIR}"

wget -q "https://github.com/ollama/ollama/releases/download/${VERSION}/ollama-linux-amd64.tar.zst"

unzstd -f ollama-linux-amd64.tar.zst
tar -xvf ollama-linux-amd64.tar -C "${INSTALL_DIR}"

export PATH="${INSTALL_DIR}/bin:${PATH}"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib/ollama:${LD_LIBRARY_PATH:-}"

ollama serve &
sleep 1
ollama -v

Note: ollama serve runs in the background here, so remember to stop the process when you’re done.
Additionally, I needed to run multiple models in parallel. This seems to be controlled via the OLLAMA_NUM_PARALLEL environment variable, which needs to be set before starting the server, for example: export OLLAMA_NUM_PARALLEL=8

<!-- gh-comment-id:3849529900 --> @sumeromer commented on GitHub (Feb 4, 2026): I needed to install Ollama on a machine where I did not have sudo access. The suggested approach works in principle, but recent releases no longer provide a .tgz archive. For Linux/Ubuntu, I could install Ollama successfully into a local directory using the script below: ```bash #!/usr/bin/env bash VERSION="v0.15.5-rc2" INSTALL_DIR="${LOCAL_ROOT_FOLDER}/.local" mkdir -p "${INSTALL_DIR}" wget -q "https://github.com/ollama/ollama/releases/download/${VERSION}/ollama-linux-amd64.tar.zst" unzstd -f ollama-linux-amd64.tar.zst tar -xvf ollama-linux-amd64.tar -C "${INSTALL_DIR}" export PATH="${INSTALL_DIR}/bin:${PATH}" export LD_LIBRARY_PATH="${INSTALL_DIR}/lib/ollama:${LD_LIBRARY_PATH:-}" ollama serve & sleep 1 ollama -v ``` **Note:** ollama serve runs in the background here, so remember to stop the process when you’re done. Additionally, I needed to run multiple models in parallel. This seems to be controlled via the ```OLLAMA_NUM_PARALLEL``` environment variable, which needs to be set before starting the server, for example: ```export OLLAMA_NUM_PARALLEL=8```
Author
Owner

@hbbeytur commented on GitHub (Apr 27, 2026):

There is a manual installation guide here: https://docs.ollama.com/linux#manual-install

To install without sudo use:

mkdir -p ./ollama
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
  | tar --zstd -xvf - -C ./ollama

Why your error happened:

  • tar didn’t auto-decompress .zst from stdin.
  • Once tar exited, curl got a broken pipe, which shows up as curl: (23).

If your tar doesn’t support --zstd, install zstd and do:

mkdir -p ./ollama
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
  | unzstd \
  | tar -xvf - -C ./ollama

Then, add to PATH

export PATH="$HOME/ollama/bin:$PATH"
<!-- gh-comment-id:4331142972 --> @hbbeytur commented on GitHub (Apr 27, 2026): There is a manual installation guide here: [https://docs.ollama.com/linux#manual-install](https://docs.ollama.com/linux#manual-install) To install without sudo use: ```bash mkdir -p ./ollama curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \ | tar --zstd -xvf - -C ./ollama ``` Why your error happened: - `tar` didn’t auto-decompress `.zst` from stdin. - Once `tar` exited, `curl` got a broken pipe, which shows up as `curl: (23)`. If your `tar` doesn’t support `--zstd`, install `zstd` and do: ```bash mkdir -p ./ollama curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \ | unzstd \ | tar -xvf - -C ./ollama ``` Then, add to PATH ```bash export PATH="$HOME/ollama/bin:$PATH" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#66776