This guide will walk you through the process of installing, configuring, and using Ollama on Windows. Follow the steps carefully to ensure a smooth setup.
- A Windows computer.
- Internet connection for downloading and pulling models.
- Basic familiarity with using the command line.
-
Download Ollama
Visit the Ollama GitHub page to download the installer for Windows. -
Install Ollama Run the downloaded installer and follow the on-screen instructions to complete the installation process.
- Open a terminal window (e.g., Command Prompt or PowerShell).
- Run the following command to check if Ollama is installed correctly:
ollama
- If installed successfully, you will see a list of available commands displayed.
- If the command is not recognized, ensure that Ollama is added to your system's PATH or try reinstalling.
-
Start the Ollama server by running:
ollama serve
- If the server starts successfully, it will bind to
127.0.0.1:11434
.
- If the server starts successfully, it will bind to
-
Troubleshooting the Port Error:
If you encounter the following error:Error: listen tcp 127.0.0.1:11434: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Do not worry! This indicates that the Ollama server is already running in the background. You can verify it by navigating to:
http://localhost:11434/
If Ollama is running, you will see the message:
"Ollama is running"
-
In the terminal, run the following command to download the Llama3.1 model:
ollama pull Llama3.1
- This command will fetch the Llama3.1 model from the server.
- Note: The download might take some time depending on your internet speed. Feel free to grab a coffee while you wait.
-
Once the download is complete, you are ready to start using the API.
- Stopping the Server: To stop the server, press
Ctrl+C
in the terminal where it is running. - Help Commands: To explore all available commands, you can run:
ollama help
- Model Management: You can pull additional models or manage existing ones using
ollama pull <model_name>
or other relevant commands.