[GH-ISSUE #2111] Enable installation without root priviledge #26969

Closed
opened 2026-04-22 03:46:42 -05:00 by GiteaMirror · 15 comments
Owner

Originally created by @chunhualiao on GitHub (Jan 20, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2111

It seems like ollama will run sudo during its installation on Linux.

Please support the installation and use of users without sudo priviledge.

thanks.

Originally created by @chunhualiao on GitHub (Jan 20, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2111 It seems like ollama will run sudo during its installation on Linux. Please support the installation and use of users without sudo priviledge. thanks.
Author
Owner

@jmorganca commented on GitHub (Jan 21, 2024):

Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve). Let me know if that helps!

<!-- gh-comment-id:1902449564 --> @jmorganca commented on GitHub (Jan 21, 2024): Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an `ollama` user. The [releases](https://github.com/jmorganca/ollama/releases) include pre-built binaries that will work without any sudo (e.g. just run `ollama serve`). Let me know if that helps!
Author
Owner

@ReanFernandes commented on GitHub (Jan 21, 2024):

Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve). Let me know if that helps!

Hello!
Im trying to get ollama up and running on a cluster which i do not have sudo access to. Could you please elaborate how I could go about the installation?
Note: I am a newbie to this, and the install page does not have any info on how to go about this. I would gladly appreciate any help you could provide! :)
Thank you!

<!-- gh-comment-id:1902751675 --> @ReanFernandes commented on GitHub (Jan 21, 2024): > Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an `ollama` user. The [releases](https://github.com/jmorganca/ollama/releases) include pre-built binaries that will work without any sudo (e.g. just run `ollama serve`). Let me know if that helps! Hello! Im trying to get ollama up and running on a cluster which i do not have sudo access to. Could you please elaborate how I could go about the installation? Note: I am a newbie to this, and the [install page](https://github.com/jmorganca/ollama/blob/main/docs/linux.md) does not have any info on how to go about this. I would gladly appreciate any help you could provide! :) Thank you!
Author
Owner

@chunhualiao commented on GitHub (Feb 9, 2024):

@ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64.

Just download it to your Linux cluster, then run the following:

start the server in background

./ollama-linux-amd64 serve&

run a local model afterwards

./ollama-linux-amd64 run llama2

I wish someone can add this into their official instructions.

<!-- gh-comment-id:1935146890 --> @chunhualiao commented on GitHub (Feb 9, 2024): @ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64. Just download it to your Linux cluster, then run the following: # start the server in background ./ollama-linux-amd64 serve& # run a local model afterwards ./ollama-linux-amd64 run llama2 I wish someone can add this into their official instructions.
Author
Owner

@Anirudh257 commented on GitHub (Feb 21, 2024):

@ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64.

Just download it to your Linux cluster, then run the following:

start the server in background

./ollama-linux-amd64 serve&

run a local model afterwards

./ollama-linux-amd64 run llama2

I wish someone can add this into their official instructions.

Hi @chunhualiao even bash access is prohibited on cluster. @ReanFernandes you will need to build it from scratch on your cluster.

<!-- gh-comment-id:1955463190 --> @Anirudh257 commented on GitHub (Feb 21, 2024): > @ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64. > > Just download it to your Linux cluster, then run the following: > > # start the server in background > ./ollama-linux-amd64 serve& > > # run a local model afterwards > ./ollama-linux-amd64 run llama2 > > I wish someone can add this into their official instructions. Hi @chunhualiao even bash access is prohibited on cluster. @ReanFernandes you will need to build it from scratch on your cluster.
Author
Owner

@zrgtzjwh commented on GitHub (Mar 14, 2024):

@ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64.

Just download it to your Linux cluster, then run the following:

start the server in background

./ollama-linux-amd64 serve&

run a local model afterwards

./ollama-linux-amd64 run llama2

I wish someone can add this into their official instructions.

It works for me.

<!-- gh-comment-id:1996640855 --> @zrgtzjwh commented on GitHub (Mar 14, 2024): > @ReanFernandes The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64. > > Just download it to your Linux cluster, then run the following: > > # start the server in background > ./ollama-linux-amd64 serve& > > # run a local model afterwards > ./ollama-linux-amd64 run llama2 > > I wish someone can add this into their official instructions. It works for me.
Author
Owner

@FinlandBreakfast commented on GitHub (Mar 28, 2024):

The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64.

Just download it to your Linux cluster, then run the following:

start the server in background

./ollama-linux-amd64 serve&

run a local model afterwards

./ollama-linux-amd64 run llama2

I wish someone can add this into their official instructions.

Build from scratch instructions?

<!-- gh-comment-id:2024204028 --> @FinlandBreakfast commented on GitHub (Mar 28, 2024): > The download page has a list of assets, one of them is binary for Linux named ollama-linux-amd64. > > Just download it to your Linux cluster, then run the following: > > # start the server in background > ./ollama-linux-amd64 serve& > > # run a local model afterwards > ./ollama-linux-amd64 run llama2 > > I wish someone can add this into their official instructions. Build from scratch instructions?
Author
Owner

@bozo32 commented on GitHub (Apr 5, 2024):

had to
chmod +x ollama-*
to get it to work

<!-- gh-comment-id:2039783492 --> @bozo32 commented on GitHub (Apr 5, 2024): had to chmod +x ollama-* to get it to work
Author
Owner

@krz commented on GitHub (Apr 26, 2024):

I'm in a similar situation, trying to run ollama without sudo access. Downloading ollama and starting the server with ./ollama-linux-amd64 serve& worked fine, but when I try to run a model, I get this error:

time=2024-04-26T15:13:33.513+02:00 level=INFO source=gpu.go:126 msg="Nvidia GPU detected via cudart"
time=2024-04-26T15:13:33.513+02:00 level=INFO source=cpu_common.go:11 msg="CPU has AVX2"
⠙ time=2024-04-26T15:13:33.588+02:00 level=INFO source=gpu.go:202 msg="[cudart] CUDART CUDA Compute Capability detected: 6.0"
time=2024-04-26T15:13:33.618+02:00 level=INFO source=server.go:127 msg="offload to gpu" reallayers=33 layers=33 required="5222.5 MiB" used="5222.5 MiB" available="16020.1 MiB" kv="1024.0 MiB" fulloffload="164.0 MiB" partialoffload="193.0 MiB"
time=2024-04-26T15:13:33.618+02:00 level=INFO source=cpu_common.go:11 msg="CPU has AVX2"
time=2024-04-26T15:13:33.622+02:00 level=INFO source=server.go:264 msg="starting llama server" cmd="/tmp/ollama2278607108/runners/cuda_v11/ollama_llama_server --model /home/oll/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --port 45845"
time=2024-04-26T15:13:33.623+02:00 level=INFO source=server.go:264 msg="starting llama server" cmd="/tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server --model /home/oll/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --port 40273"
time=2024-04-26T15:13:33.624+02:00 level=ERROR source=server.go:285 msg="unable to load any llama server" error="error starting the external llama server: fork/exec /tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server: permission denied "
[GIN] 2024/04/26 - 15:13:33 | 500 | 1.176409787s | 127.0.0.1 | POST "/api/chat"
Error: error starting the external llama server: fork/exec /tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server: permission denied

<!-- gh-comment-id:2079380112 --> @krz commented on GitHub (Apr 26, 2024): I'm in a similar situation, trying to run ollama without sudo access. Downloading ollama and starting the server with `./ollama-linux-amd64 serve&` worked fine, but when I try to run a model, I get this error: > time=2024-04-26T15:13:33.513+02:00 level=INFO source=gpu.go:126 msg="Nvidia GPU detected via cudart" time=2024-04-26T15:13:33.513+02:00 level=INFO source=cpu_common.go:11 msg="CPU has AVX2" ⠙ time=2024-04-26T15:13:33.588+02:00 level=INFO source=gpu.go:202 msg="[cudart] CUDART CUDA Compute Capability detected: 6.0" time=2024-04-26T15:13:33.618+02:00 level=INFO source=server.go:127 msg="offload to gpu" reallayers=33 layers=33 required="5222.5 MiB" used="5222.5 MiB" available="16020.1 MiB" kv="1024.0 MiB" fulloffload="164.0 MiB" partialoffload="193.0 MiB" time=2024-04-26T15:13:33.618+02:00 level=INFO source=cpu_common.go:11 msg="CPU has AVX2" time=2024-04-26T15:13:33.622+02:00 level=INFO source=server.go:264 msg="starting llama server" cmd="/tmp/ollama2278607108/runners/cuda_v11/ollama_llama_server --model /home/oll/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --port 45845" time=2024-04-26T15:13:33.623+02:00 level=INFO source=server.go:264 msg="starting llama server" cmd="/tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server --model /home/oll/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --port 40273" time=2024-04-26T15:13:33.624+02:00 level=ERROR source=server.go:285 msg="unable to load any llama server" error="error starting the external llama server: fork/exec /tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server: permission denied " [GIN] 2024/04/26 - 15:13:33 | 500 | 1.176409787s | 127.0.0.1 | POST "/api/chat" Error: error starting the external llama server: fork/exec /tmp/ollama2278607108/runners/cpu_avx2/ollama_llama_server: permission denied
Author
Owner

@haozhuang0000 commented on GitHub (Jul 2, 2024):

I got this error by following above comments, anyone know how?

Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama3/manifests/8b": read tcp xxxxxx: read: connection reset by peer

<!-- gh-comment-id:2202550650 --> @haozhuang0000 commented on GitHub (Jul 2, 2024): I got this error by following above comments, anyone know how? Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama3/manifests/8b": read tcp xxxxxx: read: connection reset by peer
Author
Owner

@GonyRosenman commented on GitHub (Jul 15, 2024):

i used chatgpt to modify the install script (can anyone verify this solution???) -
#!/bin/sh
set -eu

status() { echo ">>> $" >&2; }
error() { echo "ERROR $
"; exit 1; }
warning() { echo "WARNING: $*"; }

TEMP_DIR=$(mktemp -d)
cleanup() { rm -rf $TEMP_DIR; }
trap cleanup EXIT

ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
*) error "Unsupported architecture: $ARCH" ;;
esac

VER_PARAM="${OLLAMA_VERSION:+?version=$OLLAMA_VERSION}"

status "Downloading ollama..."
curl --fail --show-error --location --progress-bar -o $TEMP_DIR/ollama "https://ollama.com/download/ollama-linux-${ARCH}${VER_PARAM}"

Ensure bin directory exists

mkdir -p ~/bin
status "Installing ollama to ~/bin..."
install -m755 $TEMP_DIR/ollama ~/bin/ollama

status 'Install complete. Run "~/bin/ollama" from the command line.'

<!-- gh-comment-id:2228480051 --> @GonyRosenman commented on GitHub (Jul 15, 2024): i used chatgpt to modify the install script (can anyone verify this solution???) - #!/bin/sh set -eu status() { echo ">>> $*" >&2; } error() { echo "ERROR $*"; exit 1; } warning() { echo "WARNING: $*"; } TEMP_DIR=$(mktemp -d) cleanup() { rm -rf $TEMP_DIR; } trap cleanup EXIT ARCH=$(uname -m) case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64|arm64) ARCH="arm64" ;; *) error "Unsupported architecture: $ARCH" ;; esac VER_PARAM="${OLLAMA_VERSION:+?version=$OLLAMA_VERSION}" status "Downloading ollama..." curl --fail --show-error --location --progress-bar -o $TEMP_DIR/ollama "https://ollama.com/download/ollama-linux-${ARCH}${VER_PARAM}" # Ensure bin directory exists mkdir -p ~/bin status "Installing ollama to ~/bin..." install -m755 $TEMP_DIR/ollama ~/bin/ollama status 'Install complete. Run "~/bin/ollama" from the command line.'
Author
Owner

@justin4ai commented on GitHub (Oct 3, 2024):

@chunhualiao Hello, thanks for your information!

But running your commands actually doesn't work for me - I tried it after I unzip .tgz:

./ollama-linux-amd64 serve&
[1] 15739
bash: ./ollama-linux-amd64: No such file or directory
[1]+  Exit 127      

My folder tree looks like,
image
.

Do you have any clue? If so, I'll be so glad if you let me know!

<!-- gh-comment-id:2391778255 --> @justin4ai commented on GitHub (Oct 3, 2024): @chunhualiao Hello, thanks for your information! But running your commands actually doesn't work for me - I tried it after I unzip .tgz: ``` ./ollama-linux-amd64 serve& [1] 15739 bash: ./ollama-linux-amd64: No such file or directory [1]+ Exit 127 ``` My folder tree looks like, ![image](https://github.com/user-attachments/assets/28522aa3-3d82-46fc-976e-9921c7ea9288) . Do you have any clue? If so, I'll be so glad if you let me know!
Author
Owner

@Haruki-Kny commented on GitHub (Oct 8, 2024):

@justin4ai
Hi, I also had the same problem.
I think you should execute ./bin/ollama serve&. It's because the name of the extracting directory might have changed from ollama-linux-amd64 to bin.
If it doesn't work, you should check the content of the bin.

<!-- gh-comment-id:2399617839 --> @Haruki-Kny commented on GitHub (Oct 8, 2024): @justin4ai Hi, I also had the same problem. I think you should execute `./bin/ollama serve&`. It's because the name of the extracting directory might have changed from `ollama-linux-amd64` to `bin`. If it doesn't work, you should check the content of the bin.
Author
Owner

@famura commented on GitHub (Feb 20, 2025):

Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve). Let me know if that helps!

Can you please say more about this? On this doc page I still read sudo before tar.

Let's assume I am under Linux, have no sudo permissions, and I just downloaded v0.5.10.tar.gz. How do I get to run ollama such that I can use it in a different process, e.g. from a python script via the ollama python package?

<!-- gh-comment-id:2672183889 --> @famura commented on GitHub (Feb 20, 2025): > Hi [@chunhualiao](https://github.com/chunhualiao), thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an `ollama` user. The [releases](https://github.com/jmorganca/ollama/releases) include pre-built binaries that will work without any sudo (e.g. just run `ollama serve`). Let me know if that helps! Can you please say more about this? On [this doc page](https://github.com/ollama/ollama/blob/main/docs/linux.md) I still read `sudo` before tar. Let's assume I am under Linux, have no sudo permissions, and I just downloaded v0.5.10.tar.gz. How do I get to run ollama such that I can use it in a different process, e.g. from a python script via the ollama python package?
Author
Owner

@wangjiawen2013 commented on GitHub (Mar 27, 2025):

Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve). Let me know if that helps!

Is there a binary for Centos linux server ? I only find binary for macos.

<!-- gh-comment-id:2756488366 --> @wangjiawen2013 commented on GitHub (Mar 27, 2025): > Hi [@chunhualiao](https://github.com/chunhualiao), thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an `ollama` user. The [releases](https://github.com/jmorganca/ollama/releases) include pre-built binaries that will work without any sudo (e.g. just run `ollama serve`). Let me know if that helps! Is there a binary for Centos linux server ? I only find binary for macos.
Author
Owner

@mobraine commented on GitHub (Jul 19, 2025):

Hi @chunhualiao, thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve). Let me know if that helps!

Can you please say more about this? On this doc page I still read sudo before tar.

Let's assume I am under Linux, have no sudo permissions, and I just downloaded v0.5.10.tar.gz. How do I get to run ollama such that I can use it in a different process, e.g. from a python script via the ollama python package?

If you have downloaded the tgz file, simply tar -xzvf v0.5.10.tar.gz this should extract and show you where the files are extracted. Like @justin4ai said, ollama is now living in the bin directory.

@justin4ai Hi, I also had the same problem. I think you should execute ./bin/ollama serve&. It's because the name of the extracting directory might have changed from ollama-linux-amd64 to bin. If it doesn't work, you should check the content of the bin.

<!-- gh-comment-id:3092620891 --> @mobraine commented on GitHub (Jul 19, 2025): > > Hi [@chunhualiao](https://github.com/chunhualiao), thanks for the issue. The install script does this because it needs to check for devices, drivers and set up an `ollama` user. The [releases](https://github.com/jmorganca/ollama/releases) include pre-built binaries that will work without any sudo (e.g. just run `ollama serve`). Let me know if that helps! > > Can you please say more about this? On [this doc page](https://github.com/ollama/ollama/blob/main/docs/linux.md) I still read `sudo` before tar. > > Let's assume I am under Linux, have no sudo permissions, and I just downloaded v0.5.10.tar.gz. How do I get to run ollama such that I can use it in a different process, e.g. from a python script via the ollama python package? If you have downloaded the tgz file, simply `tar -xzvf v0.5.10.tar.gz` this should extract and show you where the files are extracted. Like @justin4ai said, ollama is now living in the bin directory. > [@justin4ai](https://github.com/justin4ai) Hi, I also had the same problem. I think you should execute `./bin/ollama serve&`. It's because the name of the extracting directory might have changed from `ollama-linux-amd64` to `bin`. If it doesn't work, you should check the content of the bin.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26969