Installing and Configuring Ollama on Windows #
Ollama is a platform that allows you to run language models (LLMs) locally on your computer in a simple and fast way, without depending on the cloud. With it, you can download and interact with models such as LLaMA, Mistral, and Gemma directly via terminal or API, ensuring more privacy, control, and performance in AI applications.
Download and Install Ollama #
- Visit the official website of Ollama: https://ollama.com
- Click on the download button for Windows and download the installer.
- Run the installer and follow the on-screen instructions to complete the installation.
💡 The installer configures Ollama to automatically start with the system and installs a desktop application for easy server management.
Download Language Models #
With Ollama installed, you can download language models for local use. Open Command Prompt or PowerShell and run the following commands as needed:
- Llama 3.2 (1B):
ollama run llama3.2:latest
Other recommended models:
Gemma 2 (2B):
ollama run gemma2:2b
Mistral (7B):
ollama run mistral
How to Open and Use Ollama #
To talk to the AI, you can open the Command Prompt (CMD) in Windows and use the same command you used to download the language model.
Setting up OLLAMA_HOST and OLLAMA_ORIGINS #
To allow Ollama to accept connections from other sources, follow the steps below:
- Shut down Ollama:
- Right-click on the Ollama icon in the system tray (next to the clock) and select “Exit”.
- Open the Environment Variables Settings:
- Press Win + S, type “environment variables” and select “Edit system environment variables”.
- Add Environment Variables:
- In the “User variables” section, click “New…” and add the following variables:
- Variable Name: OLLAMA_HOST
- Variable value: 0.0.0.0
- Click “New…” and add:
- Variable name: OLLAMA_ORIGINS
- Variable value: *
- Save and Restart Ollama:
- Click “OK” to save the changes.
- Start Ollama again from the Start menu.
🔒 These settings allow Ollama to accept connections from any source. For production environments, it is recommended to restrict the allowed sources for security reasons.