Pages
  • Homepage
  • Queztaz/Tech Inventory
  • Emacs/Emacs With BiDirectional Google Calendar Sync
  • Emacs/Setting up Mu4e and Multiple Gmail Accounts
  • Emacs/EWW Hacks
  • Linux/Creating an Offline Debian Mirror Repository
  • Linux/Migrate Wiki.js to Another Server
  • Linux/Adding Bitwarden to the Pinephone Pro
  • Pinebook Pro/Custom Kernel
  • Pinebook Pro/Keyboard Firmware Update
  • Pinebook Pro/Netbsd Installation
  • Pinebook Pro/Setting Up Zram
  • Pinebook Troubleshooting/Pro Common Issues
  • Pinebook Pro/Use NVME as Root
  • Pinebook Pro/Write to SPI Flash
  • Qemu/Chroot Into a Different Architecture
  • Qemu/Choot Into an Img File
  • Qemu/Mount Virtual Images
  • Qemu/Windows Xp Fix Smb Not Working
  • Qemu/Windows Xp Installation
  • Misc/Finding the Default Wireless Password to TG1672G Routers
  • Misc/Running Ollama Portably
  • Windows/Cloning a Bios Boot Drive to Disimilar Hardware with UEFI
  • Windows/Automatic CHKDSK Scans Using Powershell & Email Alerts
  • Windows/Creating a Decent Portable Terminal
  • Windows/Merging HyperV Snapshots With Powershell
  • Windows/Simulating Bad Blocks on NTFS Filesystems
  • Windows/Creating and Viewing a Storport on Windows Server
  • Mikrotik/Creating a Client to Site VPN With
  • Mikrotik/Securing Router With Firewall
  • Mikrotik Setup Dynamically Changing IP With No-IP Api
Homepage
  • Homepage
  • Queztaz/Tech Inventory
  • Emacs/Emacs With BiDirectional Google Calendar Sync
  • Emacs/Setting up Mu4e and Multiple Gmail Accounts
  • Emacs/EWW Hacks
  • Linux/Creating an Offline Debian Mirror Repository
  • Linux/Migrate Wiki.js to Another Server
  • Linux/Adding Bitwarden to the Pinephone Pro
  • Pinebook Pro/Custom Kernel
  • Pinebook Pro/Keyboard Firmware Update
  • Pinebook Pro/Netbsd Installation
  • Pinebook Pro/Setting Up Zram
  • Pinebook Troubleshooting/Pro Common Issues
  • Pinebook Pro/Use NVME as Root
  • Pinebook Pro/Write to SPI Flash
  • Qemu/Chroot Into a Different Architecture
  • Qemu/Choot Into an Img File
  • Qemu/Mount Virtual Images
  • Qemu/Windows Xp Fix Smb Not Working
  • Qemu/Windows Xp Installation
  • Misc/Finding the Default Wireless Password to TG1672G Routers
  • Misc/Running Ollama Portably
  • Windows/Cloning a Bios Boot Drive to Disimilar Hardware with UEFI
  • Windows/Automatic CHKDSK Scans Using Powershell & Email Alerts
  • Windows/Creating a Decent Portable Terminal
  • Windows/Merging HyperV Snapshots With Powershell
  • Windows/Simulating Bad Blocks on NTFS Filesystems
  • Windows/Creating and Viewing a Storport on Windows Server
  • Mikrotik/Creating a Client to Site VPN With
  • Mikrotik/Securing Router With Firewall
  • Mikrotik Setup Dynamically Changing IP With No-IP Api

Misc/Running Ollama Portably

Table of content
  • Creating the portable installation
    • Install Ollama Normally
  • Creating a batch script
  • Downloading LLMs
  • Copying the folder
  • Disabling automatic updates
  • Uninstalling Ollama from host

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%, 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.

PREVRANDOMNEXT