A low-cost CPU virtual machine can provide an always-on Ollama endpoint for small models and lightweight automation. On September 13, 2026, DigitalOcean priced a Basic Droplet with 2 shared vCPUs and 4 GiB RAM at $24 per month, and 4 shared vCPUs with 8 GiB at $48.

Match the Droplet to the Model

Four GiB of RAM is restrictive for a general-purpose Linux server running an LLM. A model’s download size is not its complete runtime footprint: the operating system, Ollama process, model weights, key-value cache, and temporary buffers all need memory. A 4 GiB VM is better suited to a very small model or an API experiment than a 7B–8B assistant.

An 8 GiB VM offers more room, but shared vCPUs can have variable performance and CPU inference may be slow. DigitalOcean describes Basic Droplets as shared-CPU machines for bursty workloads that can tolerate variable CPU access. If predictable sustained compute matters, compare dedicated-CPU offerings and their higher prices.

An expected token rate is meaningful only when it comes from the exact model, quantization, context length, runner version, and plan being considered. Shared-CPU processor generation and host contention add more variation.

Pick a Small Model First

Start with the smallest model that can perform the task. A 3B-class model is a more realistic first test on an 8 GiB CPU VM than assuming an 8B or 13B model will be pleasant. Pull an explicit model tag so a future default does not silently change the test:

ollama pull llama3.2:3b
ollama run llama3.2:3b

Measure both accuracy and latency on your own prompts. If the model cannot pass the task, upgrading the VM may improve speed but will not repair the model’s capability.

Create the VM Conservatively

Choose a current LTS Linux image and enable the provider’s monitoring and backups only after understanding their separate costs. Add an SSH key during creation; do not depend on password login. Apply system updates before installing application software.

On Ubuntu or Debian, a basic host setup might include:

sudo apt update
sudo apt upgrade
sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable

Also create a DigitalOcean Cloud Firewall if you want enforcement outside the VM. Permit SSH only from trusted source addresses when practical. A host firewall and a cloud firewall serve different layers; document both so a future operator does not remove the only protection accidentally.

Install Ollama from Its Official Source

Use the installation command shown on Ollama’s official download page at the time of setup. A common Linux path is:

curl -fsSL https://ollama.com/install.sh -o ollama-install.sh
less ollama-install.sh
sh ollama-install.sh

Downloading first makes the script available for inspection instead of piping changing remote content directly into a shell. After installation:

ollama --version
systemctl status ollama

Record the version with any benchmark results.

Do Not Expose Port 11434 to the Internet

Ollama binds to 127.0.0.1:11434 by default. Keep it that way for a single-user setup. Publishing the API directly on 0.0.0.0 without authentication would let anyone who can reach the port consume resources and interact with the model service.

The simplest remote access method is an SSH tunnel from your computer:

ssh -N -L 11434:127.0.0.1:11434 your-user@your-server

While that session is connected, local software can call http://127.0.0.1:11434 and SSH carries the traffic to the server. Test it with:

curl http://127.0.0.1:11434/api/tags

For several trusted devices, a private overlay network can be more convenient. Bind only to the private interface and add authentication in front of the API if the network includes users or devices you do not fully trust. TLS protects transport; it does not replace authorization.

Measure the Service You Actually Built

Send a non-streaming API request and retain the JSON. Ollama reports model load, prompt evaluation, and output evaluation separately:

curl -s http://127.0.0.1:11434/api/generate \
  -d '{
    "model": "llama3.2:3b",
    "prompt": "Summarize the following deployment note in five bullets: ...",
    "stream": false,
    "options": {"num_ctx": 2048, "temperature": 0}
  }' > result.json

Test at least:

  • cold start after the model is unloaded;
  • a warm request;
  • the longest prompt you expect;
  • concurrent requests if more than one client will use it; and
  • failure behavior when memory is exhausted.

Ollama’s keep_alive request value or OLLAMA_KEEP_ALIVE setting controls how long models remain loaded. Keeping a model resident reduces later load time but holds memory. Choose intentionally rather than disabling the feature based on an unsupported assumption.

Add Operational Basics

An internet-hosted model server needs the same maintenance as any other public-cloud workload even if the model API itself is private:

  • install security updates;
  • restrict and rotate SSH credentials;
  • monitor disk, RAM, and CPU saturation;
  • set a provider budget alert;
  • take only the backups you have tested restoring;
  • review firewall rules after changes; and
  • delete the Droplet and associated billable resources when the experiment ends.

A sleeping laptop is unavailable, but a cloud VM creates a different set of responsibilities and a recurring bill. The useful trade is availability and centralized access—not a guarantee of speed or a fixed $24 price.

DigitalOcean Cost Snapshot

Prices shown for September 13, 2026:

DigitalOcean Basic configuration Listed monthly price
2 shared vCPUs / 4 GiB RAM $24
4 shared vCPUs / 8 GiB RAM $48

Always verify the live DigitalOcean Droplet pricing before purchase.

Sources