> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Run Ollama and Open WebUI on a VPS

> Run Ollama on a VPS: install it with the official script, pull a small model such as llama3.2:3b, then add Open WebUI in Docker for a private web chat.

To run Ollama on a VPS, install it with `curl -fsSL https://ollama.com/install.sh | sh`, then chat with a small model using `ollama run llama3.2:3b`. Ollama listens only on `127.0.0.1:11434`. For a web chat, run Open WebUI in Docker with `--network=host` and reach it through an SSH tunnel or a reverse proxy. Without a GPU, answers are slow, so use small models.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 20 minutes | Ubuntu 24.04, Debian 13, AlmaLinux / Rocky 9 / 10 (x86\_64 or arm64) | Root or sudo, at least 4 GB RAM for small models, free disk for models |

## Before you start

* **Ollama** downloads and runs open large language models (LLMs) on your own server. **Open WebUI** is a web chat interface for it.
* **Expect CPU-only speed.** On a VPS without a GPU, Ollama runs the model in system memory on the CPU. Replies arrive word by word, far slower than on a GPU, and long answers can take minutes. Larger models are slower still. This guide assumes a CPU-only server.
* **Pick small models.** The model must fit in free RAM with room for the operating system and the conversation (context). Use the table below.
* [Install Docker](https://help.freakhosting.com/portals/other/how-to-install-docker.md) if you want Open WebUI.

## Which model should I use on a CPU-only VPS?

| Model | Download size | Good for |
| - | - | - |
| `gemma3:1b` | 806 MB | Very small servers, quick tests |
| `llama3.2:1b` | 1.3 GB | Short answers, summaries |
| `qwen3:1.7b` | 1.4 GB | General chat on 4 GB RAM |
| `llama3.2:3b` | 2.0 GB | Better answers, still usable on CPU |
| `qwen3:4b` | 2.5 GB | Better answers if you have 8 GB RAM or more |

Sizes are from the [Ollama library](https://ollama.com/library) on 4 November 2026. Models of 7B parameters and more work only with plenty of RAM and patience.

## How to install Ollama

**1. Run the install script**

```bash theme={null}
curl -fsSL https://ollama.com/install.sh | sh
```

The script installs Ollama and sets it up as the `ollama` systemd service.

**2. Check it is running**

```bash theme={null}
ollama -v
systemctl status ollama --no-pager
```

**3. Download and chat with a model**

```bash theme={null}
ollama run llama3.2:3b
```

The first run downloads the model. Type a question and press Enter. Type `/bye` to leave.

## How to check it worked

```bash theme={null}
ollama ps
curl http://127.0.0.1:11434/api/chat -d '{"model": "llama3.2:3b", "messages": [{"role": "user", "content": "Say hello"}], "stream": false}'
```

`ollama ps` lists the loaded model; `100% CPU` in the **PROCESSOR** column means it runs fully in system memory. The `curl` call returns a JSON answer.

## How to add Open WebUI

**1. Create a secret key**

```bash theme={null}
openssl rand -hex 32
```

Copy the output. Keep it the same every time you recreate the container, or everyone gets logged out.

**2. Start Open WebUI**

```bash theme={null}
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 -e WEBUI_SECRET_KEY=paste-your-key-here --name open-webui --restart always ghcr.io/open-webui/open-webui:main
```

`--network=host` lets the container reach Ollama on `127.0.0.1`, so Ollama never needs to listen publicly. Open WebUI then listens on port 8080 of the server.

**3. Open it through an SSH tunnel**

On your own PC, run:

```bash theme={null}
ssh -L 8080:127.0.0.1:8080 alex@203.0.113.10
```

Then open `http://localhost:8080` in your browser.

**4. Create the admin account**

The first account you create becomes the administrator, and sign-up closes after it. Create it straight away.

> [!WARNING]
>
> With `--network=host`, port 8080 is a normal server port, so your firewall controls it. Keep `ufw` or `firewalld` active and **don't** allow 8080 publicly. To use Open WebUI on a domain instead of a tunnel, put [Nginx as a reverse proxy](https://help.freakhosting.com/portals/other/how-to-set-up-nginx-as-a-reverse-proxy.md) with HTTPS in front of `http://127.0.0.1:8080`. Don't set `OLLAMA_HOST=0.0.0.0` unless a firewall blocks port 11434; the Ollama API has no login.

## How to manage Ollama

| Task | Command |
| - | - |
| List downloaded models | `ollama list` |
| Download a model without chatting | `ollama pull qwen3:1.7b` |
| Delete a model | `ollama rm qwen3:1.7b` |
| See loaded models | `ollama ps` |
| Read the service log | `journalctl -e -u ollama` |
| Update Ollama | Run the install script again |
| Update Open WebUI | `docker rm -f open-webui`, `docker pull ghcr.io/open-webui/open-webui:main`, then the same `docker run` command |

Models are stored in `/usr/share/ollama/.ollama/models`. Check free space with `df -h` before pulling large models. To store them elsewhere, set `OLLAMA_MODELS` with `sudo systemctl edit ollama` and give the `ollama` user access to that folder.

## Frequently asked questions

### Can I run Ollama on a VPS without a GPU?

Yes. Ollama runs on the CPU and system memory when there's no supported GPU. It works well for small models and light use, but it is much slower than a GPU.

### Why is Ollama so slow on my VPS?

Without a GPU, every word is computed on the CPU. Use a smaller model, keep questions short, and avoid running other heavy jobs at the same time. Check load with [htop](https://help.freakhosting.com/portals/other/how-to-monitor-server-resources-with-htop.md).

### How long does a model stay in memory?

5 minutes after the last request by default. Set `OLLAMA_KEEP_ALIVE` with `sudo systemctl edit ollama` to change it, or `0` to unload straight away.

### Why does Ollama get killed or the server freeze?

The model plus context needed more RAM than was free, so Linux ended the process. Use a smaller model, add [swap](https://help.freakhosting.com/portals/other/how-to-add-swap-space-on-linux.md) as a buffer, and see [fix out-of-memory killed processes](https://help.freakhosting.com/portals/other/how-to-fix-out-of-memory-killed-processes.md).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Install Docker](https://help.freakhosting.com/portals/other/how-to-install-docker.md)
>
> Needed for Open WebUI.

> [card] [Check memory usage](https://help.freakhosting.com/portals/other/how-to-check-memory-usage-on-linux.md)
>
> See if a model fits in RAM.

> [card] [Nginx reverse proxy](https://help.freakhosting.com/portals/other/how-to-set-up-nginx-as-a-reverse-proxy.md)
>
> Serve Open WebUI on your domain.

> [card] [Benchmark your VPS](https://help.freakhosting.com/portals/other/how-to-benchmark-your-vps.md)
>
> Measure CPU and memory speed.

***

> [!NOTE]
>
> **Checked against the official [Ollama Linux docs](https://docs.ollama.com/linux), [Ollama FAQ](https://docs.ollama.com/faq) and [Open WebUI docs](https://docs.openwebui.com/getting-started/quick-start/)** on 4 November 2026. Model names and sizes change as new models are released.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.