[GH-ISSUE #6782] Windows Portable Mode #66312

Open
opened 2026-05-04 02:26:06 -05:00 by GiteaMirror · 17 comments
Owner

Originally created by @SmilerRyan on GitHub (Sep 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6782

I would like to see a Full Portable version of Ollama for Windows, not just having the binary files without running the setup.

My proposal is simply to have the same files as the installer version, and also include a portable.txt file to indicate that it is a portable install and to directly save Ollama settings, history, models etc into a data folder inside the portable build instead of AppData and the User Home folder.

For updates clicking the notification can just open the link to the zip file for manual installation/updates or automatically download and on click open in the default zip program.

Originally created by @SmilerRyan on GitHub (Sep 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6782 I would like to see a Full Portable version of Ollama for Windows, not just having the binary files without running the setup. My proposal is simply to have the same files as the installer version, and also include a portable.txt file to indicate that it is a portable install and to directly save Ollama settings, history, models etc into a data folder inside the portable build instead of AppData and the User Home folder. For updates clicking the notification can just open the link to the zip file for manual installation/updates or automatically download and on click open in the default zip program.
GiteaMirror added the feature request label 2026-05-04 02:26:06 -05:00
Author
Owner

@TangentFoxy commented on GitHub (Nov 1, 2024):

Wait, there's a way to get the binaries without the installer? How do I do that? The installer just fucked me over by choosing a full drive automatically to try to install to.

<!-- gh-comment-id:2451449177 --> @TangentFoxy commented on GitHub (Nov 1, 2024): Wait, there's a way to get the binaries without the installer? How do I do that? The installer just fucked me over by choosing a full drive automatically to try to install to.
Author
Owner

@SmilerRyan commented on GitHub (Nov 1, 2024):

I use a tool called Universal Extractor, in the backend it has many different tools for extracting all types of installers.

Though this issue I'm hoping they implement a zip download so these extractors are not needed and so it can actually be run in a portable manner.

<!-- gh-comment-id:2451501574 --> @SmilerRyan commented on GitHub (Nov 1, 2024): I use a tool called Universal Extractor, in the backend it has many different tools for extracting all types of installers. Though this issue I'm hoping they implement a zip download so these extractors are not needed and so it can actually be run in a portable manner.
Author
Owner

@smarthiesbs commented on GitHub (Nov 17, 2024):

I would also like to use Ollama "portable", i.e. make it available in a folder without installation.

The reason for this is that I have local admin rights at work (so I could install it normally), but the central IT doesn't like this and there is always the risk that they will remove unapproved programs without asking (to prevent evil "shadow IT"). From an IT security point of view, this is understandable. However, my job is also to advance our department technically, and I need an appropriate environment for testing.

So I'd prefer to bundle Ollama with OpenWebUI, so it's all 'self-contained' and all dependencies are fullfilled in that one folder.

My approach would be to copy the Ollama binaries (C:\Users[User]\AppData\Local\Programs\Ollama) from my private installation into such a folder and set all paths and environment variables with a Powershell startup script. For OpenWebUI I would use a portable Python installation. I realize that this makes updating more difficult, but I can live with that.

Does this work? Has anyone done this or something similar? Is there anything I need to take into account?

<!-- gh-comment-id:2481326003 --> @smarthiesbs commented on GitHub (Nov 17, 2024): I would also like to use Ollama "portable", i.e. make it available in a folder without installation. The reason for this is that I have local admin rights at work (so I could install it normally), but the central IT doesn't like this and there is always the risk that they will remove unapproved programs without asking (to prevent evil "shadow IT"). From an IT security point of view, this is understandable. However, my job is also to advance our department technically, and I need an appropriate environment for testing. So I'd prefer to bundle Ollama with OpenWebUI, so it's all 'self-contained' and all dependencies are fullfilled in that one folder. My approach would be to copy the Ollama binaries (C:\Users\[User]\AppData\Local\Programs\Ollama\) from my private installation into such a folder and set all paths and environment variables with a Powershell startup script. For OpenWebUI I would use a portable Python installation. I realize that this makes updating more difficult, but I can live with that. Does this work? Has anyone done this or something similar? Is there anything I need to take into account?
Author
Owner

@SmilerRyan commented on GitHub (Nov 17, 2024):

So I'd prefer to bundle Ollama with OpenWebUI, so it's all 'self-contained' and all dependencies are fullfilled in that one folder.

I've used portable python before, not specifically with OpenWebUI but it should work.

Has anyone done this or something similar? Is there anything I need to take into account?

Currently ollama with the extracted binaries work well, just make sure to always run it from this batch file:

@echo off
title Ollama Portable
set OLLAMA_ORIGINS=*
set OLLAMA_HOST=0.0.0.0
set userprofile=%cd%\data
set localappdata=%cd%\data\AppData\Local
cmd /k ollama.exe

Only downside currently is if there is an update it will download it and update over the "virtual" appdata, so you'll need to manually move the files over the original to apply the update, and manually delete the installation it puts into the registry to uninstall it.

I'm hoping a commit is pushed one day where i can set OLLAMA_UPDATECHECKER to false or similar, or even better an overall portable version that doesent use the registry.

<!-- gh-comment-id:2481332825 --> @SmilerRyan commented on GitHub (Nov 17, 2024): > So I'd prefer to bundle Ollama with OpenWebUI, so it's all 'self-contained' and all dependencies are fullfilled in that one folder. I've used portable python before, not specifically with OpenWebUI but it should work. > Has anyone done this or something similar? Is there anything I need to take into account? Currently ollama with the extracted binaries work well, just make sure to always run it from this batch file: ``` @echo off title Ollama Portable set OLLAMA_ORIGINS=* set OLLAMA_HOST=0.0.0.0 set userprofile=%cd%\data set localappdata=%cd%\data\AppData\Local cmd /k ollama.exe ``` Only downside currently is if there is an update it will download it and update over the "virtual" appdata, so you'll need to manually move the files over the original to apply the update, and manually delete the installation it puts into the registry to uninstall it. I'm hoping a commit is pushed one day where i can set `OLLAMA_UPDATECHECKER` to false or similar, or even better an overall portable version that doesent use the registry.
Author
Owner

@smarthiesbs commented on GitHub (Nov 17, 2024):

Thanks a lot for your quick response and the additional details. Then I'll give it a try :)

I'm certainly hoping for an official portable version of ollama as well, which would then require less configuration work and enable a better update process...

<!-- gh-comment-id:2481355536 --> @smarthiesbs commented on GitHub (Nov 17, 2024): Thanks a lot for your quick response and the additional details. Then I'll give it a try :) I'm certainly hoping for an official portable version of ollama as well, which would then require less configuration work and enable a better update process...
Author
Owner

@feO2x commented on GitHub (Nov 25, 2024):

I'd like to second that. Ollama in portable mode would help all those Windows users which have to work on computers locked down by their IT department.

<!-- gh-comment-id:2496911028 --> @feO2x commented on GitHub (Nov 25, 2024): I'd like to second that. Ollama in portable mode would help all those Windows users which have to work on computers locked down by their IT department.
Author
Owner

@laurenceanthony commented on GitHub (Dec 27, 2024):

I would like a portable version, too.

<!-- gh-comment-id:2564043949 --> @laurenceanthony commented on GitHub (Dec 27, 2024): I would like a portable version, too.
Author
Owner

@Christoph1987 commented on GitHub (Jan 23, 2025):

In addition to the portable version, it would be good if you could simply specify in the setup that Ollama is installed in Program Files for all users and not in the user directory. All data should also be saved in Program Files or ProgramData and not in the user directory.

<!-- gh-comment-id:2608602168 --> @Christoph1987 commented on GitHub (Jan 23, 2025): In addition to the portable version, it would be good if you could simply specify in the setup that Ollama is installed in Program Files for all users and not in the user directory. All data should also be saved in Program Files or ProgramData and not in the user directory.
Author
Owner

@BobFreqMob commented on GitHub (Jan 23, 2025):

Hi there, my request is almost the same like the others here: i would like an option to choose the installation folder when installing in windows

<!-- gh-comment-id:2609063026 --> @BobFreqMob commented on GitHub (Jan 23, 2025): Hi there, my request is almost the same like the others here: i would like an option to choose the installation folder when installing in windows
Author
Owner

@ZhianLin commented on GitHub (Jan 29, 2025):

use in one file,perhaps llamafile,usage https://developer.aliyun.com/article/1434175
或许可以使用 llamafile,使用方法 https://developer.aliyun.com/article/1434175

<!-- gh-comment-id:2621077934 --> @ZhianLin commented on GitHub (Jan 29, 2025): use in one file,perhaps [llamafile](https://github.com/Mozilla-Ocho/llamafile),usage https://developer.aliyun.com/article/1434175 或许可以使用 [llamafile](https://github.com/Mozilla-Ocho/llamafile),使用方法 https://developer.aliyun.com/article/1434175
Author
Owner

@dexterhuh commented on GitHub (Feb 11, 2025):

I would love to have a portable version on Windows, so I can package Ollama with my Python script together for my end user, and then my end user can use Ollama directly without installing/configuring it. Has anyone figured out a way for the portable mode on Windows?

<!-- gh-comment-id:2650025358 --> @dexterhuh commented on GitHub (Feb 11, 2025): I would love to have a portable version on Windows, so I can package Ollama with my Python script together for my end user, and then my end user can use Ollama directly without installing/configuring it. Has anyone figured out a way for the portable mode on Windows?
Author
Owner

@SmilerRyan commented on GitHub (Feb 11, 2025):

For using it portably using a batch file yes, but disabling the updater so it doesn't attempt to reinstall itself no.

<!-- gh-comment-id:2651291371 --> @SmilerRyan commented on GitHub (Feb 11, 2025): For using it portably using a batch file yes, but disabling the updater so it doesn't attempt to reinstall itself no.
Author
Owner

@dexterhuh commented on GitHub (Feb 11, 2025):

For using it portably using a batch file yes, but disabling the updater so it doesn't attempt to reinstall itself no.

Thank you for the information. I'm a beginner. Do you know if there is a guide page for doing that?

<!-- gh-comment-id:2651330092 --> @dexterhuh commented on GitHub (Feb 11, 2025): > For using it portably using a batch file yes, but disabling the updater so it doesn't attempt to reinstall itself no. Thank you for the information. I'm a beginner. Do you know if there is a guide page for doing that?
Author
Owner

@foss-lover34 commented on GitHub (Feb 20, 2025):

hey @SmilerRyan you sound like an advanced user, could you help me setting up a portable version of ollama please, i didnt quite get it

<!-- gh-comment-id:2672218952 --> @foss-lover34 commented on GitHub (Feb 20, 2025): hey @SmilerRyan you sound like an advanced user, could you help me setting up a portable version of ollama please, i didnt quite get it
Author
Owner

@SmilerRyan commented on GitHub (Feb 27, 2025):

hey @SmilerRyan you sound like an advanced user, could you help me setting up a portable version of ollama please, i didnt quite get it

Sure, basically:

  1. Download the Ollama Files.
    Install the full version using the exe, copy the files it installs, then uninstall it.
    Using this makes sure it has all the files it needs (the zips don't have everything required).

I've just tried myself with the zip method, the files that are missing are:

  • "ollama app.exe"
  • "app.ico"
  • "ollama_welcome.ps1"

The .ico and .ps1 file aren't nessacary but nowdays it seems Ollama can't run without the app file.

  1. Move your Ollama files into a folder of your choice.
    You can put your files wherever you want, with write permissions.
    eg. C:\OllamaPortable\ or C:\Users\Ryan\Documents\OllamaPortable\

  2. Create the Ollama Portable Launcher.
    Open Notepad, and write the following code (copy and paste).
    Save this file as OllamaPortable.bat into your OllamaPortable folder.

@echo off
title Ollama Portable
set OLLAMA_ORIGINS=*
set OLLAMA_HOST=0.0.0.0
set userprofile=%cd%\data
set localappdata=%cd%\data\AppData\Local
cmd /k ollama.exe
  1. Open Ollama and download/run/test models etc.
    Every time you want to run ollama, you can now run the OllamaPortable.bat file.

It sets the variables to make the thing run portably, as well as allows the Ollama server to listen on any IP and accept any connection for websites.

  1. Usage for other UIs and tools etc.

Assuming you already have done an ollama pull or ollama run before in this instance (the same as regular ollama to get a model), you can serve it by running ollama serve for use in other applications/uis etc.

You can also edit or make a second batch file called OllamaPortableServe.bat if you want to make a quick serve version, just add this line to the end of the file:

cmd /k ollama.exe serve
  1. Updating etc

As for updating, if it asks and goes through, it'll go into the AppData folder in your portable folder. Once it's done you can move all of the files out into the main OllamaPortable folder, replacing the existing ones, and then restart Ollama. If you don't do this and just re-run it, then you'll always be using the same old version since it's not running the latest one.

After moving it, to completely clean up the installation, go to your installed programs list (appwiz.cpl) and select to "uninstall" Ollama, it will fail and say the file does not exist. Click yes to remove it from there, and you're done.

<!-- gh-comment-id:2689142621 --> @SmilerRyan commented on GitHub (Feb 27, 2025): > hey [@SmilerRyan](https://github.com/SmilerRyan) you sound like an advanced user, could you help me setting up a portable version of ollama please, i didnt quite get it Sure, basically: 1. Download the Ollama Files. Install the full version using the exe, copy the files it installs, then uninstall it. Using this makes sure it has all the files it needs (the zips don't have everything required). I've just tried myself with the zip method, the files that are missing are: - "ollama app.exe" - "app.ico" - "ollama_welcome.ps1" The .ico and .ps1 file aren't nessacary but nowdays it seems Ollama can't run without the app file. 2. Move your Ollama files into a folder of your choice. You can put your files wherever you want, with write permissions. eg. C:\OllamaPortable\ or C:\Users\Ryan\Documents\OllamaPortable\ 3. Create the Ollama Portable Launcher. Open Notepad, and write the following code (copy and paste). Save this file as ``OllamaPortable.bat`` into your OllamaPortable folder. ```bat @echo off title Ollama Portable set OLLAMA_ORIGINS=* set OLLAMA_HOST=0.0.0.0 set userprofile=%cd%\data set localappdata=%cd%\data\AppData\Local cmd /k ollama.exe ``` 4. Open Ollama and download/run/test models etc. Every time you want to run ollama, you can now run the ``OllamaPortable.bat`` file. It sets the variables to make the thing run portably, as well as allows the Ollama server to listen on any IP and accept any connection for websites. 5. Usage for other UIs and tools etc. Assuming you already have done an ``ollama pull`` or ``ollama run`` before in this instance (the same as regular ollama to get a model), you can serve it by running ``ollama serve`` for use in other applications/uis etc. You can also edit or make a second batch file called ``OllamaPortableServe.bat`` if you want to make a quick serve version, just add this line to the end of the file: ```bat cmd /k ollama.exe serve ``` 7. Updating etc As for updating, if it asks and goes through, it'll go into the AppData folder in your portable folder. Once it's done you can move all of the files out into the main OllamaPortable folder, replacing the existing ones, and then restart Ollama. If you don't do this and just re-run it, then you'll always be using the same old version since it's not running the latest one. After moving it, to completely clean up the installation, go to your installed programs list (appwiz.cpl) and select to "uninstall" Ollama, it will fail and say the file does not exist. Click yes to remove it from there, and you're done.
Author
Owner

@SmilerRyan commented on GitHub (Mar 5, 2025):

Quick update for "Ollama Portable" you can actually disable the update checker by deleting/renaming the "ollama app.exe" file, and to make the thing work you can just call the "ollama server" command yourself, which is actually all the app does in the background, along with an update checker and tray icon.

  1. Download and unpack Ollama.
  • Use both zipped files and extract them
  • Unpack the setup.exe and delete the uninstaller.
  1. Delete, rename or move the "ollama app.exe" file.
  • I renamed it to "ollama app.exe.disabled" to keep it simple.
  1. Create your "Ollama Portable Launcher" batch file.
@echo off
title Ollama Portable
set OLLAMA_ORIGINS=*
set OLLAMA_HOST=0.0.0.0
set userprofile=%cd%\data
start /b "" ollama.exe serve
timeout 1 > nul
cmd /k ollama.exe
  1. Launch ollama from this file, and enjoy it.
<!-- gh-comment-id:2700174912 --> @SmilerRyan commented on GitHub (Mar 5, 2025): Quick update for "Ollama Portable" you can actually disable the update checker by deleting/renaming the "ollama app.exe" file, and to make the thing work you can just call the "ollama server" command yourself, which is actually all the app does in the background, along with an update checker and tray icon. 1. Download and unpack Ollama. - Use both zipped files and extract them - Unpack the setup.exe and delete the uninstaller. 2. Delete, rename or move the "ollama app.exe" file. - I renamed it to "ollama app.exe.disabled" to keep it simple. 3. Create your "Ollama Portable Launcher" batch file. ``` @echo off title Ollama Portable set OLLAMA_ORIGINS=* set OLLAMA_HOST=0.0.0.0 set userprofile=%cd%\data start /b "" ollama.exe serve timeout 1 > nul cmd /k ollama.exe ``` 4. Launch ollama from this file, and enjoy it.
Author
Owner

@hellomynameisnone commented on GitHub (Dec 10, 2025):

Self contained portable batch

1- Copy/paste and name it : "OllamaPortableGUI.bat"

@echo off
title Ollama Portable

:: Stable base path (folder where the .bat is located)
set "BASE=%~dp0"
set "PORTABLE=%BASE%data"


:: Create portable structure if it doesn't exist
if not exist "%PORTABLE%\AppData\Local" mkdir "%PORTABLE%\AppData\Local"
if not exist "%PORTABLE%\AppData\Roaming" mkdir "%PORTABLE%\AppData\Roaming"

:: Redirect users
set "LOCALAPPDATA=%PORTABLE%\AppData\Local"
set "APPDATA=%PORTABLE%\AppData\Roaming"
set "USERPROFILE=%PORTABLE%"

echo Starting Ollama server...

:: Prevent double instance
tasklist | find /i "ollama.exe" >nul
if not errorlevel 1 (
    echo Ollama server already running.
) else (
    start "" "%PORTABLE%\AppData\Local\Programs\Ollama\ollama.exe" serve
)

echo Starting GUI...
start "" "%PORTABLE%\AppData\Local\Programs\Ollama\ollama app.exe"

2 - Create this folder structure:

OllamaPortable/
├─ data/
│  ├─ .ollama/
│  │    └─ models/
│  ├─ AppData/
│  │  ├─ Local/
│  │  │    └─ Programs
│  │  │          └─ Ollama
│  │  │                 └─ lib
│  │  └─ Roaming/
│  └─ Desktop/
└─ OllamaPortableGUI.bat

3 - Download the latest ollama-windows-amd64.zip release

4 - Open zip file and extract "ollama.exe" and "lib" folder in:
X:...\OllamaPortable\data\AppData\Local\Programs\Ollama

NOTE: "ollama app.exe" is not present in the .zip version, to be able to use the Ollama builtin chat, you should install it with the "OllamaSetup.exe" and move/copy the folder structure

<!-- gh-comment-id:3638808932 --> @hellomynameisnone commented on GitHub (Dec 10, 2025): Self contained portable batch 1- Copy/paste and name it : "OllamaPortableGUI.bat" ``` @echo off title Ollama Portable :: Stable base path (folder where the .bat is located) set "BASE=%~dp0" set "PORTABLE=%BASE%data" :: Create portable structure if it doesn't exist if not exist "%PORTABLE%\AppData\Local" mkdir "%PORTABLE%\AppData\Local" if not exist "%PORTABLE%\AppData\Roaming" mkdir "%PORTABLE%\AppData\Roaming" :: Redirect users set "LOCALAPPDATA=%PORTABLE%\AppData\Local" set "APPDATA=%PORTABLE%\AppData\Roaming" set "USERPROFILE=%PORTABLE%" echo Starting Ollama server... :: Prevent double instance tasklist | find /i "ollama.exe" >nul if not errorlevel 1 ( echo Ollama server already running. ) else ( start "" "%PORTABLE%\AppData\Local\Programs\Ollama\ollama.exe" serve ) echo Starting GUI... start "" "%PORTABLE%\AppData\Local\Programs\Ollama\ollama app.exe" ``` 2 - Create this folder structure: ``` OllamaPortable/ ├─ data/ │ ├─ .ollama/ │ │ └─ models/ │ ├─ AppData/ │ │ ├─ Local/ │ │ │ └─ Programs │ │ │ └─ Ollama │ │ │ └─ lib │ │ └─ Roaming/ │ └─ Desktop/ └─ OllamaPortableGUI.bat ``` 3 - Download the latest _ollama-windows-amd64.zip_ [release]( https://github.com/ollama/ollama/releases ) 4 - Open zip file and extract "ollama.exe" and "lib" folder in: X:\...\OllamaPortable\data\AppData\Local\Programs\Ollama NOTE: "ollama app.exe" is not present in the .zip version, to be able to use the Ollama builtin chat, you should install it with the "OllamaSetup.exe" and move/copy the folder structure
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#66312