Open-Source & Local LLMs

How to Install Ollama, Run a Local Model, and Manage What You Pulled

Install Ollama with the official script, run a local model, then use ls, ps, stop, and rm to manage what you pulled — on macOS, Windows, and Linux.

How to Install Ollama, Run a Local Model, and Manage What You Pulled

Running a model on your own computer is the shortest path to a private chat, a local coding assistant, or a test bench that does not send every prompt to a hosted API. Ollama is one of the most direct ways to do that: you install a single service, pull a model, and talk to it from a terminal or from an app on localhost. The work does not end at the first reply. Models occupy disk, a service has to stay running, and you will eventually want to see what you pulled, stop what is loaded, or delete what you no longer use.

This guide follows Ollama's official installers and CLI: how to install it on macOS, Windows, and Linux, how to run a local model, and how to manage the copies you have already downloaded.

Key facts at a glance

  • On macOS or Linux, the official install command is curl -fsSL https://ollama.com/install.sh | sh. On Windows, it is irm https://ollama.com/install.ps1 | iex. Installers are also offered as a macOS .app and a Windows Setup.exe, and a Docker image is published as ollama/ollama.
  • After install, ollama run gemma4 downloads the model if needed and starts a chat on your computer. Type /bye to leave. ollama pull gemma4 downloads without opening the chat.
  • The service listens on localhost port 11434. You can call a native REST API, or use OpenAI- and Anthropic-compatible endpoints on the same port.
  • Official management commands include ollama ls to list models you have pulled, ollama rm gemma4 to remove one, ollama ps to list running models, and ollama stop gemma4 to stop a running model.
  • On Linux, a systemd service is recommended so Ollama starts on boot. View service logs with journalctl -e -u ollama. Update by running the install script again. You can pin a version with OLLAMA_VERSION, for example curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 sh.

What you are installing

Ollama is a local model runner and a small server. Once it is up, you pick a model from its library, pull the weights onto your disk, and either chat in the terminal or send HTTP requests to http://localhost:11434. Official examples use Gemma 4 (gemma4, or a smaller tag such as gemma4:e2b in the quickstart). Other models are listed in the library; you should only pull ones you intend to keep, because each copy stays on the machine until you remove it.

The install is intentionally short. That is also why you should understand the three layers you are about to create: the ollama binary (and, on Linux, a service user), the background server started by ollama serve or by the desktop app, and the model files you pull later. Uninstalling the app without removing models, or deleting a model while an app is still pointed at it, is how local setups get confusing. Plan to use the official list, stop, and remove commands as part of normal use, not as emergency cleanup.

Install Ollama on macOS, Windows, or Linux

On macOS or Linux, run:

curl -fsSL https://ollama.com/install.sh | sh

On Windows, from PowerShell, run:

irm https://ollama.com/install.ps1 | iex

If you prefer a graphical installer, use the official macOS download or the Windows Setup.exe. In Docker, run the ollama/ollama image. The install script talks to the network as root or as an elevated shell; read it, and only use the official address.

Linux has a documented manual path if you do not want the script. If you are upgrading from a prior version, remove the old libraries first with sudo rm -rf /usr/lib/ollama. Then download and extract the package:

curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
  | sudo tar x -C /usr

Start the server with ollama serve, and in another terminal check that it is running with ollama -v. If you have an AMD GPU, also extract the ROCm package (ollama-linux-amd64-rocm.tar.zst) into /usr. On ARM64, use ollama-linux-arm64.tar.zst. NVIDIA users can install CUDA drivers and confirm the GPU with nvidia-smi. AMD users are pointed at current ROCm drivers; the amdgpu driver in some Linux kernels may be older than you need for full ROCm support.

To keep Ollama available after reboot, add it as a startup service. Create a user and group:

sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)

Create /etc/systemd/system/ollama.service with ExecStart=/usr/bin/ollama serve, running as the ollama user and group, Restart=always, and WantedBy=multi-user.target. Then run:

sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama
sudo systemctl status ollama

Customize the service with sudo systemctl edit ollama, or with an override file that sets environment variables (the official example is Environment="OLLAMA_DEBUG=1"). ollama serve --help lists the variables the server accepts.

Run a model, then call it from a terminal or an app

With the service running, start a chat:

ollama run gemma4

Ollama downloads the model if it is not already on disk, then opens a prompt. Type /bye when you are done. You can also pass a one-off prompt, including a path to an image for a multimodal model, or use models meant for embeddings, decision questions, or speech. Those extras are optional. The basic loop is enough: install, run, talk, exit.

If you only want the weights on disk for another tool to use, pull without chatting:

ollama pull gemma4

The same server speaks HTTP on port 11434. Official examples include a native /api/chat request, an OpenAI-compatible /v1/chat/completions call, a /v1/responses call (stateless; include conversation history in each request), and an Anthropic-compatible /v1/messages call. Python and JavaScript libraries are documented as well. Whatever client you pick, point it at localhost and at the model name you actually pulled. If the server is not running, those calls fail; start it with ollama serve, the desktop app, or the systemd unit.

You can also launch supported desktop integrations with ollama launch, or target one by name, such as ollama launch claude --model qwen3.5. That is optional. Get ollama run working first so you know the model itself is healthy.

Manage what you pulled, and remove what you do not need

Local models accumulate. After a week of experiments you can have several copies of overlapping sizes, plus a model that a tutorial told you to try once.

See what is on disk:

ollama ls

See what is currently loaded:

ollama ps

Stop a running model without deleting it:

ollama stop gemma4

Remove a model you no longer want:

ollama rm gemma4

Do the list step before the remove step. The name you delete should match a name you just saw, including any tag. If an app still points at a model you removed, pull it again or change the app's configuration.

You can also build a thin custom variant with a Modelfile (FROM gemma4 plus a SYSTEM line) and ollama create -f Modelfile. That creates another named model on disk, which ollama ls will show and ollama rm can delete.

On Linux, update by running the install script again, or by re-extracting the tarball into /usr. To install a specific release, including a pre-release, set OLLAMA_VERSION when you run the script. If you need to take the Linux install off the machine, stop and disable the service, remove the unit file, remove the libraries and the binary, then remove the ollama user, group, and /usr/share/ollama directory as the official uninstall steps describe. That last directory is where the service user's files live; deleting it is how you reclaim the space the service account used, after you have already removed the models you care about listing.

What this means if you want a private local setup

Install from the official script or package, run one small model first, and confirm /bye and ollama ls both behave before you pull anything large. Keep the server bound to localhost unless you have a separate, deliberate plan to expose it. Use ollama ps and ollama stop when you are done for the day so a model is not sitting in memory overnight. Use ollama rm when a model was only a test. If you sign in with ollama signin for features that require an account, use ollama signout on a shared machine when you are finished.

Disk, RAM, and GPU memory are the real limits, not the installer. A machine that happily runs a small tag may stall on a larger one. Start with the official example model, then move up only after ollama ls shows you what you already paid for in disk space.

The caveats to respect

Piping a curl or PowerShell install script to a shell is convenient and also a trust decision. Stay on the official URL. Older Linux installs can leave libraries behind; the documented upgrade step of removing /usr/lib/ollama exists for a reason. GPU support is not automatic just because a card is present — CUDA or ROCm drivers still have to be installed and working. Compatible HTTP APIs are not a promise that every hosted-API feature works locally; for example, Responses requests are stateless, and some conversation-id fields are not supported. And deleting a model is permanent on that machine until you pull it again, so ollama ls comes first.

Keep the install in good shape

On Linux, check systemctl status ollama after a reboot, and use journalctl -e -u ollama when a pull or a run fails. Run the install script again when you want a current build, or pin OLLAMA_VERSION if you need to stay on a known release. After each update, run ollama ls to confirm your models are still present, then ollama run on one of them. When you outgrow a model, remove it the same day rather than leaving a graveyard of unused weights.

Local tooling will keep adding launchers and compatible APIs. The durable skill is smaller: install the official binary, run one model you understand, and keep the list of what you pulled short.

Takeaways

  • Install with the official macOS/Linux script, the Windows PowerShell command, the desktop installer, or the ollama/ollama Docker image.
  • Start a chat with ollama run gemma4 and leave with /bye; use ollama pull when you only want the weights.
  • The server is on localhost:11434, with a native API and OpenAI- or Anthropic-compatible paths for other clients.
  • Manage disk and memory with ollama ls, ollama ps, ollama stop, and ollama rm.
  • On Linux, enable the systemd service, know how to read its logs, and update or uninstall using the official steps rather than deleting random files.
Sponsored