Run your first model on Linux

4 min readMarkdown

This takes about ten minutes, most of it waiting for a download. You need a 64-bit Linux install with curl, sudo rights and about 10 GB of free disk space.

  1. Step 1: Check your memory

    Paste this into a terminal:

    shell
    free -h
    nvidia-smi --query-gpu=name,memory.total --format=csv

    The Mem row of the first command is your system memory. The second prints your NVIDIA card's name and memory in MiB, if you have one. Divide by 1024 for GB.

    If you have an NVIDIA card, use its memory to find your row. If you do not, use system memory. It decides which model you download in step 3.

    What your memory can run
    Your memoryModel classSuggested modelDownloadTime at 100 Mbit/s
    8 GBSmall, up to about 4BQwen3 4Babout 2.5 GBabout 3 min
    16 GBSmall, up to about 8BQwen3 8Babout 5 GBabout 7 min
    24 GB and upMid, about 20Bgpt-oss-20babout 13 GBabout 17 min

    As of 27 Nov 2026 · Picks are editorial. Sizes are 4-bit builds.

    Without a graphics card, start with the 8 GB row whatever your memory. On a CPU, smaller runs faster.

  2. Step 2: Install one app

    Install Ollama with its official script from ollama.com:

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

    The script downloads Ollama, sets it up as a background service and detects NVIDIA or AMD graphics. It asks for your sudo password. Ollama is free and open source, and it runs entirely from the terminal.

    Check it worked:

    shell
    ollama --version

    If you would rather have a window with a chat box, LM Studio ships a Linux AppImage at lmstudio.ai. Once it is open, steps 3 and 4 match the Windows page.

  3. Step 3: Download the suggested model

    Pull the model for your row. Ollama names its builds with a colon and a size tag:

    shell
    ollama pull qwen3:4b      # 8 GB row
    ollama pull qwen3:8b      # 16 GB row
    ollama pull gpt-oss:20b   # 24 GB and up

    Run only the line for your row. Ollama's default builds are 4-bit, the same as the table.

    The download is the slow part. The table shows the size and a rough time on a 100 Mbit/s connection. After this, everything runs offline.

    The catch

    A model bigger than your VRAMVRAMMemory on a graphics card. On a PC with a GPU, it is your model budget.Read more still runs. Ollama splits it between the card and system memory, and the part on the CPU runs many times slower. Stay in your row until you have seen what full speed feels like.

  4. Step 4: Say hello

    Start a chat with the model you pulled, for example:

    shell
    ollama run qwen3:8b

    At the >>> prompt, paste this and press Enter:

    Try it
    In two sentences, explain what a token is. Then write a four-line poem about a laptop that thinks.

    A good response starts within a few seconds and streams in word by word. It explains tokensTokenA chunk of text, usually part of a word. Models read and write in tokens.Read more as pieces of words, then gives you a short poem. The wording will differ every time you ask.

    Type /bye to leave.

    Qwen3 is a reasoning model, so it may show its thinking before the answer. That is normal.

    If text is appearing, you are running AI on your own machine. Nothing you typed left the computer.

What just happened

You downloaded a model, which is one large file of numbers. Ollama is a runtime, the software that loads the model and does the maths on your GPU or CPU. The model wrote its answer one token at a time, and the speed you saw is how fast your memory can feed it.

If it did not work

Ollama says it could not connect, or asks if it is running. The background service is not up. Start it with sudo systemctl start ollama, then try again. systemctl status ollama shows why it stopped.

Answers are slow on a machine with a graphics card. Ollama is running on the CPU. Check the driver as in the notes below, then run ollama ps while a model is loaded, and the processor column should say GPU. More fixes in Why is my GPU not being used?.

The pull fails or stops. Check free space with df -h ~. Then run the same ollama pull line again. It resumes where it stopped.

Anything else is in Troubleshooting and reference.

Linux notes

The install is one line. Everything else depends on your GPU driver, so check it before you blame Ollama.

For NVIDIA, install the proprietary driver from your distribution's own tool, such as Additional Drivers on Ubuntu. Then run:

shell
nvidia-smi

If it prints a table naming your card and a driver version, you are fine. If the command is missing or reports it cannot talk to the driver, Ollama will fall back to the CPU. Which NVIDIA card should I get? covers card choice.

For AMD, Ollama uses ROCm, which supports a specific list of cards. Check yours against Ollama's GPU docs before you expect it to be used. Do AMD and Intel work for local AI? has the details.

Rule of thumb

On a graphics card, VRAM is your budget. Without one, system memory is the budget and speed is the limit.

Go deeperThat's enough

Seeing your speed

Add --verbose to the run command and Ollama prints timing after every answer:

shell
ollama run qwen3:8b --verbose

The eval rate line is how fast it wrote, in tokens per second. Compare it with the speeds in How fast is fast?.

Where Ollama keeps things

The install script creates an ollama system service and a user for it. Models pulled by the service live in that user's data directory, not your home folder. ollama list shows what you have and how big each one is, and ollama rm followed by a name deletes one.

Talking to it from code

The service also listens on port 11434 for programs on your machine. Any tool that speaks the OpenAI API can use it. How do I call a local model from code? shows how, and How do I use Ollama? covers the rest of the commands.