Skip to content

Installing Ollama ​

After finishing this section, when you type ollama -v in the terminal, you will see a line with the version number.

Before You Start ​

  • Have read What Is Local Deployment, and know your system and graphics card
  • Can open a terminal: on Windows use PowerShell or Command Prompt; on Mac and Linux use the "Terminal"

Step 1: Download and Install ​

Windows and Mac: Go to ollama.com/download to download the installer.

  • Windows: Run the installer. The official documentation states that installation does not require administrator privileges and installs by default in your user directory; the installation itself requires at least 4 GB of space. After installation, Ollama runs in the background, and the ollama command can be used in Command Prompt and PowerShell.
  • Mac: Open the downloaded ollama.dmg and drag Ollama into the "Applications" folder.

Linux: Official one-command install:

sh
curl -fsSL https://ollama.com/install.sh | sh
  • The installer has finished running

Step 2: Verify the Installation ​

sh
ollama -v

You should see:

text
ollama version is 0.40.16

The version number depends on what you installed; when we wrote this course it was 0.40.16. If you see could not connect to a running Ollama instance, it means Ollama's background service is not running: on Windows and Mac, open the Ollama app; on Linux, run ollama serve.

Exercise: verify installationOnly recognizes commands from this lesson, won't actually run them

$ollama -v

ollama version is 0.40.16
  • ollama -v printed the version number

Step 3 (Optional): Put the Models on Another Drive ​

Model files are often several GB to tens of GB. Default locations per the official documentation:

SystemWhere models are stored
WindowsC:\Users\%username%\.ollama\models
macOS~/.ollama/models
Linux/usr/share/ollama/.ollama/models

If your C drive is running low on space, set the environment variable OLLAMA_MODELS to point to another directory, then restart Ollama. On Windows, search for "environment variables" in "Settings" (Windows 11) or "Control Panel" (Windows 10), and add it under your user account.

  • I know where models will be stored, and I have enough space

Checkpoint ​

  • Ollama is installed
  • ollama -v printed the version number
  • I know the default model storage location and can change OLLAMA_MODELS when needed

Didn't Work? ​

It says it cannot connect to a running Ollama. The background service is not running. On Windows and Mac, open the Ollama app; on Linux, run ollama serve.

On Windows 10, the progress bar shows as squares. The official documentation states that Ollama draws progress with Unicode characters, which some older fonts cannot display; switching to a different terminal font fixes it.

Next Section ​

Run DeepSeek-R1.

gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.