How to Install Ollama on Ubuntu and Run Local AI Models (2026)

Quick answer

To install Ollama on Ubuntu, run the official one-line installer in a terminal, check the service with systemctl, then run a small model first: ollama run llama3.2. Ollama itself costs $0 under the MIT licence, and models live on your disk, by default in /usr/share/ollama/.ollama/models on Linux.Keep the default network setting. Ollama binds to 127.0.0.1 on port 11434, which means only your own machine can reach it. Do not expose that port to the internet. A local model will not match a frontier cloud model on hard reasoning, but for private drafts, summaries and offline chat on a machine you already own, the software bill drops from $20 a month for ChatGPT Plus to $0.

The subscription screen is where local AI starts to look attractive. You open a chat tool to draft one customer reply, and before the reply exists you have a monthly bill, a login, and a small worry about what business text you just pasted into somebody else’s server.

Ollama is the plain answer to that worry. It is free, open-source software that runs open AI models on your own Ubuntu machine, so the drafting, summarizing and question-answering happen on hardware you control. This guide shows how to install Ollama on Ubuntu and run local AI models safely, with every command and limit checked on Ollama’s official documentation on 1 December 2026.

Quick Answer

To install Ollama on Ubuntu, run the official one-line installer in a terminal, check the service with systemctl, then run a small model first: ollama run llama3.2. Ollama itself costs $0 under the MIT licence, and models live on your disk, by default in /usr/share/ollama/.ollama/models on Linux.

Keep the default network setting. Ollama binds to 127.0.0.1 on port 11434, which means only your own machine can reach it. Do not expose that port to the internet. A local model will not match a frontier cloud model on hard reasoning, but for private drafts, summaries and offline chat on a machine you already own, the software bill drops from $20 a month for ChatGPT Plus to $0.

In this article

  • How we checked this guide
  • What Ollama replaces, and what it does not
  • Install routes and hardware at a glance
  • Requirements before you install
  • Step 1: install Ollama on Ubuntu
  • Step 2: start the service and verify it
  • Step 3: run your first local model
  • First-run security steps
  • Make Ollama useful: API, context and memory settings
  • Backup and update routine
  • Common errors and fixes
  • Tips and tricks that save time
  • The real cost maths: local versus subscription
  • When not to self-host
  • Pros and cons
  • Our verdict
  • FAQ
  • Strategic Pivot: price your own stack before you buy
  • Sources

How we checked this guide

Every install step, licence statement, hardware rule and setting in this post was checked on Ollama’s official documentation and the official ollama/ollama GitHub project on 1 December 2026. The one paid price used for comparison, ChatGPT Plus at $20 a month, was checked on the official ChatGPT pricing page the same day.

Where the official pages do not publish a number, we say so instead of guessing. Ollama does not publish one flat minimum RAM figure for Linux, because the right memory depends on the model you choose. We therefore size models by the download sizes shown in Ollama’s model library and explain the memory maths plainly.

What Ollama replaces, and what it does not

Ollama replaces the rented chat window for everyday text work. Drafting emails, rewriting product descriptions, summarizing notes, brainstorming offers and answering questions from text you paste in can all run locally. Your prompts stay on your machine when you run local models. Ollama’s own FAQ states that it does not see your prompts or data when you run locally.

Best for: a small business owner, freelancer or teacher who wants private, offline AI help on an Ubuntu PC they already own, with no per-seat bill. Skip if: you need the strongest available reasoning, live web browsing, image generation, or a team workspace with shared logins and admin controls.

Ollama does not replace your judgement. A small local model can write a confident wrong sentence as happily as a large cloud model can. Treat local output as a fast first draft, check facts before you send anything to a customer, and keep a cloud tool for the few jobs where quality matters more than privacy or cost.

Ollama is also not a website chatbot by itself. It is the engine: a local server and command-line tool that runs models and answers API requests on port 11434. Chat interfaces, document tools and automation apps connect to that engine. If your real job is a customer-facing website bot, read our guide to the best AI chatbots before you self-host anything.

Install routes and hardware at a glance

RouteBest forCost checked 1 Dec 2026Main limit to watch
Official install script on UbuntuMost readers: fastest safe start$0, MIT licenceNeeds curl, disk space and a supported system
Manual archive installReaders who want to control the package$0, MIT licenceYou handle the systemd service steps yourself
CPU only, no GPUOlder PCs and small models$0 software; uses system RAMSlow answers with larger models
NVIDIA GPUFaster replies and bigger models$0 software; GPU you already ownCompute capability 5.0+ and driver 550+ required
AMD GPU on LinuxSupported Radeon and Ryzen AI cards$0 software; GPU you already ownROCm v7 driver required on Linux

The table hides the real decision. Ollama is free either way. Your hardware decides which models feel usable. A model that fits in GPU memory answers quickly. The same model split between GPU and system RAM still works, but slower. A model loaded entirely into system RAM works too, and the ollama ps command will tell you plainly which case you are in.

Requirements before you install

Start with Ubuntu and a terminal you are comfortable using with sudo. The official Linux page offers two routes: the install script, and a manual download-and-extract route for AMD64 and ARM64 systems. AMD GPU users on the manual route also download the additional ROCm package shown on that page.

Disk space is the first real requirement. Models are large files. In Ollama’s library, llama3.2:1b is a 1.3GB download and the default llama3.2:3b is 2.0GB, while llama3.1:8b is 4.9GB. A few test models can quietly eat 20GB, so check your free space before you start pulling models like free samples.

Memory is the second requirement, and it follows the model, not the installer. As a planning rule, the model file must fit in available GPU memory for full GPU speed, or in system RAM for CPU running, with room left for context. A 2.0GB model is a sensible first test on modest hardware. A 43GB 70B model is a different purchase decision, not a casual download.

GPU support has exact rules on the official hardware page. NVIDIA GPUs need compute capability 5.0 or higher and driver version 550 or newer. Cards at compute capability 5.0 through 6.2 need driver 570 or newer. On Linux, AMD support runs through the ROCm v7 driver on the listed Radeon, Radeon PRO, Ryzen AI and Instinct cards. Vulkan adds further GPU support on Linux when the backend is installed.

No GPU is not a failure. It only changes which model sizes feel pleasant. Start small, measure, then grow. That order saves more money than any benchmark chart.

Step 1: install Ollama on Ubuntu

Open a terminal and run the official installer command from Ollama’s Linux documentation:

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

That one line is the whole install for most Ubuntu readers. The script downloads Ollama, installs it, and on a systemd system sets up the background service. Let it finish before you judge it. On a slow connection the download is the slow part, not your computer.

If the installer stops and asks for zstd, believe it. Bare Ubuntu installs can miss that extraction tool. Install it with sudo apt-get install zstd, then run the official installer line again. This is the most common first-run stop we found in real install reports, and the fix takes one minute.

Prefer to control the package yourself? Use the manual route on the official Linux page. Download the archive for your architecture, AMD64 or ARM64, and extract it into /usr exactly as that page shows. Archive names can change between releases, so copy the current commands from the official page on the day you install instead of trusting an old screenshot. AMD GPU readers should also add the ROCm package the page lists.

After a manual install, add Ollama as a startup service, which the official page recommends. The page walks through creating the ollama user and group, creating the service file at /etc/systemd/system/ollama.service, then reloading systemd and enabling the service. Follow that page’s current service file rather than inventing your own.

Ollama official Linux documentation page showing install, manual install and startup service sections
Ollama’s official Linux documentation, checked 1 December 2026. The install script is the fastest route; the manual archive route and systemd service steps are on the same page.

Step 2: start the service and verify it

With the script install on Ubuntu, the service should already be running. Check it before you change anything:

sudo systemctl status ollama

You want the service to read as active and running. If it is stopped, start it with sudo systemctl start ollama. If you installed manually and are testing without a service, run ollama serve in one terminal and use a second terminal for commands.

Now verify the install itself:

ollama -v

That prints the installed version. Then confirm the local server answers. Ollama listens on 127.0.0.1 port 11434 by default. That loopback address is a safety feature, not a bug. It means your own machine can use Ollama and the network cannot.

If the version prints but models will not run, do not reinstall in a panic. Check the service status first, then read the logs. The official Linux page points service users to the journal for Ollama logs, and the FAQ points to the troubleshooting docs. Most early failures are a stopped service, a missing extraction tool, or a model too large for the memory available.

Step 3: run your first local model

Start with a small model. The default llama3.2 tag is the 3B model at 2.0GB, which is large enough to judge quality and small enough to forgive modest hardware:

ollama run llama3.2

The first run downloads the model, then opens a chat prompt. Ask it something from your real work, not a trivia question. Paste a rough customer reply and ask for a clearer version. Ask it to turn five bullet points into a short product description. Real tasks expose quality faster than puzzles do.

Useful commands from the official CLI reference:

  • ollama pull MODEL downloads a model without starting chat.
  • ollama list shows the models stored on your machine.
  • ollama ps shows which models are loaded in memory right now.
  • ollama stop MODEL unloads a model and frees memory, while keeping the file on disk.
  • ollama rm MODEL deletes a downloaded model when disk space gets tight.

The ollama ps output deserves one full look. Its Processor column shows 100% GPU when the model loaded entirely into GPU memory, 100% CPU when it loaded entirely into system memory, or a split such as 48%/52% CPU/GPU. That one line explains most “Ollama is slow” complaints without any guessing.

Ollama official hardware support page showing NVIDIA and AMD GPU requirements
Ollama’s official hardware support page, checked 1 December 2026. NVIDIA needs compute capability 5.0+ and driver 550+; AMD on Linux needs the ROCm v7 driver.

Choose your second model by memory, not by hype. If llama3.2 feels fast and useful, an 8B-class model such as llama3.1:8b at 4.9GB is a reasonable next step on hardware with room to spare. If the 3B model already crawls, a bigger model will crawl more elegantly, not less. Smaller and finished beats larger and abandoned.

First-run security steps

There is no Ollama login to create for local use, and that is exactly why the network setting matters. Ollama binds to 127.0.0.1 port 11434 by default. Only programs on your own machine can reach it. For a single Ubuntu PC, leave it that way and your security work is mostly done.

The bind address changes through the OLLAMA_HOST environment variable. Setting it to 0.0.0.0 makes Ollama listen on all network interfaces. That can be right on a trusted home or office network, for example when a second machine needs the API. It is the wrong default for a laptop on public Wi-Fi, and it is never a reason to forward port 11434 through your router to the internet.

On Linux with the systemd service, environment variables are set through systemctl. Edit the service with sudo systemctl edit ollama.service, add Environment lines under the [Service] section, then reload systemd and restart Ollama. The official FAQ gives this exact flow for Linux. Restart after every change, because Ollama reads these settings when the server starts.

Three habits keep a local setup boring, which is what you want. Keep Ollama on loopback unless another trusted device truly needs it. Keep Ubuntu itself updated, because Ollama inherits the safety of the machine under it. And remember that local models keep prompts on your machine, while any cloud model or web feature you choose to use follows that service’s rules instead.

Ollama official FAQ page showing server settings, network exposure and model storage answers
Ollama’s official FAQ, checked 1 December 2026. Ollama binds to 127.0.0.1 port 11434 by default; models on Linux live in /usr/share/ollama/.ollama/models.

Make Ollama useful: API, context and memory settings

The command line is enough for chat. The REST API is where Ollama becomes a small-business tool. Ollama serves its API locally on port 11434, so scripts and apps on your machine can send prompts and receive answers without a cloud account. That is how local drafting gets into spreadsheets, note tools and simple automations later.

Context length decides how much text the model can consider at once. By default Ollama uses a context window of 4096 tokens. You can raise the default with the OLLAMA_CONTEXT_LENGTH environment variable, set it during ollama run with /set parameter, or pass num_ctx through the API. Longer context uses more memory, so raise it for a reason, such as summarizing a long document, not as a decoration.

Memory settings decide how the machine feels between questions. By default, models stay in memory for five minutes before unloading, which makes follow-up questions fast. The keep_alive API parameter and the OLLAMA_KEEP_ALIVE variable change that behaviour. Unload immediately with ollama stop when you need the RAM back for other work.

Concurrency has limits worth knowing before a team shares one machine. If too many requests arrive, Ollama can answer with a 503 overloaded error. OLLAMA_MAX_QUEUE changes the queue size, and its default is 512. Parallel requests need more memory, because context grows with each parallel request. One busy owner is fine. A whole office on one small PC is a planning problem, not an Ollama bug.

Model storage is simple to manage once you know the address. On Linux, models live in /usr/share/ollama/.ollama/models. Set OLLAMA_MODELS to move them to a larger disk. Do this before your model collection grows, not after the system disk fills during a customer deadline.

Backup and update routine

Ollama has little to back up, which is one of its quiet advantages. There is no customer database and no account history to protect. Your valuable pieces are the models you chose to download, any custom Modelfiles you wrote, and the systemd settings you changed.

A simple routine covers it. Keep a short text list of the model tags you actually use, from ollama list. Save any Modelfile or service override you created with your other configuration notes. If disk space allows, copy the models directory to your normal backup drive. Re-downloading a model is always an option, so a lost model folder is an inconvenience, not a disaster.

Updating on Linux is deliberately dull. Re-run the official install script:

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

The official Linux page gives that as the update route, with re-downloading the archive as the manual alternative. To install a specific version, including a pre-release, the page documents the OLLAMA_VERSION environment variable with the install script, using version numbers from the GitHub releases page. Update when you have a reason, check ollama -v afterwards, and run one real prompt before you rely on the machine again.

Common errors and fixes

The installer asks for zstd. This happens on bare Ubuntu systems that lack the extraction tool. Run sudo apt-get install zstd, then run the official installer again. Nothing is broken. The install simply stopped at the door.

The service is not running. Commands fail or the API does not answer because nothing is listening. Check sudo systemctl status ollama, start the service if needed, and read the journal logs the official page points to. On a manual test install without a service, remember that ollama serve must stay running in its own terminal.

The model runs at 100% CPU and feels slow. Run ollama ps and read the Processor column. A full CPU load means the GPU was not used. On NVIDIA systems, confirm the driver with nvidia-smi, which the official page says should print details about your GPU. Check the driver against the official rule: 550 or newer, and 570 or newer for compute capability 5.0 through 6.2 cards.

The GPU disappears after sleep. The official hardware page documents this Linux suspend and resume case: Ollama can fail to discover the NVIDIA GPU after a suspend cycle and fall back to CPU. The documented workaround reloads the NVIDIA UVM driver with sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm. Restart Ollama afterwards and confirm with ollama ps.

The model is too large for the machine. Downloads succeed and answers crawl, or the system swaps and stutters. The fix is a smaller tag, not hope. Drop from an 8B model to llama3.2:3b at 2.0GB or llama3.2:1b at 1.3GB, unload the big model with ollama stop, and delete unused models with ollama rm.

Another device cannot connect. That is the default doing its job. Ollama binds to 127.0.0.1, so other devices are refused. Only on a trusted network should you set OLLAMA_HOST to a network address through the systemd override, restart the service, and allow port 11434 through the firewall for that trusted network only.

Requests return a 503 overloaded error. Too many requests are queued for the memory available. Reduce parallel work, unload models you are not using, or raise OLLAMA_MAX_QUEUE if the machine has memory to spare. The queue default is 512, and a bigger queue does not create more RAM.

Tips and tricks that save time

Test with your own words. One real customer email tells you more about a model than ten benchmark questions. Keep three saved prompts from your business: a reply rewrite, a summary, and a product description. Run the same three prompts on every new model and compare like an owner, not a fan.

Keep the model shelf short. Two models you use weekly beat nine models you downloaded once. Disk space, update time and choice fatigue all shrink when the list stays honest. Use ollama list once a month and delete what earned no work.

Use pull before you need the model. Downloading during a deadline makes a good tool feel broken. Pull new models in the evening, test them with your three prompts, and only then let them near customer work.

Set context with intent. The 4096-token default suits chat and short drafting. Raise it for long documents, and remember that context spends memory. On a small machine, a shorter context with a model that fits beats a long context that pushes everything into slow memory.

Write down your settings. One small note with your model tags, any OLLAMA_HOST or OLLAMA_MODELS change, and the date you updated will save you an hour the first time something behaves oddly. Self-hosting rewards boring notes.

The real cost maths: local versus subscription

Ollama’s licence is MIT, confirmed on the official GitHub project. In plain words, you may use, copy, modify and distribute the software free of charge, keeping the copyright and permission notice. There is no Ollama subscription for local use and no per-seat charge. The software line in the budget is $0.

The comparison anchor is the tool most readers already pay for. The official ChatGPT pricing page checked on 1 December 2026 lists Plus at $20 a month. That is $240 a year for one person, before any team seats.

Now price one realistic small-business scenario. A solo owner uses an Ubuntu PC already on the desk for drafting replies, summarizing notes and writing product text. Ollama on that machine costs $0 a year in software. The subscription route costs $240 a year. The verified saving is $240 a year, and the local route also keeps those prompts on the owner’s machine.

Scale it honestly. Five staff on individual Plus subscriptions would cost $1,200 a year at $20 each. One shared local machine still costs $0 in software, but it becomes one machine doing five people’s drafting, with queue and memory limits to plan around. The saving is real. So is the sharing friction.

Hardware is where the maths can turn. If you already own the PC, local AI is close to free beyond electricity and your setup time. If you buy hardware only for local AI, divide that purchase price by $240 to get the years one Plus subscription would take to match it. A purchase that needs five years to break even is a hobby decision, not a saving. Price it as one.

ChatGPT official pricing page showing Free, Go, Plus and Pro plans
The official ChatGPT pricing page, checked 1 December 2026. Plus is $20 a month, which is $240 a year for one person.

Electricity and time belong in the note, even when they are small. A desktop running a model for an hour uses real power, and an hour of your troubleshooting is worth money. The honest claim is narrow and strong: on hardware you already own, Ollama removes a $240-a-year subscription for work a small model handles well.

Compare the wider shelf before you commit. Our roundup of ChatGPT alternatives for small business owners and our guide to free AI tools for small business that are actually free show where a paid or free cloud tool still beats a local install.

When not to self-host

Do not self-host when the work needs the best model, not a good-enough model. Long legal documents, delicate customer disputes and complex analysis still reward frontier cloud models. A local 3B model drafting a routine reply is sensible. The same model judging a contract is not.

Do not self-host when nobody will own the machine. Updates, disk space, backups and the occasional driver problem need one named person. In a business with no such person, a subscription buys you an off switch for maintenance. That can be worth $240 a year.

Do not self-host a public service on a home setup. Exposing port 11434 to the internet because a tutorial made it look easy is how a private tool becomes a stranger’s free GPU. Public access needs authentication, rate limits and monitoring in front of Ollama, which is a different project from this guide.

Do not self-host when your hardware is already struggling. If the PC swaps during normal work, local AI will make a slow machine slower. Use a cloud tool, or replace the hardware for general reasons first and treat local AI as a bonus.

Pros and cons

Ollama on Ubuntu

Pros: $0 software cost under the MIT licence; prompts and models stay on your machine for local use; one official install command and a dull, reliable update route; a local API on port 11434 for scripts and apps; honest diagnostics through ollama ps. Cons: output quality trails frontier cloud models; speed depends entirely on your hardware; no team logins, admin controls or support desk; you own updates, disk space and driver problems.

ChatGPT Plus as the paid comparison

Pros: stronger models with no hardware limits; works on any device with a login; no install, drivers or disk management. Cons: $20 a month per person, $240 a year, checked 1 December 2026; prompts leave your machine; no offline use when the connection drops.

Our verdict

Install Ollama on the Ubuntu machine you already own, start with llama3.2, and judge it on three real prompts from your business. If it drafts, summarizes and rewrites well enough, you have removed a $240-a-year subscription for that work and kept the text private.

Keep a cloud subscription only for the jobs where the stronger model earns its money. That split, local for routine private work and cloud for hard cases, is the cheapest honest setup most small businesses can run.

FAQ

Is Ollama really free for a small business?

Yes. Ollama is released under the MIT licence, which allows free use, copying, modification and distribution with the copyright notice kept. There is no local-use subscription and no per-seat fee. Your costs are the hardware you run it on, electricity, and your setup time.

Does Ollama send my prompts to the internet?

Not for local models. Ollama’s FAQ states that it does not see your prompts or data when you run locally. Cloud-hosted models and web features are separate choices with their own rules, so check what you are using before pasting sensitive text.

Can Ollama run without a GPU?

Yes. Models can run entirely in system RAM, and ollama ps will show 100% CPU in that case. CPU running suits small models such as llama3.2:3b at 2.0GB. Larger models still work but answer slowly, so size the model to the machine.

How much RAM do I need for Ollama on Ubuntu?

Ollama does not publish one flat Linux RAM minimum, because the model decides the need. The model file must fit in GPU memory for full GPU speed or in system RAM for CPU use, with room for context. Start with a 1.3GB or 2.0GB model and measure before downloading larger tags.

Is it safe to expose Ollama on my network?

Only on a network you trust. Ollama binds to 127.0.0.1 port 11434 by default, so other devices cannot reach it. Changing OLLAMA_HOST opens it to the network, and Ollama has no built-in login for that port. Never forward port 11434 to the internet.

Strategic Pivot: price your own stack before you buy

Before you cancel or keep any subscription, run your numbers through the AI Cost Calculator on this site. Enter the tools you pay for today, then compare the annual total against a $0 local install on hardware you already own.

Sources

Install steps, service setup, hardware rules, settings and privacy statements were checked on Ollama’s official Linux documentation, hardware support page and FAQ, and the licence on the official ollama/ollama GitHub project, all on 1 December 2026. The ChatGPT Plus price was checked on the official ChatGPT pricing page the same day.

Price note — updated 1 December 2026: Prices in this post were checked on 1 December 2026. Ollama is free under the MIT licence, and ChatGPT Plus was listed at $20 a month on the official pricing page. When you are reading this, the price may be lower or higher, and model sizes and install commands may have changed. Check the official Ollama documentation and the official pricing page before you buy or install.

Pros

  • Ollama: $0 software cost under the MIT licence
  • Ollama: prompts and models stay on your machine for local use
  • Ollama: one official install command and a dull, reliable update route
  • Ollama: a local API on port 11434 for scripts and apps
  • Ollama: honest diagnostics through ollama ps
  • ChatGPT Plus: stronger models with no hardware limits
  • ChatGPT Plus: works on any device with a login
  • ChatGPT Plus: no install, drivers or disk management

Cons

  • Ollama: output quality trails frontier cloud models
  • Ollama: speed depends entirely on your hardware
  • Ollama: no team logins, admin controls or support desk
  • Ollama: you own updates, disk space and driver problems
  • ChatGPT Plus: $20 a month per person, $240 a year, checked 1 December 2026
  • ChatGPT Plus: prompts leave your machine
  • ChatGPT Plus: no offline use when the connection drops
Our verdict

Install Ollama on the Ubuntu machine you already own, start with llama3.2, and judge it on three real prompts from your business. If it drafts, summarizes and rewrites well enough, you have removed a $240-a-year subscription for that work and kept the text private.Keep a cloud subscription only for the jobs where the stronger model earns its money. That split, local for routine private work and cloud for hard cases, is the cheapest honest setup most small businesses can run.

Leave a Comment