How to install and set up Ollama on Mac, Windows and Linux
A step-by-step guide, no prior knowledge needed, to install Ollama, download your first AI models, chat with them and make them available to other applications on your computer or network.
Ollama is a free program that runs artificial intelligence models on your own computer. It works in the background, as an always-available service, and it's the piece that many other AI applications (Open WebUI, LiteLLM, code editors, agents) expect to find installed.
In this guide you will install it, download a model, chat with it and get Ollama ready for other applications to use. You don't need to know how to program: whenever you have to type something in the terminal, we tell you exactly what to type.
What Ollama is and how it differs from LM Studio
If you followed our LM Studio guide, you already know what a language model is: a file containing an artificial intelligence that can understand and write text. Ollama does a similar job with a different approach:
- It's lightweight and works in the background. It starts by itself when you turn on your computer and waits for requests.
- It has a simple chat window on Mac and Windows, but its strength is the terminal: a single command downloads and runs a model.
- It's the de facto standard for connecting local models to other tools.
You can have LM Studio and Ollama installed at the same time. Each keeps its own models, so keep an eye on disk space.
Before you start: check your computer
Mac
- macOS 14 Sonoma or later.
- Macs with an Apple chip (M1 or later) work best. Macs with an Intel processor can also use it, but only on the processor and much more slowly.
To check: Apple menu (the apple in the top-left corner) → About This Mac.
Windows
- Windows 10 (version 22H2) or Windows 11.
- If you have an NVIDIA graphics card, update its driver (version 551.61 or later). Recent AMD cards are also used. It works without a graphics card too, just more slowly.
Linux
- Any recent 64-bit distribution (Ubuntu, Debian, Fedora...).
Memory and space
As a rule of thumb, the model you choose should take up well under your computer's RAM. Also keep 5 to 20 GB free on disk for models.
Step 1. Install Ollama
On Mac
- Go to ollama.com/download and click Download for macOS.
- Open your Downloads folder and double-click
Ollama.dmg. - Drag the Ollama icon into the Applications folder.
- Open Applications and double-click Ollama. If macOS asks whether you want to open an application downloaded from the Internet, click Open.
- The first time, Ollama asks for permission to install its terminal command (the
ollamaprogram). Accept, and enter your Mac's password if asked.
You will see the Ollama icon (a llama) in the menu bar, top right. That means it's running.
On Windows
- Go to ollama.com/download and click Download for Windows.
- Open your Downloads folder and double-click
OllamaSetup.exe. - Click Install. No administrator rights are needed: Ollama installs into your user folder.
- When it finishes, Ollama keeps running in the background. You will see its icon in the system tray, next to the clock (possibly inside the ^ arrow of hidden icons).
On Linux
- Open the Terminal (on Ubuntu, press Ctrl + Alt + T).
- Copy this command, paste it into the terminal (with Ctrl + Shift + V) and press Enter:
curl -fsSL https://ollama.com/install.sh | sh- It will ask for your password: type it (you won't see the characters as you type, that's normal) and press Enter.
- Wait for it to finish. The program is installed as a service that starts with your computer.
Step 2. Open the terminal and check the installation
The terminal is a window where you type commands. Don't worry: you will only copy and paste.
- Mac: press ⌘ + Space, type "Terminal" and press Enter.
- Windows: open the Start menu, type "PowerShell" and press Enter.
- Linux: press Ctrl + Alt + T.
Type this command and press Enter:
ollama -vYou should see something like ollama version is 0.34.3. If you get a "command not found" error instead, close the terminal, open it again and retry. On Mac, make sure you accepted the terminal command installation in the previous step.
Step 3. Download your first model
Ollama models have short names. Pick one based on your computer's memory:
- 8 GB of memory:
llama3.2(about 2 GB) orgemma3(about 3.3 GB). - 16 GB of memory:
qwen3.5(about 6.6 GB) orgemma4:e2b(about 7.2 GB). - 32 GB or more:
gpt-oss:20b(about 14 GB) orqwen3.8(about 18 GB).
You can browse every available model at ollama.com/library.
From the terminal (Mac, Windows and Linux)
Type ollama run followed by the model name. For example:
ollama run gemma3The first time, it downloads the model (you will see a progress bar). When it's done, the >>> prompt appears. Type your question and press Enter.
To leave the conversation, type /bye and press Enter.
From the app (Mac and Windows)
- Open the Ollama window: click its icon (in the Mac menu bar or the Windows tray) and choose to open the app.
- In the chat window, open the model selector and pick one from the list.
- Type your message. If the model isn't downloaded yet, Ollama downloads it before answering.
Step 4. Basic commands to manage your models
These commands are typed in the terminal:
ollama ls: shows the models you have downloaded and how much space they take.ollama pull qwen3.5: downloads a model without opening a conversation.ollama run qwen3.5: opens a conversation with the model (downloading it if needed).ollama ps: shows the models loaded in memory right now, whether they use the graphics card or the processor, and their context size.ollama stop qwen3.5: unloads the model from memory to free resources.ollama rm qwen3.5: deletes the model from disk.
Step 5. App settings
On Mac and Windows, open Ollama's settings from its icon or from the app window. You will find these options:
- Context length: how much text the model can remember in a conversation. By default Ollama picks a value based on your graphics card's memory (on most computers about 4,000 tokens, roughly 3,000 words). For long documents, code editors or agents, raise it: Ollama recommends at least 64,000 for those uses, as long as your memory allows it.
- Model location: where models are stored. Useful if you want to use an external drive.
- Expose Ollama to the network: lets other devices on your network use your models (see step 7).
- Cloud: turns on Ollama's cloud models. With this option those models run on Ollama's servers and you need an account. If you want everything to stay on your computer, leave it off.
Step 6. Use Ollama from other applications
While Ollama is running, it offers a local server that other applications can use. To check, open your browser and go to:
http://localhost:11434You should see the message Ollama is running.
Applications that connect to Ollama will ask for one of these addresses:
- Native Ollama connection (Open WebUI, for example):
http://localhost:11434 - OpenAI-compatible connection (LiteLLM, Hermes, code editors):
http://localhost:11434/v1
If an application asks for an API key for that connection, type any text, for example ollama: Ollama doesn't check it.
Step 7. Share Ollama with other devices on your network
By default, Ollama only accepts requests from the computer itself. If you want to use it from another computer at home or in the office:
Mac and Windows (the easy way)
Turn on Expose Ollama to the network in the app settings.
Linux
Open the terminal and type:
sudo systemctl edit ollama.serviceA text editor opens. In the area marked for your changes, add these two lines:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"Save and close the editor (in the nano editor: Ctrl + O, Enter and Ctrl + X). Then restart Ollama:
sudo systemctl daemon-reload
sudo systemctl restart ollamaFrom another computer, use the IP address of the computer running Ollama instead of localhost, for example http://192.168.1.50:11434.
Step 8. More context for agents and code editors
Some tools, such as the Hermes agent covered in another guide, need the model to have a large context (64,000 tokens or more). Besides raising it in the app settings, you can start Ollama with that value from the terminal:
OLLAMA_CONTEXT_LENGTH=64000 ollama serveThis command works on Mac and Linux, but first you have to quit the Ollama app (from its icon, Quit Ollama) so that two don't run at once. On Linux, if Ollama already runs as a service, add the variable OLLAMA_CONTEXT_LENGTH=64000 using the same method as in step 7.
To check the context a loaded model is using, run ollama ps.
Common problems
- "ollama: command not found" or "not recognized as a command". Close and reopen the terminal. On Mac, open the Ollama app and accept the terminal command installation.
- The browser can't open
localhost:11434. Ollama isn't running: open it from Applications (Mac) or the Start menu (Windows). On Linux, runsudo systemctl start ollama. - The model is very slow. Check with
ollama pswhether it's using the graphics card (GPU) or the processor (CPU). If it uses the CPU or the computer freezes, try a smaller model. - "Address already in use" when running
ollama serve. An Ollama is already running (the app or the service). You don't need to start another one. - I'm running out of disk space. Review your models with
ollama lsand delete the ones you don't use withollama rm.
Next steps
Ollama is now up and running. The next guide in this series shows how to install LiteLLM to bring your Ollama models, your LM Studio models and cloud services together in one place.
Next guide: How to install and set up LiteLLM to bring all your AI models together