October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Change the Ollama Model Path on Linux

Set Ollama’s model directory on Linux with a persistent systemd override, migrate existing blobs and manifests, and troubleshoot permissions, mounts, and conflicting manual servers.
Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the supported OLLAMA_MODELS environment variable to an absolute directory, then restart the Ollama systemd service. On a standard Linux installation, the service normally uses /usr/share/ollama/.ollama/models; changing the variable does not move models that are already there, so you must copy the existing blobs and manifests directories or download the models again.

What changes when you set OLLAMA_MODELS?

OLLAMA_MODELS tells Ollama where to store and find model data. The path must be absolute, such as /mnt/large-drive/ollama-models. It is the supported setting identified in Ollama’s official FAQ for changing the model directory.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On Linux installed with Ollama’s standard installer and managed by systemd, the documented default is /usr/share/ollama/.ollama/models. A user who starts ollama serve manually can instead see a model directory under that user’s home directory, because a manually launched process inherits the launching user’s environment. Those are different service contexts and can point at different model stores.

Changing the variable changes the directory Ollama checks from that point forward. It does not copy existing data. Until you migrate the existing files or pull each model again, ollama list can appear empty after the restart.

#1 Best Overall
SSK Portable SSD 250GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 250GB external ssd often appears as around 232GB on Windows. MacOS can show full 250 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
  • 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Solid state drives S.M.A.R.T. health diagnostics​ and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
  • USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
  • Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity

Before you move anything

  • Confirm that the destination filesystem is mounted at the path you intend to use. A mounted external or secondary drive supplies capacity, but it still has to be available whenever the Ollama service starts.
  • Use an absolute destination path. Relative paths do not provide a reliable system-service configuration.
  • Check which process you actually use. The instructions below apply to a native Linux installation managed by systemd. Docker, distribution packages, and custom launchers may require setting the variable in their own container or service environment.
  • Plan for the service account. The standard installer runs the service as the ollama user, which needs read and write access to the destination.

Set the model path permanently with systemd

For a systemd installation, Ollama’s FAQ says environment variables should be set with systemctl. A drop-in override is persistent across reboots and package restarts.

1. Create a systemd override

  1. Open the service override editor: sudo systemctl edit ollama.service.
  2. In the editor, add this section exactly, replacing the path with the mounted directory you chose:
    [Service]
    Environment="OLLAMA_MODELS=/mnt/large-drive/ollama-models"
  3. Save the file and exit the editor. The override is stored separately from the vendor unit, so a normal package update does not require editing the original service file again.

2. Create the destination and assign ownership

Create the directory before restarting Ollama, then grant the service account ownership:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo mkdir -p /mnt/large-drive/ollama-models
sudo chown -R ollama:ollama /mnt/large-drive/ollama-models

The ownership command matters even when the directory is on another internal disk or an external SSD. If the service cannot read and write the directory, pulls and model startup can fail with permission errors.

3. Reload systemd and restart Ollama

sudo systemctl daemon-reload
sudo systemctl restart ollama

daemon-reload makes systemd read the new drop-in; the restart launches Ollama with the updated environment. Do not leave a second manually started ollama serve process running while testing. Two processes can listen in different contexts and make a correct service setting look ineffective.

Move models that are already downloaded

The new path starts empty unless you migrate the existing store. Ollama model data is organized beneath the model directory’s blobs and manifests directories. Preserve both directories and their contents.

Option A: copy first, then verify

Copying lets you keep the original until the new location works. Stop the service so files are not changing during the copy:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Western Digital 4TB My Passport SSD External Portable Solid State Drive, Grey, Up to 1,050 MB/s, USB 3.2 Gen-2 and USB-C Compatible (USB-A for older systems) – WDBAGF0040BGY-WESN
  • Blazing fast NVMe technology with speeds of up to 1050MB/s and write speeds of up to 1000MB/s | Based on read speed unless otherwise stated. As used for transfer rate, 1 MB/s = one million bytes per second. Based on internal testing; performance may vary depending upon host device, usage conditions, drive capacity, and other factors..date transfer rate:1050.0 megabits_per_second.Compatibility : Windows 10+ operating systems, macOS 11+.
  • Password enabled 256-bit AES hardware encryption
  • Shock and vibration resistant. Drop resistant up to 6.5ft (1.98m)
  • Cross Compatible USB 3.2 Gen-2 and USB-C (USB-A for older systems)
  • 5-year manufacturer's limited warranty
sudo systemctl stop ollama
sudo mkdir -p /mnt/large-drive/ollama-models
sudo cp -a /usr/share/ollama/.ollama/models/blobs /mnt/large-drive/ollama-models/
sudo cp -a /usr/share/ollama/.ollama/models/manifests /mnt/large-drive/ollama-models/
sudo chown -R ollama:ollama /mnt/large-drive/ollama-models

The source path above is the standard systemd location. If your installation or previous configuration used another directory, substitute that directory while keeping the blobs and manifests layout intact. The -a option preserves file attributes during the copy; the final ownership command ensures the service account can use the result.

Option B: move the directories

If you have a verified backup or need to reclaim the old disk immediately, move the two directories instead of copying them. Stop Ollama first, create the destination, move blobs and manifests into it, and run the ownership command again. A move across filesystems can take as long as a copy, so do not interrupt it or remove the source until the operation completes.

Option C: pull models again

For a small model collection, you can leave the old files in place and pull each required model after the service is configured. This is simpler but uses bandwidth and repeats the download. Existing models will not appear merely because the variable changed.

Verify that the service uses the new directory

  1. Check the service state: sudo systemctl status ollama. Confirm that the service is running without an immediate exit or permission failure.
  2. List models through the service: ollama list. Migrated models should appear after the restart.
  3. If the destination is empty, pull a small known model to test writing: ollama pull <model-name>. Replace the placeholder with a model name you intend to use.
  4. Inspect service logs if the list is empty or the pull fails: journalctl -u ollama. Look for path, permission, mount, or startup errors.
  5. Confirm that the destination contains the expected blobs and manifests directories and that they are owned by ollama:ollama.

Run client commands against the same server that you configured. A shell command can connect to a manually launched process while systemd is running a separate process, so checking only the client output can be misleading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why Ollama still uses ~/.ollama/models

A manually started server is still running

The most common explanation is a second, unmanaged ollama serve. A manually launched server inherits the login user’s environment and may use a home-directory store, while the systemd service uses the drop-in environment. Stop the manual process, keep one server process, then check sudo systemctl status ollama and journalctl -u ollama again.

The override was edited in the wrong place

Use sudo systemctl edit ollama.service rather than editing a vendor unit under system directories. After saving the override, run sudo systemctl daemon-reload and restart the service. Without the reload and restart, the running process continues with its old environment.

Rank #3
SSK Portable SSD 2TB External Solid State Drives, up to 1050MB/s USB C SSD External Hard Drive USB 3.2 Gen2 for iPhone 15/Pro, Windows, Mac, Android Phones and Tablets
  • Capacity Reminder: Display capacity of 2TB SSD often appears as around 1863GB on Windows. MacOS typically shows full 2TB. This display capacity reduction of 7% to 10% from SSD actual capacity is from algorithms differences in which 1GB is interpreted as 1024MB on Windows and 1000MB on SSDs
  • 1000 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1000MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Master solid state drives health with S.M.A.R.T. monitoring. TRIM technology ensures consistent write speeds and extends the lifespan of the portable SSD
  • USB-C & USB-A Cable: Both USB-C and USB-A cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers between computers, smartphones, tablets and Phones
  • Always Fast: No slowdowns during large file transfers. When transferring files smaller than 500GB, this external ssd remains steady 10Gbps with SLC caching (25%of the current available capacity is allocated for high speed cache)

The service and your shell are different users

Your interactive shell may show a home-directory path because it belongs to your login account. The standard systemd service runs as ollama, so its model path and permissions are independent of files in your home directory. Configure the context that actually serves requests.

You changed the path but did not migrate data

A new directory has no knowledge of files left in the old directory. Copy or move both blobs and manifests, or pull the models again, then repeat ollama list.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Permissions and filesystem problems

Permission denied during a pull

Make sure the destination exists and is writable by the service account:

sudo mkdir -p /mnt/large-drive/ollama-models
sudo chown -R ollama:ollama /mnt/large-drive/ollama-models

Also check parent directories. The ollama user needs permission to traverse the path, not only to write the final directory. A filesystem mounted with restrictive ownership or access options can still block the service after chown; the journal normally identifies the failing path.

The drive is not mounted after reboot

If the mount is unavailable when systemd starts Ollama, the configured directory may resolve to an empty directory on the root filesystem, or the service may fail to start. Configure the drive to mount reliably before relying on the service, and verify the mount is present before restarting Ollama. Do not delete the old model store until you have confirmed the intended filesystem is mounted and populated.

The destination has insufficient capacity

Moving models to a larger drive addresses capacity only when Ollama can consistently access that drive. Keep the mount path stable, leave room for future pulls, and monitor the filesystem separately from Ollama. An external SSD can provide space, but it does not configure OLLAMA_MODELS, preserve service ownership, or guarantee availability at boot.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Corsair EX400U 1TB USB4 Portable External Type-C SSD – 3.2 Gen2 2x2 Connections, Up to 40Gbps, Plug and Play, MagSafe, Includes Cable – Windows PC, iOS Mac – Gray
  • External SSD with USB4 Connection: Leverage the incredibly high bandwidth of USB4 to move large files for tasks like video and photo editing in seconds.
  • Lightning-Fast Speeds: Delivers data speeds of up to 4,000MB/sec sequential read and up to 3,500MB/sec sequential write.
  • Compatible with USB Type-C: Connect via USB Type-C, Thunderbolt 4 and higher for wide compatibility*. *Performance varies by capacity. Maximum performance requires USB4 or higher connection.
  • Compact Form Factor: Small form factor allows you to take the EX400U with you for high-performance storage on the go.
  • Simple Plug-and-Play Setup: Easy to use right out of the box with a single connection for power and data on PC or Mac.

Systemd override versus a one-shell export

You can set the variable temporarily in a shell, but that does not configure the system service. The choice depends on which process should use the path.

Approach Persistence Service identity When it is useful Migration consequence
systemctl edit ollama.service Persists for the systemd service across restarts and reboots System ollama account Native Linux installation operated as a background service Copy or move the existing store for that service, or re-pull models
One-shell export OLLAMA_MODELS=... Only the current shell and processes launched from it Your login user Testing or running a user-managed ollama serve User-run server sees the user-owned model directory; systemd does not automatically use it

If your goal is a dependable server that starts with Linux, use the systemd override. Use a shell export only when you intentionally run Ollama under your login account and understand that it is a separate process context.

Installation types outside the standard systemd setup

The documented procedure targets a native Linux installation managed by systemd. Docker containers, distribution packages, and custom launchers may define their own environment and storage settings. Set OLLAMA_MODELS in the container definition, package service, or launcher that starts your Ollama process, then apply that environment’s restart procedure. Do not assume a systemd drop-in affects a container or a separately packaged service.

The same practical requirements still apply: use an absolute directory, ensure the process can read and write it, make the storage available when the process starts, and migrate the old blobs and manifests data or re-pull the models.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A safe end-to-end checklist

  1. Choose a mounted filesystem with enough capacity and a stable path.
  2. Stop any manually launched ollama serve process so only the intended server remains.
  3. Create the destination directory.
  4. Copy or move the existing blobs and manifests directories, or decide to re-pull models.
  5. Set ownership to ollama:ollama for the standard systemd installation.
  6. Run sudo systemctl edit ollama.service and add Environment="OLLAMA_MODELS=/absolute/path" beneath [Service].
  7. Run sudo systemctl daemon-reload, then sudo systemctl restart ollama.
  8. Check sudo systemctl status ollama, run ollama list, and inspect journalctl -u ollama if anything is missing.
  9. Only remove the old model directory after the new location has served a model successfully.

Bottom line

For a standard Linux systemd installation, the reliable method is a systemd drop-in containing OLLAMA_MODELS, followed by a daemon reload and service restart. The destination must be writable by the ollama account, and existing model data must be copied, moved, or downloaded again. If Ollama appears to ignore the setting, eliminate any second manually started server before changing the configuration further.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.