how to run ollama in google colab #6963

Closed
opened 2025-11-12 13:51:08 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @mayunqing1230 on GitHub (May 5, 2025).

Due to the limitations of Google Colab, it seems that I cannot install and run Ollama directly in Colab. I need to run Ollama in Colab and use ngrok or other software to connect anythinglllm on my computer to Ollama on Colab. How can I do this?

Originally created by @mayunqing1230 on GitHub (May 5, 2025). Due to the limitations of Google Colab, it seems that I cannot install and run Ollama directly in Colab. I need to run Ollama in Colab and use ngrok or other software to connect anythinglllm on my computer to Ollama on Colab. How can I do this?
GiteaMirror added the question label 2025-11-12 13:51:08 -06:00
Author
Owner

@JasonHonKL commented on GitHub (May 5, 2025):

Umm if you are a Pro member of colab you can do it but totally not recommend.

  1. In terminal install go with
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go
  1. Run the following command
curl -fsSL https://ollama.com/install.sh | sh
  1. You should be able to use Ollama in that terminal now

NOTE: you have to do it every time when you refresh the page.

@JasonHonKL commented on GitHub (May 5, 2025): Umm if you are a Pro member of colab you can do it but totally not recommend. 1. In terminal install go with ```shell sudo add-apt-repository ppa:longsleep/golang-backports sudo apt update sudo apt install golang-go ``` 2. Run the following command ``` curl -fsSL https://ollama.com/install.sh | sh ``` 3. You should be able to use Ollama in that terminal now NOTE: you have to do it every time when you refresh the page.
Author
Owner

@mayunqing1230 commented on GitHub (May 5, 2025):

Umm if you are a Pro member of colab you can do it but totally not recommend.

1. In terminal install go with

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go

2. Run the following command
curl -fsSL https://ollama.com/install.sh | sh
3. You should be able to use Ollama in that terminal now

NOTE: you have to do it every time when you refresh the page.

Unfortunately, I am a free version user. I have tried many methods on the Internet, but all failed.

@mayunqing1230 commented on GitHub (May 5, 2025): > Umm if you are a Pro member of colab you can do it but totally not recommend. > > 1. In terminal install go with > > > sudo add-apt-repository ppa:longsleep/golang-backports > sudo apt update > sudo apt install golang-go > > 2. Run the following command > > > ``` > curl -fsSL https://ollama.com/install.sh | sh > ``` > > 3. You should be able to use Ollama in that terminal now > > > NOTE: you have to do it every time when you refresh the page. Unfortunately, I am a free version user. I have tried many methods on the Internet, but all failed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama-ollama#6963