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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Back up Ollama by copying its entire model store—not an individual model name—while the service is stopped. With the standard Linux installation, that store is /usr/share/ollama/.ollama/models. If OLLAMA_MODELS is configured, use that directory instead, ensure the ollama service account can read and write it, and validate the copy before relying on it.

Where Ollama stores models on Linux

The standard Ollama Linux service installation stores downloaded models, manifests and blob data under /usr/share/ollama/.ollama/models. A model label such as llama3 is only an entry point into that store; the files required to load it are distributed among subdirectories and content-addressed blobs.

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

Back up the complete models directory. Copying one visible model name, one manifest, or only the largest files can leave an unusable backup because shared layers and metadata may be elsewhere in the store.

The location can be changed with the OLLAMA_MODELS environment variable. A custom location is useful when the VPS root disk is small or when you have a larger attached volume, but the service account must have read and write access to the replacement path.

#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
Installation or configuration Model directory to back up Permission requirement
Standard Linux service installation with no override /usr/share/ollama/.ollama/models The ollama service account must be able to read and write the directory.
Installation with OLLAMA_MODELS The path assigned to OLLAMA_MODELS The ollama service account must be able to read and write the custom filesystem path.

1. Confirm the active model directory

Do not assume the default path if the VPS has been customized. Inspect the systemd unit and every drop-in first:

systemctl cat ollama.service
systemctl show ollama --property=Environment

Look for an OLLAMA_MODELS assignment. If no assignment is present, use /usr/share/ollama/.ollama/models. If the value points to another directory, substitute that path in every backup, verification and restore command below.

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

Also confirm that the directory exists and identify its filesystem and available capacity:

sudo findmnt -T /usr/share/ollama/.ollama/models
sudo du -sh /usr/share/ollama/.ollama/models
sudo df -h /usr/share/ollama/.ollama/models

Replace the path in these commands when the environment variable shows a custom location. The destination must have enough free space for the complete store plus temporary space needed by your chosen copy method.

2. Choose and prepare the backup destination

A backup can go to another mounted VPS volume, a removable external SSD, or an encrypted off-site copy. A separate filesystem protects against a full root volume; a separate failure domain protects against losing the VPS and its local disks together.

  • Mount the destination before copying and verify it with findmnt.
  • Use a filesystem that supports the ownership, permissions, links, timestamps, extended attributes and ACLs you intend to preserve.
  • Keep the destination private. Do not publish the model directory through a public HTTP server.
  • Encrypt removable or off-site media, and keep encryption credentials separate from the backup itself.

Create a destination directory with root privileges. The example below uses /mnt/backup/ollama-models; replace it with the actual mounted location:

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.
sudo mkdir -p /mnt/backup/ollama-models

Record the VPS hostname, Ollama version, active model path, destination filesystem, available space and the UTC time of each backup. These details make a later restore less ambiguous, especially after changing the service configuration.

Rank #2
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 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

3. Stop Ollama before a filesystem-level copy

Stop the service so files are not changing while they are being copied. This is a consistency precaution: an active download, model import or running request could otherwise leave a destination with mismatched metadata and blob contents.

sudo systemctl stop ollama
sudo systemctl is-active ollama

The second command should report inactive. If it reports active, wait for shutdown or investigate the service status before starting the copy. Do not remove files from the live model directory to make room while the service is running.

4. Copy the complete model store

Recommended method: rsync

rsync can preserve ownership, modes, hard links, extended attributes, ACLs and timestamps when run as root. The trailing slash on the source copies the contents of models into the destination directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo rsync -aHAX --numeric-ids 
  /usr/share/ollama/.ollama/models/ 
  /mnt/backup/ollama-models/

For a customized installation, replace the source with the directory reported by OLLAMA_MODELS. The options mean archive mode, hard-link preservation, extended attributes, ACL preservation and numeric UID/GID preservation. Numeric IDs help retain ownership even if account names differ on another machine.

If the destination is a filesystem that cannot represent one of these metadata types, check its limitations before relying on the copy. A metadata-preserving copy is preferable to a plain recursive copy because the service expects the restored tree to have usable ownership and permissions.

Alternative method: a compressed archive

When rsync is unavailable, create an archive that includes extended attributes and ACLs:

sudo tar --xattrs --acls -czf /mnt/backup/ollama-models-$(date -u +%Y%m%dT%H%M%SZ).tar.gz 
  -C /usr/share/ollama/.ollama models

This command creates a timestamped archive containing the whole models directory. For a custom location, change the directory supplied to -C and the final directory name so the archive contains the actual model store. Keep the archive on a mounted destination with sufficient capacity; compression can require additional temporary space.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model) | External Solid State Drive, Compatible with Laptops & Tablets, Up to 2M Drop Protection, USB 3.2 Gen 2, USB-C to USB-A Cable
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.

These commands are operational choices rather than Ollama requirements. The essential requirements are a complete copy, preserved usable metadata, a protected destination and a validation step.

5. Verify the backup before restarting

A successful copy command does not prove that the destination is complete. Compare the source and destination sizes, then run a dry run to identify files that would still need synchronization:

sudo du -sh /usr/share/ollama/.ollama/models /mnt/backup/ollama-models
sudo rsync -aHAXn --delete --numeric-ids 
  /usr/share/ollama/.ollama/models/ 
  /mnt/backup/ollama-models/

The dry run should produce no transfer list when the destination matches the source. The --delete option appears only with -n here, so it reports what would be removed without deleting anything. Do not use --delete in a real command until you have confirmed that the destination is the correct mounted backup filesystem.

For a stronger content check, run a checksum comparison after the copy:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo rsync -aHAXnc --numeric-ids 
  /usr/share/ollama/.ollama/models/ 
  /mnt/backup/ollama-models/

The -c option makes rsync read file contents to compare checksums instead of relying mainly on size and modification time. This can take considerably longer on a large model collection, but it is useful before treating a new backup as your recovery copy.

For each backup, retain a small record containing:

  • the output of ollama version or ollama -v;
  • the active OLLAMA_MODELS value, or confirmation that the default is in use;
  • the backup timestamp and destination filesystem;
  • the source and destination sizes;
  • the available free space and the result of the dry-run or checksum pass.

6. Restart Ollama and test the live copy

Once the destination has passed verification, start the service and check that systemd considers it healthy:

sudo systemctl start ollama
sudo systemctl status ollama --no-pager
ollama list

ollama list should show the models that were installed before the backup. Send a small local inference request to a model you know is present. For example, use the normal Ollama command-line interaction with one of your installed model names and a short prompt, then confirm that it returns a response rather than attempting an unexpected download.

Rank #4
Sale
Samsung T7 Portable SSD 1TB Titan Gray, USB 3.2 Gen 2, Up to 1,050MB/s | Reliable External Solid State Drive Storage for Gaming, Students, Professionals (MU-PC1T0T/AM)
  • MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
  • SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
  • ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
  • ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
  • HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³

If startup fails, inspect the service log before changing files:

journalctl -u ollama --no-pager -e

Common causes include a wrong custom path, a destination that was not mounted, insufficient permissions for the ollama account, or a filesystem that is full. Correct the underlying issue, then restart and repeat both ollama list and the inference check.

Restoring Ollama models without downloading them again

A restore replaces the active model tree with a previously verified complete copy. Keep the current directory aside until the restored service has passed validation; deleting it first removes a useful fallback if the backup is incomplete or points to the wrong version.

  1. Stop Ollama and confirm that it is inactive:
    sudo systemctl stop ollama
    sudo systemctl is-active ollama
  2. Identify the active model path with systemctl cat ollama.service and systemctl show ollama --property=Environment.
  3. Move the current directory aside. For the default path, for example:
    sudo mv /usr/share/ollama/.ollama/models /usr/share/ollama/.ollama/models.before-restore
  4. Create the expected parent directory if necessary, then restore the complete backup into the path named by OLLAMA_MODELS. With an rsync backup:
    sudo mkdir -p /usr/share/ollama/.ollama/models
    sudo rsync -aHAX --numeric-ids /mnt/backup/ollama-models/ /usr/share/ollama/.ollama/models/
  5. Set ownership for the service account. With the standard installer, use:
    sudo chown -R ollama:ollama /usr/share/ollama/.ollama/models
    Use the actual custom path when applicable.
  6. Start Ollama and inspect its status:
    sudo systemctl start ollama
    sudo systemctl status ollama --no-pager
  7. Run ollama list and issue a small inference request against an installed model.
  8. Keep models.before-restore until the restored listing and inference succeed. Remove the old tree only after you have no further need for rollback and have confirmed that the backup is the copy you intended to use.

For a tar archive, extract it with its metadata preserved into the parent directory instead of creating an extra nested path. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo tar --xattrs --acls -xzf /mnt/backup/ollama-models-20261015T120000Z.tar.gz 
  -C /usr/share/ollama/.ollama

Use the actual archive filename and restore date. After extraction, verify that the final structure is .../.ollama/models, not .../.ollama/models/models.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Move Ollama models to a larger disk or external SSD

Moving the store is often safer than allowing large models to consume the VPS root volume. The process is a copy followed by an explicit service configuration change.

Prepare and copy to the mounted volume

  1. Create and mount the larger volume or attach the external SSD. Confirm the mount point with findmnt and check its free space.
  2. Stop Ollama:
    sudo systemctl stop ollama
  3. Create a destination directory and copy the existing store:
    sudo mkdir -p /mounted/path/ollama-models
    sudo rsync -aHAX --numeric-ids /usr/share/ollama/.ollama/models/ /mounted/path/ollama-models/
  4. Set ownership so the service account can use the new location:
    sudo chown -R ollama:ollama /mounted/path/ollama-models

Set OLLAMA_MODELS in a systemd drop-in

Use a drop-in rather than editing the vendor unit directly:

Best Value
Sale
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model | External Solid State Drive, IP65 Water & Dust Resistant, Up to 3M Drop Protection, 256-bit AES Encryption, USB-C 3.2 Gen 2
  • NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
  • IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
  • POCKET-SIZED – fits easily in pockets and small bags.
  • SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
  • 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.
sudo systemctl edit ollama.service

Add:

[Service]
Environment="OLLAMA_MODELS=/mounted/path/ollama-models"

Save the file, then reload systemd and restart Ollama:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl daemon-reload
sudo systemctl restart ollama

Confirm that systemd reports the intended environment and that Ollama sees the existing models:

systemctl show ollama --property=Environment
ollama list

Run a small inference request before removing the original directory. If the list is empty, stop the service and check the drop-in path, mount availability, directory ownership and whether the copy placed the files one directory too deep.

Permissions, mounts and failure recovery

The service starts but no models appear

  • Check whether OLLAMA_MODELS points somewhere different from the directory you restored.
  • Confirm that the mounted volume is present; a missing mount can expose an empty directory at the mount point.
  • Inspect ownership with ls -ld and restore ownership to ollama:ollama where appropriate.
  • Check that the backup contains the complete models tree rather than a parent directory with another nested models directory.

Ollama cannot read or write the custom path

Verify permissions on every parent directory, not only the final directory. The service account needs traversal permission on parents and read/write permission on the model directory. Review the journal for the exact path and permission error, correct ownership or modes, and restart the service.

The VPS runs out of space during backup

Check both source and destination filesystems with df -h. A compressed archive may require space for the archive while the original store remains in place. Use a mounted destination with adequate capacity, or copy directly with rsync instead of creating a local temporary archive.

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

A restore fails validation

Stop Ollama, keep the restored directory and the old directory separate, and review the journal. Recheck the archive extraction path, ownership, mount state and recorded Ollama version. If necessary, move the restored directory aside and return the pre-restore directory while you investigate.

Security and retention practices

Model files are not automatically harmless just because they are local. Apply least-privilege permissions, restrict shell and filesystem access, and avoid making the directory downloadable over the network. Encrypt removable and off-site copies, and store the decryption key or credentials separately so theft of the media does not reveal both the data and its protection.

Keep at least one copy on a different failure domain from the VPS. A mounted backup disk helps with a full or damaged root volume; an encrypted off-site copy helps when the entire VPS, host or local disk is lost. Rotate or retain copies according to how often models change, but do not delete the only known-good copy immediately after creating a newer one.

There is no universal backup-size or recovery-time figure for Ollama models: the required space and restore duration depend on the models installed, filesystem, storage throughput and network path. Measure the directory on your own VPS and record actual copy and restore times if you need an operational target.

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

Operational checklist

  • Discover the active directory and record the OLLAMA_MODELS setting.
  • Check source size, destination capacity and mount state.
  • Stop Ollama and verify that systemd reports it inactive.
  • Copy the entire model directory, including manifests, subdirectories and blobs.
  • Preserve ownership, modes, links, timestamps, extended attributes and ACLs where supported.
  • Run a dry-run or checksum comparison before trusting the destination.
  • Record the Ollama version, path, timestamp, filesystem and verification result.
  • Restart Ollama, run ollama list and complete a small inference request.
  • Protect the backup with least-privilege access and encryption for removable or off-site media.
  • For a restore, move the old directory aside and retain it until validation succeeds.

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.