Using Ollama through Docker

Moving Models to External SSD on macOS

To move Ollama models to an external SSD when using Docker:

  1. Stop the Ollama container:
    docker stop ollama
    
  2. Create a directory on your external SSD:
    mkdir /Volumes/YourSSD/ollama-models
    
  3. Update the Docker run command to mount the external SSD location:
    docker run -d \
      -v /Volumes/YourSSD/ollama-models:/root/.ollama \
      -p 11434:11434 \
      --name ollama \
      ollama/ollama
    

If you already have models and want to move them:

  1. Copy existing models from the Docker volume to your SSD:
    docker cp ollama:/root/.ollama/. /Volumes/YourSSD/ollama-models
    
  2. Remove the old Docker volume:
    docker volume rm ollama
    
  3. Start Ollama with the new mount point as shown above.

#Development #Docker #AI #LLMs