Running Ollama Portably
Preamble
Directions for creating a portable installation of Ollama. The LLM files will be stored in the same folder as the binaries and sourced automatically
Creating the portable installation
Install Ollama Normally
Install Ollama using this link. The default installation folder will be %localappdata%Programs\Ollama
https://ollama.com/download
Creating a batch script
Create a file named "START_OLLAMA.bat" in %localappdata%\Programs\Ollama
@echo off
title Ollama Portable
set OLLAMA_ORIGINS=*
set OLLAMA_HOST=127.0.0.1
set userprofile=%cd%\data
set localappdata=%cd%\data\AppData\Local
start cmd /k "%cd%\ollama.exe" serve
start cmd /k "%cd%\ollama.exe" -v
Downloading LLMs
Run the batch script. The first terminal window will be a live running
server. The second pop-up terminal can be used to run ollama.exe
. Download your
LLM using this command
ollama.exe run gemma3:12b
Replace the Gemma model with any other model available in https://ollama.com/library
Copying the folder
Copy this entire folder to anywhere you'd like. I have it on an external drive. This application will run portably after this.
Disabling automatic updates
I believe the "ollama app.exe"
handles application updates. This causes issues
with the portable installation, as some of the files don't get updated in the
same folder as the installer and have to be manually copied over.
I don't intend on updating this. Rename "ollama app.exe"
to "ollama app.exe.1"
to prevent updates.
Uninstalling Ollama from host
In %localappdata%Programs\Ollama, run the uninstaller to remove it from the host system. The only thing you'll be left with is the portable installation that was copied earlier.