WORKLOAD DOCUMENTATION

Ollama VPS Setup and Management

Run local models and use the Ollama API on Ubuntu KVM. Size memory, secure access and back up model data.

Overview, platform and installed software

This guide covers a provisioned Ubuntu 24.04 LTS KVM Workload. Check the version installed on your server.

Ollama runs as ollama.service. The delivered API binds to 127.0.0.1:11434. Choose a model for CPU inference and available RAM.

Choose resources, order and sign in

Public configuration baseline: 2 vCPU, 8 GB RAM and 25 GB storage. Allow headroom for your application and data.

Select the Workload and region in the Builder and confirm availability and the quote. After provisioning, connect via SSH using the access details for your service.

Initial configuration and practical examples

Use ollama list to inspect models, ollama pull to download, ollama run to prompt and ollama rm to remove a model. Monitor disk space and allow RAM for context and Ubuntu.

Application management, settings and security

Check systemctl status ollama and journalctl -u ollama. Inspect settings with systemctl cat ollama. For remote development, forward the loopback port through SSH. Keep the API off public interfaces.

Updates, backups and recovery

Back up custom Modelfiles, overrides and model data if re-downloading is impractical. Record model tags. Review upstream changes before updating and verify a known prompt and local API request after restoration.

Troubleshooting, limitations and FAQ

A model fitting on disk does not establish that it fits in RAM. Start with a small quantized model and observe memory use and latency. This VPS guide assumes CPU inference.

Getting Started

  1. Check Ollama

    Connect to your VPS over SSH and check the installed version and available memory.

    ollama --version
    free -h
  2. Download a model that fits your RAM

    Start with the small Llama 3.2 1B model. Leave RAM available for Ubuntu and the model context. Larger models and longer prompts use more memory than the download size suggests.

    ollama pull llama3.2:1b
  3. Run the model

    Try a prompt in your SSH session. Enter /bye to leave the chat.

    ollama run llama3.2:1b
  4. Try the local API

    Run this request on the VPS. The API listens on the server loopback address.

    curl --fail-with-body http://127.0.0.1:11434/api/generate \
      -H 'Content-Type: application/json' \
      -d '{"model":"llama3.2:1b","prompt":"Say hello.","stream":false}'