Skip to content

Instantly share code, notes, and snippets.

@jenaye
Last active December 2, 2024 10:16
Show Gist options
  • Save jenaye/c05a9a6e702311fa39f17777fd570ba5 to your computer and use it in GitHub Desktop.
Save jenaye/c05a9a6e702311fa39f17777fd570ba5 to your computer and use it in GitHub Desktop.
Install ollama + web gui (open-webui)
# install docker
```
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```
`sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`
```
sudo groupadd docker
sudo usermod -aG docker $USER
```
# install ollama
`curl -fsSL https://ollama.com/install.sh | sh`
# download the model
`ollama pull codellama:7b`
# if ollama server and interface must be on the same server, here is the docker command to run
`sudo docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://127.0.0.1:11434/api --network=host -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main`
# now go to `htp://<ip>:8080` then create your account, then select the model you wish to interact with
every model will be detected by API, just pull the model you want : https://ollama.com/library
@aamaanaa
Copy link

it does not find the models....

@bimalm
Copy link

bimalm commented Aug 4, 2024

Edit the file /etc/systemd/system/ollama.service. and add and below after existing Environment settings
Environment="OLLAMA_HOST=0.0.0.0"
and restart ollama service. It will detect models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment