SOP: Ollama Installation and Configuration
1. Purpose
This SOP provides instructions for installing and configuring Ollama on a Linux server, enabling remote access, verifying the service, and downloading an AI model.
Recommended SOP Structure
- Purpose
- Scope
- Prerequisites
- Hardware Requirements
- Operating System Requirements
- GPU Verification
- Install Ollama
- Configure Ollama Service
- Configure External Access
- Configure Firewall
- Download Models
- Verify Installation
- Service Administration
- Model Management
- Upgrading Ollama
- Backup & Recovery
- Security Hardening
- Monitoring & Logging
- Troubleshooting
- References
Additional Sections
1. Hardware Requirements
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 Cores | 8–16 Cores |
| Memory | 16 GB | 64 GB+ |
| Disk | 100 GB SSD | 1 TB NVMe SSD |
| GPU | Optional | NVIDIA RTX/A100/L40/H100 |
| Network | 1 Gbps | 10 Gbps |
2. Verify GPU
Before installing models, verify GPU availability.
NVIDIA Driver
nvidia-smiExpected output:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 580.xx |
| Driver Version |
| CUDA Version |
+-----------------------------------------------------------------------------+Verify CUDA
nvcc --versionor
cat /usr/local/cuda/version.txt3. Verify Ollama Uses GPU
Run
ollama run gemma4:12bOpen another terminal
watch -n 1 nvidia-smiThe Ollama process should appear using GPU memory.
4. Configure External Access
Instead of editing the system service directly:
Create an override:
sudo systemctl edit ollamaAdd
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"Reload
sudo systemctl daemon-reload
sudo systemctl restart ollamaThis approach survives package upgrades better than modifying the service file directly.
5. Configure Firewall
Ubuntu (UFW)
sudo ufw allow from 10.0.0.0/8 to any port 11434or
sudo ufw allow from 192.168.0.0/16 to any port 11434RedHat
sudo firewall-cmd \
--permanent \
--add-port=11434/tcp
sudo firewall-cmd --reloadNever expose port 11434 directly to the Internet.
6. Verify API
Health check
curl http://localhost:11434List installed models
curl http://localhost:11434/api/tagsGenerate text
curl http://localhost:11434/api/generate \
-d '{
"model":"gemma4:12b",
"prompt":"Hello"
}'7. Download Models
Examples
ollama pull gemma4:12b
ollama pull qwen3:14b
ollama pull llama3.3:70b
ollama pull mistral:latestList models
ollama listDelete model
ollama rm gemma4:12b8. Service Administration
Status
sudo systemctl status ollamaRestart
sudo systemctl restart ollamaStop
sudo systemctl stop ollamaStart
sudo systemctl start ollamaEnable
sudo systemctl enable ollamaLogs
journalctl -u ollama -f9. Monitoring
CPU
htopGPU
watch -n1 nvidia-smiMemory
free -hDisk
df -h10. Upgrade Ollama
curl -fsSL https://ollama.com/install.sh | shRestart
sudo systemctl restart ollamaVerify version
ollama --version11. Backup
Models are stored under
/usr/share/ollamaor
~/.ollamadepending on installation.
Back up
tar czvf ollama-models.tar.gz ~/.ollama12. Security Hardening
Recommended enterprise controls:
- Restrict API access to internal networks only.
- Require authentication through a reverse proxy (e.g., NGINX or Traefik).
- Use TLS for all remote connections.
- Log all API requests.
- Limit model download permissions to administrators.
- Regularly update Ollama and AI models.
- Monitor GPU utilization and disk consumption.
- Restrict SSH access using MFA.
- Maintain OS patching.
- Review service logs periodically.
13. Reverse Proxy Example (NGINX)
server {
listen 443 ssl;
server_name ollama.company.com;
ssl_certificate /etc/ssl/certs/fullchain.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
location / {
proxy_pass http://127.0.0.1:11434;
}
}Benefits:
- HTTPS
- Authentication
- Rate limiting
- Centralized logging
- SSO integration (OIDC/SAML via an authentication gateway)
14. Enterprise Deployment Recommendations
For organizations running multiple AI workloads, consider:
- Dedicated GPU servers for Ollama inference
- Docker or Kubernetes deployment for easier lifecycle management
- Reverse proxy with Microsoft Entra ID or Google Workspace SSO
- Prometheus and Grafana for metrics and dashboards
- Centralized logging with ELK or OpenSearch
- Load balancing across multiple Ollama nodes
- Internal model registry and version control
- Integration with Open WebUI, LibreChat, or custom applications via the Ollama REST API
- Network segmentation and firewall policies to isolate AI infrastructure