Skip to main content
Version: 0.5.6

Ollama on Aruba Cloud

Deploy Ollama — a local LLM inference platform — on Aruba Cloud using Terraform and cloud-init. Runs large language models (LLama, Mistral, Gemma, etc.) directly on CPU without requiring a GPU.

Provider version: arubacloud/arubacloud ~> 1.0 | Terraform: ≥ 1.9


Introduction​

Ollama makes running LLMs locally as simple as ollama run llama3.2. It provides an OpenAI-compatible REST API, enabling drop-in replacement for OpenAI in existing applications. This example provisions:

  • Ollama installed via the official install script as a systemd service
  • REST API bound to all interfaces (port 11434), restricted to api_cidr
  • Optional model pre-pulling at bootstrap time

Resource warning: LLMs are memory-intensive. A 7B model requires ~4–6 GB free RAM, a 13B model ~8–10 GB, and a 70B model ~40+ GB. Plan your vm_flavor accordingly.


Architecture Overview​


Infrastructure Created​

ResourceName patternDescription
arubacloud_projectollama-prodProject container
arubacloud_vpcollama-prod-vpcVirtual Private Cloud
arubacloud_subnetollama-prod-subnetBasic subnet
arubacloud_securitygroupollama-prod-vm-sgSecurity group
arubacloud_securityruleollama-prod-vm-sshSSH ingress
arubacloud_securityruleollama-prod-vm-apiOllama API TCP 11434
arubacloud_elasticipollama-prod-vm-eipVM public IP
arubacloud_blockstorageollama-prod-boot100 GB boot disk (Performance)
arubacloud_keypairollama-prod-keypairSSH public key
arubacloud_cloudserverollama-prod-vmCloudServer VM

Estimated Monthly Cost​

ResourceSpecEst. cost/mo
CloudServer VMCSO8A16 — 8 vCPU / 16 GB~€55
Boot disk100 GB Performance~€15
Elastic IP—~€3
Total~€73/mo

Larger models require upgrading to a VM with more RAM (and correspondingly higher cost).


Requirements​

  • Terraform ≥ 1.9
  • ArubaCloud Terraform Provider ~> 1.0
  • An ArubaCloud account with OAuth2 API credentials
  • An SSH key pair

Variables​

Required​

VariableDescription
arubacloud_client_idArubaCloud OAuth2 client ID
arubacloud_client_secretArubaCloud OAuth2 client secret
ssh_public_keySSH public key content

Optional​

VariableDefaultDescription
app_name"ollama"Short name used in all resource names
environment"prod"Environment label
location"ITBG-Bergamo"ArubaCloud region
zone"ITBG-1"Availability zone
billing_period"Hour""Hour" or "Month"
vm_flavor"CSO8A16"CloudServer flavor
vm_image"LU22-001"Boot disk image (Ubuntu 22.04 LTS)
vm_disk_size_gb100Boot disk size in GB (min 50 GB)
ssh_cidr"0.0.0.0/0"CIDR for SSH
api_cidr"0.0.0.0/0"CIDR for REST API port 11434 — restrict to your app servers
preload_models[]Models to pull at bootstrap (e.g. ["llama3.2"])

Outputs​

OutputDescription
ollama_urlOllama REST API URL
vm_public_ipPublic IP address of the VM
ssh_commandSSH command to connect to the VM
health_checkcurl command to list available models

Deployment Instructions​

1. Clone and navigate​

git clone https://github.com/arubacloud/terraform-arubacloud-examples.git
cd terraform-arubacloud-examples/ollama

2. Configure variables​

cp terraform.tfvars.example terraform.tfvars

Restrict API access and optionally pre-pull models:

api_cidr = "10.0.0.0/8" # your application server CIDR
preload_models = ["llama3.2", "nomic-embed-text"]

3. Deploy​

terraform init
terraform plan
terraform apply

Bootstrap takes 2–5 minutes (plus model pull time — a 7B model is ~4 GB).

4. Verify​

curl http://$(terraform output -raw vm_public_ip):11434/api/tags

5. Run a model​

ssh ubuntu@$(terraform output -raw vm_public_ip)
ollama run llama3.2

Available Models​

# Browse all available models
ollama list

# Popular models
ollama pull llama3.2 # Meta Llama 3.2 3B — fast, low RAM
ollama pull llama3.1 # Meta Llama 3.1 8B — balanced
ollama pull mistral # Mistral 7B
ollama pull codellama # Code-optimised LLaMA
ollama pull nomic-embed-text # Text embedding model (for RAG)
ollama pull gemma2 # Google Gemma 2 9B

Security Recommendations​

  1. Always restrict api_cidr. Ollama has no built-in authentication. An open port 11434 allows anyone to run models and exhaust your server resources.

References​