[GH-ISSUE #2551] Can we change where the models are stored in windows #1495

Closed
opened 2026-04-12 11:24:08 -05:00 by GiteaMirror · 37 comments
Owner

Originally created by @Gyro0o on GitHub (Feb 16, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2551

As far as I know the models are automatically downloaded to C:/Users/username/.ollama
But can we change the directory to another one due to storage issues?

Originally created by @Gyro0o on GitHub (Feb 16, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2551 As far as I know the models are automatically downloaded to C:/Users/username/.ollama But can we change the directory to another one due to storage issues?
Author
Owner

@MartynKeigher commented on GitHub (Feb 16, 2024):

You are correct and 'Yes' you can move them anywhere you like, via the OLLAMA_MODELS environment variable.

Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored

<!-- gh-comment-id:1949340394 --> @MartynKeigher commented on GitHub (Feb 16, 2024): You are correct and 'Yes' you can move them anywhere you like, via the `OLLAMA_MODELS` environment variable. Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored
Author
Owner

@fixtse commented on GitHub (Feb 16, 2024):

To create an environment variable on Windows you can follow these instructions:

Open Windows Settings.
Go to System.
Select About
Select Advanced System Settings.
Go to the Advanced tab.
Select Environment Variables....
Click on New...
And create a variable called OLLAMA_MODELS pointing to where you want to store the models

<!-- gh-comment-id:1949354640 --> @fixtse commented on GitHub (Feb 16, 2024): To create an environment variable on Windows you can follow these instructions: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models
Author
Owner

@APISeeker commented on GitHub (Feb 16, 2024):

Thanks I will try it out later.

<!-- gh-comment-id:1949477096 --> @APISeeker commented on GitHub (Feb 16, 2024): Thanks I will try it out later.
Author
Owner

@Gyro0o commented on GitHub (Feb 17, 2024):

You are correct and 'Yes' you can move them anywhere you like, via the OLLAMA_MODELS environment variable.

Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored

Understood
Thanks

<!-- gh-comment-id:1949515524 --> @Gyro0o commented on GitHub (Feb 17, 2024): > You are correct and 'Yes' you can move them anywhere you like, via the `OLLAMA_MODELS` environment variable. > > Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored Understood Thanks
Author
Owner

@Gyro0o commented on GitHub (Feb 17, 2024):

To create an environment variable on Windows you can follow these instructions:

Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models

Worked perfectly
Thank u

<!-- gh-comment-id:1949515928 --> @Gyro0o commented on GitHub (Feb 17, 2024): > To create an environment variable on Windows you can follow these instructions: > > Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models Worked perfectly Thank u
Author
Owner

@lafe commented on GitHub (Feb 17, 2024):

For whatever reason the environment variable did not work (even though, I can access it through PowerShell and it contains the correct folder path). My workaround was to create a symbolic link between the original models folder and the new location.

  1. Make sure ollama does not run.

  2. Move the Models folder from the user profile (C:\Users<User>.ollama\models) to the new location

  3. Create the symlink using the mklink command (if you want to use PowerShell, you have to use the New-Item Cmdlet with the SymbolicLink item type):

    mklink /D C:\Users\<User>\.ollama\models E:\AI\Ollama\Models
    
    • the /D ensures that a directory symlink is created.

Afterwards, it worked as before but the model files were located on the other disk.

<!-- gh-comment-id:1950262127 --> @lafe commented on GitHub (Feb 17, 2024): For whatever reason the environment variable did not work (even though, I can access it through PowerShell and it contains the correct folder path). My workaround was to create a symbolic link between the original models folder and the new location. 1. Make sure ollama does not run. 2. Move the Models folder from the user profile (C:\Users\<User>\.ollama\models) to the new location 3. Create the symlink using the [`mklink`](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink) command (if you want to use PowerShell, you have to use the [`New-Item`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.4) Cmdlet with the [`SymbolicLink` item type](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.4#example-7-create-a-symbolic-link-to-a-file-or-folder)): ```bash mklink /D C:\Users\<User>\.ollama\models E:\AI\Ollama\Models ``` - the `/D` ensures that a directory symlink is created. Afterwards, it worked as before but the model files were located on the other disk.
Author
Owner

@roocell commented on GitHub (Feb 18, 2024):

OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama?
i assume it would just pick up the new path when we run "ollama run llama2"

<!-- gh-comment-id:1950956172 --> @roocell commented on GitHub (Feb 18, 2024): OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama? i assume it would just pick up the new path when we run "ollama run llama2"
Author
Owner

@lafe commented on GitHub (Feb 18, 2024):

OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama? i assume it would just pick up the new path when we run "ollama run llama2"

Normally, you have to at least reopen the "command line" process, so that the environment variables are filled (maybe restarting ollama is sufficient). If you use PowerShell, you can use $env:OLLAMA_MODELS to check if the environment variable is set. If you use the Windows command prompt ("cmd"), you can use set to get a list of all environment variables.

<!-- gh-comment-id:1951097256 --> @lafe commented on GitHub (Feb 18, 2024): > OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama? i assume it would just pick up the new path when we run "ollama run llama2" Normally, you have to at least reopen the "command line" process, so that the environment variables are filled (maybe restarting ollama is sufficient). If you use PowerShell, you can use `$env:OLLAMA_MODELS` to check if the environment variable is set. If you use the Windows command prompt ("cmd"), you can use `set` to get a list of all environment variables.
Author
Owner

@ninjanimus commented on GitHub (Feb 18, 2024):

For those the custom path is not considered even after adding OLLAMA_MODELS environment variable and restarting the Terminal. Try restarting the OS once, then it is working. Might be the environment variables are stored in memory of the running Ollama process.

<!-- gh-comment-id:1951183969 --> @ninjanimus commented on GitHub (Feb 18, 2024): For those the custom path is not considered even after adding OLLAMA_MODELS environment variable and restarting the Terminal. Try restarting the OS once, then it is working. Might be the environment variables are stored in memory of the running Ollama process.
Author
Owner

@uocnb commented on GitHub (Feb 27, 2024):

I found that the Ollama app.exe is running in the background caused the new env var not update. You can quit it by right click on the Ollama icon on the system tray.

<!-- gh-comment-id:1965741452 --> @uocnb commented on GitHub (Feb 27, 2024): I found that the `Ollama app.exe` is running in the background caused the new env var not update. You can quit it by right click on the Ollama icon on the system tray.
Author
Owner

@JuninhoFreitas commented on GitHub (Apr 5, 2024):

I just started the installer in cmd with the following directive:

$ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY
<!-- gh-comment-id:2040564145 --> @JuninhoFreitas commented on GitHub (Apr 5, 2024): I just started the installer in cmd with the following directive: ``` $ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY ```
Author
Owner

@phpgit commented on GitHub (Apr 6, 2024):

I just started the installer in cmd with the following directive:

$ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

What a life saver! It works great, thanks for sharing!

<!-- gh-comment-id:2041035343 --> @phpgit commented on GitHub (Apr 6, 2024): > I just started the installer in cmd with the following directive: > > ``` > $ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY > ``` What a life saver! It works great, thanks for sharing!
Author
Owner

@arfans22 commented on GitHub (May 26, 2024):

OLLAMA_MODELS

worked really well at my first try!

<!-- gh-comment-id:2132071404 --> @arfans22 commented on GitHub (May 26, 2024): > OLLAMA_MODELS worked really well at my first try!
Author
Owner

@zombodotcom commented on GitHub (Jun 29, 2024):

tried this, and also the .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

it still downloads them to the C drive.
Tried moving the models and making the OLLAMA_MODELS Variable does not solve the issue of putting the blobs into the new directory, still tries to download them and doesnt register that they are there.

It does download to the new directory though. which is a plus

<!-- gh-comment-id:2198366862 --> @zombodotcom commented on GitHub (Jun 29, 2024): tried this, and also the .\OllamaSetup.exe /DIR=D:\MYDIRECTORY it still downloads them to the C drive. Tried moving the models and making the OLLAMA_MODELS Variable does not solve the issue of putting the blobs into the new directory, still tries to download them and doesnt register that they are there. It does download to the new directory though. which is a plus
Author
Owner

@arfans22 commented on GitHub (Jun 30, 2024):

tried this, and also the .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

it still downloads them to the C drive.
Tried moving the models and making the OLLAMA_MODELS Variable does not solve the issue of putting the blobs into the new directory, still tries to download them and doesnt register that they are there.

It does download to the new directory though. which is a plus

You have to make anothee variable named OLLAMA_ORIGIN and make the value just . (Dot)

<!-- gh-comment-id:2198430456 --> @arfans22 commented on GitHub (Jun 30, 2024): > tried this, and also the .\OllamaSetup.exe /DIR=D:\MYDIRECTORY > > it still downloads them to the C drive. > Tried moving the models and making the OLLAMA_MODELS Variable does not solve the issue of putting the blobs into the new directory, still tries to download them and doesnt register that they are there. > > It does download to the new directory though. which is a plus You have to make anothee variable named OLLAMA_ORIGIN and make the value just . (Dot)
Author
Owner

@zombodotcom commented on GitHub (Jun 30, 2024):

still making me redownload the 38gb model

<!-- gh-comment-id:2198609192 --> @zombodotcom commented on GitHub (Jun 30, 2024): still making me redownload the 38gb model
Author
Owner

@Kazakuba commented on GitHub (Jul 6, 2024):

Close all ollama tasks
Move whole models folder
Env variable needs to be added for user not as system variable or in path
Or try; mklink /D C:\Users<User>.ollama\models E:\New\Model\Location (for link to work you must first move folder from C)

<!-- gh-comment-id:2211584985 --> @Kazakuba commented on GitHub (Jul 6, 2024): Close all ollama tasks Move whole models folder Env variable needs to be added for user not as system variable or in path Or try; mklink /D C:\Users\<User>\.ollama\models E:\New\Model\Location (for link to work you must first move folder from C)
Author
Owner

@zombodotcom commented on GitHub (Jul 6, 2024):

Added to both before posting

<!-- gh-comment-id:2211585699 --> @zombodotcom commented on GitHub (Jul 6, 2024): Added to both before posting
Author
Owner

@gary0318 commented on GitHub (Jul 8, 2024):

Nothing was working for me. So, I killed Ollama app.exe and from there on I can not start ollama server. The server log is empty and the main log says server error. I've reinstalled ollama, rebooted the computer checked my environment variables... nothing is working. When it gives me the error it leaves Ollama app.exe running and I have to kill it again..

time=2024-07-08T03:30:58.766-04:00 level=WARN source=server.go:157 msg="server crash 10 - exit code 1 - respawning"
time=2024-07-08T03:30:59.589-04:00 level=INFO source=server.go:135 msg="starting server..."
time=2024-07-08T03:30:59.603-04:00 level=INFO source=server.go:121 msg="started ollama server with pid 11848"
time=2024-07-08T03:30:59.603-04:00 level=INFO source=server.go:123 msg="ollama server logs C:\Users\gary0\AppData\Local\Ollama\server.log"

server log: empty

<!-- gh-comment-id:2213227639 --> @gary0318 commented on GitHub (Jul 8, 2024): Nothing was working for me. So, I killed Ollama app.exe and from there on I can not start ollama server. The server log is empty and the main log says server error. I've reinstalled ollama, rebooted the computer checked my environment variables... nothing is working. When it gives me the error it leaves Ollama app.exe running and I have to kill it again.. time=2024-07-08T03:30:58.766-04:00 level=WARN source=server.go:157 msg="server crash 10 - exit code 1 - respawning" time=2024-07-08T03:30:59.589-04:00 level=INFO source=server.go:135 msg="starting server..." time=2024-07-08T03:30:59.603-04:00 level=INFO source=server.go:121 msg="started ollama server with pid 11848" time=2024-07-08T03:30:59.603-04:00 level=INFO source=server.go:123 msg="ollama server logs C:\\Users\\gary0\\AppData\\Local\\Ollama\\server.log" server log: empty
Author
Owner

@amirali-mi10 commented on GitHub (Aug 31, 2024):

if you guys get confused, let me explain step by step:

1-first of all uninstall ollama (if you already installed)

2-then follow this:
Open Windows Settings.
Go to System.
Select About
Select Advanced System Settings.
Go to the Advanced tab.
Select Environment Variables....
Click on New...
And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models)

3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file)

4-then on file explorer write cmd to open cmd on that path

5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY

6-after installation everything should works well and both ollama and models will save same drive you defined for it

<!-- gh-comment-id:2322623879 --> @amirali-mi10 commented on GitHub (Aug 31, 2024): if you guys get confused, let me explain step by step: 1-first of all uninstall ollama (if you already installed) 2-then follow this: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models) 3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file) 4-then on file explorer write cmd to open cmd on that path 5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY 6-after installation everything should works well and both ollama and models will save same drive you defined for it
Author
Owner

@Luojz commented on GitHub (Sep 11, 2024):

I just started the installer in cmd with the following directive:我刚刚在命令提示符中使用以下指令启动了安装程序:

$ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

A thumbs-up from China:"牛 B"

<!-- gh-comment-id:2342697039 --> @Luojz commented on GitHub (Sep 11, 2024): > I just started the installer in cmd with the following directive:我刚刚在命令提示符中使用以下指令启动了安装程序: > > ``` > $ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY > ``` A thumbs-up from China:"牛 B"
Author
Owner

@simpleetech commented on GitHub (Oct 11, 2024):

if you guys get confused, let me explain step by step:

1-first of all uninstall ollama (if you already installed)

2-then follow this: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models)

3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file)

4-then on file explorer write cmd to open cmd on that path

5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY

6-after installation everything should works well and both ollama and models will save same drive you defined for it

I'm not sure if it was just me, but it worked when I set the environment variable as a "User Variable" not a "System Variable"

<!-- gh-comment-id:2407009080 --> @simpleetech commented on GitHub (Oct 11, 2024): > if you guys get confused, let me explain step by step: > > 1-first of all uninstall ollama (if you already installed) > > 2-then follow this: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models) > > 3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file) > > 4-then on file explorer write cmd to open cmd on that path > > 5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY > > 6-after installation everything should works well and both ollama and models will save same drive you defined for it I'm not sure if it was just me, but it worked when I set the environment variable as a "User Variable" not a "System Variable"
Author
Owner

@zalito12 commented on GitHub (Oct 11, 2024):

OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama? i assume it would just pick up the new path when we run "ollama run llama2"

Normally, you have to at least reopen the "command line" process, so that the environment variables are filled (maybe restarting ollama is sufficient). If you use PowerShell, you can use $env:OLLAMA_MODELS to check if the environment variable is set. If you use the Windows command prompt ("cmd"), you can use set to get a list of all environment variables.

I can cornfirm you must restart Ollama, opening a new cmd is not enough.
Also, to see a var on cmd you can use echo, as echo %OLLAMA_MODELS%

<!-- gh-comment-id:2408235972 --> @zalito12 commented on GitHub (Oct 11, 2024): > > OLLAMA_MODELS env variable also didn't work for me - do we have to reboot or reinstall ollama? i assume it would just pick up the new path when we run "ollama run llama2" > > Normally, you have to at least reopen the "command line" process, so that the environment variables are filled (maybe restarting ollama is sufficient). If you use PowerShell, you can use `$env:OLLAMA_MODELS` to check if the environment variable is set. If you use the Windows command prompt ("cmd"), you can use `set` to get a list of all environment variables. I can cornfirm you must restart Ollama, opening a new cmd is not enough. Also, to see a var on cmd you can use echo, as ``echo %OLLAMA_MODELS%``
Author
Owner

@angusgee commented on GitHub (Nov 4, 2024):

I just started the installer in cmd with the following directive:

$ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

This is the one thank you for sharing 🔥🔥🔥

<!-- gh-comment-id:2455480598 --> @angusgee commented on GitHub (Nov 4, 2024): > I just started the installer in cmd with the following directive: > > ``` > $ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY > ``` This is the one thank you for sharing 🔥🔥🔥
Author
Owner

@mumangguo commented on GitHub (Dec 12, 2024):

nice

<!-- gh-comment-id:2539247311 --> @mumangguo commented on GitHub (Dec 12, 2024): nice
Author
Owner

@AdityaAdaki21 commented on GitHub (Dec 17, 2024):

I just started the installer in cmd with the following directive:

$ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY

What a life saver! It works great, thanks for sharing!

THANK YOU!!!!

<!-- gh-comment-id:2547769434 --> @AdityaAdaki21 commented on GitHub (Dec 17, 2024): > > I just started the installer in cmd with the following directive: > > ``` > > $ .\OllamaSetup.exe /DIR=D:\MYDIRECTORY > > ``` > > What a life saver! It works great, thanks for sharing! THANK YOU!!!!
Author
Owner

@jiriehrlich commented on GitHub (Dec 21, 2024):

Uninstall Ollama
Create System Variable OLLAMA_MODELS
Run OllamaSetup.exe /DIR=:\Ollama

<!-- gh-comment-id:2558180302 --> @jiriehrlich commented on GitHub (Dec 21, 2024): Uninstall Ollama Create System Variable OLLAMA_MODELS Run OllamaSetup.exe /DIR=<your drive>:\Ollama
Author
Owner

@omesh845 commented on GitHub (Dec 26, 2024):

Uninstall Ollama Create System Variable OLLAMA_MODELS Run OllamaSetup.exe /DIR=:\Ollama

thanks man!! it worked!!!

<!-- gh-comment-id:2562174986 --> @omesh845 commented on GitHub (Dec 26, 2024): > Uninstall Ollama Create System Variable OLLAMA_MODELS Run OllamaSetup.exe /DIR=:\Ollama thanks man!! it worked!!!
Author
Owner

@codeisnotcode commented on GitHub (Jan 5, 2025):

if you guys get confused, let me explain step by step:
1-first of all uninstall ollama (if you already installed)
2-then follow this: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models)
3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file)
4-then on file explorer write cmd to open cmd on that path
5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY
6-after installation everything should works well and both ollama and models will save same drive you defined for it

I'm not sure if it was just me, but it worked when I set the environment variable as a "User Variable" not a "System Variable"


I did the above and it did not work until I realized it is important for the original id_ed25519 and id_ed25519.pub key files to be retained in order to be able to see the moved Ollama Models. If you moved these with the models, when you reinstall ollama, it will create new a new set of keys (these two files) in C:\users<username>.ollama and then the previously loaded models can't be read by Ollama. The solution is to copy these two files from your moved model subdirectory back into C:\users<username>.ollama, overwriting the newly created keys.

<!-- gh-comment-id:2571525169 --> @codeisnotcode commented on GitHub (Jan 5, 2025): > > if you guys get confused, let me explain step by step: > > 1-first of all uninstall ollama (if you already installed) > > 2-then follow this: Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models(set path for store models) > > 3-after adjusting that then open the path that you downloaded OllamaSetup.exe (setup file) > > 4-then on file explorer write cmd to open cmd on that path > > 5-on cmd write--> OllamaSetup.exe /DIR=D:\MYDIRECTORY > > 6-after installation everything should works well and both ollama and models will save same drive you defined for it > > I'm not sure if it was just me, but it worked when I set the environment variable as a "User Variable" not a "System Variable" --- I did the above and it did not work until I realized it is important for the original id_ed25519 and id_ed25519.pub key files to be retained in order to be able to see the moved Ollama Models. If you moved these with the models, when you reinstall ollama, it will create new a new set of keys (these two files) in C:\users\<username>\.ollama and then the previously loaded models can't be read by Ollama. The solution is to copy these two files from your moved model subdirectory back into C:\users\<username>\.ollama, overwriting the newly created keys.
Author
Owner

@manotawi commented on GitHub (Jan 27, 2025):

All my AI apps and models are installed in a ssd so I can move them with me. So to preserve that, here was my method:
1- Move the ollama installation where desired, example F:\AI\OLLAMA
2- Inside the ollama installation folder create a folder for the models, example F:\AI\OLLAMA\MODELS
3- create a bat file and add the following to it:
SET OLLAMA_MODELS=%~dp0MODELS
start "" "ollama app.exe"

and tada, with that you have a portable version of ollama, that does not care about the drive or folder it is installed in

<!-- gh-comment-id:2616049702 --> @manotawi commented on GitHub (Jan 27, 2025): All my AI apps and models are installed in a ssd so I can move them with me. So to preserve that, here was my method: 1- Move the ollama installation where desired, example F:\AI\OLLAMA 2- Inside the ollama installation folder create a folder for the models, example F:\AI\OLLAMA\MODELS 3- create a bat file and add the following to it: SET OLLAMA_MODELS=%~dp0MODELS start "" "ollama app.exe" and tada, with that you have a portable version of ollama, that does not care about the drive or folder it is installed in
Author
Owner

@JTMarsh556 commented on GitHub (Jan 30, 2025):

Am I reading this correctly, you cannot move all of the existing models you have? You need a fresh install?

You can't just set the variable and then copy the models in the new path?

<!-- gh-comment-id:2625348506 --> @JTMarsh556 commented on GitHub (Jan 30, 2025): Am I reading this correctly, you cannot move all of the existing models you have? You need a fresh install? You can't just set the variable and then copy the models in the new path?
Author
Owner

@pratyush0898 commented on GitHub (Feb 2, 2025):

thanks you, but more you can do is:

  • Move ollama: (folder) C:\Users\ADMIN\AppData\Local\Programs\Ollama to /path/to/Ollama
  • Change env variable:
    • press Win + R
    • type systempropertiesadvanced & perss enter
    • Go to Environment variables
    • Under User variables Doble-click (open) PATH (enviorment variable)
    • Locate C:\Users\ADMIN\AppData\Local\Programs\Ollama & change it to `/path/to/Ollama/

here, you go, now your whole OLLAMA is in different location/drive you'd like

<!-- gh-comment-id:2629369155 --> @pratyush0898 commented on GitHub (Feb 2, 2025): thanks you, but more you can do is: - **Move ollama**: (folder) C:\Users\ADMIN\AppData\Local\Programs\Ollama to /path/to/Ollama - **Change env variable**: - press `Win + R` - type `systempropertiesadvanced` & perss enter - Go to Environment variables - Under `User variables` Doble-click (open) PATH (enviorment variable) - Locate `C:\Users\ADMIN\AppData\Local\Programs\Ollama` & change it to `/path/to/Ollama/ here, you go, now your whole OLLAMA is in different location/drive you'd like
Author
Owner

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

For those the custom path is not considered even after adding OLLAMA_MODELS environment variable and restarting the Terminal. Try restarting the OS once, then it is working. Might be the environment variables are stored in memory of the running Ollama process.

This worked for me. Thanks.

<!-- gh-comment-id:2699982614 --> @ChanduTadanki commented on GitHub (Mar 5, 2025): > For those the custom path is not considered even after adding OLLAMA_MODELS environment variable and restarting the Terminal. Try restarting the OS once, then it is working. Might be the environment variables are stored in memory of the running Ollama process. This worked for me. Thanks.
Author
Owner

@buffos commented on GitHub (Mar 22, 2025):

It depends if ollama was installed as system wide or just for the user.
You have two options when you create the Env variables in windows. System and User. Start with the user env, which will probably work and not a system env variable.

<!-- gh-comment-id:2745234023 --> @buffos commented on GitHub (Mar 22, 2025): It depends if ollama was installed as system wide or just for the user. You have two options when you create the Env variables in windows. System and User. Start with the user env, which will probably work and not a system env variable.
Author
Owner

@nikolatesla20 commented on GitHub (Jan 11, 2026):

To create an environment variable on Windows you can follow these instructions:

Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models

Doesn't work

<!-- gh-comment-id:3734634572 --> @nikolatesla20 commented on GitHub (Jan 11, 2026): > To create an environment variable on Windows you can follow these instructions: > > Open Windows Settings. Go to System. Select About Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Click on New... And create a variable called OLLAMA_MODELS pointing to where you want to store the models Doesn't work
Author
Owner

@nityam1101 commented on GitHub (Jan 13, 2026):

You are correct and 'Yes' you can move them anywhere you like, via the OLLAMA_MODELS environment variable.

Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored

Updated Link: https://github.com/ollama/ollama/blob/main/docs/faq.mdx#where-are-models-stored

<!-- gh-comment-id:3742119820 --> @nityam1101 commented on GitHub (Jan 13, 2026): > You are correct and 'Yes' you can move them anywhere you like, via the `OLLAMA_MODELS` environment variable. > > Docs: https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored Updated Link: https://github.com/ollama/ollama/blob/main/docs/faq.mdx#where-are-models-stored
Author
Owner

@fkdp06 commented on GitHub (Mar 31, 2026):

From now you can change your models location from the settings:

Image
<!-- gh-comment-id:4165420731 --> @fkdp06 commented on GitHub (Mar 31, 2026): From now you can change your models location from the settings: <img width="1182" height="839" alt="Image" src="https://github.com/user-attachments/assets/48679757-058a-4567-9580-7181ec88b9fc" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1495