Choose the model before the server
Ollama simplifies local model execution, but it does not remove model resource requirements. Estimate memory, disk and accelerator needs from the exact model and quantization you plan to run. A small CPU-only test and a production inference service are different workloads.
Safe network design
Ollama listens locally by default. Keep that boundary unless you have added an authenticated application or a protected reverse proxy. Do not publish port 11434 directly to the internet.
Operational checklist
Sources and next steps
Use the official Ollama Linux documentation and quickstart as the source of truth. If you need a browser interface, continue with the Open WebUI deployment guide.
先选模型,再选服务器
Ollama 简化了本地模型运行,但不会消除模型本身的资源要求。应根据准备运行的具体模型和量化版本估算内存、硬盘和加速卡需求。小型 CPU 测试与生产推理服务是完全不同的负载。
安全的网络设计
Ollama 默认仅在本机监听。除非已经通过带认证的应用或受保护的反向代理接入,否则应保持这一边界。不要把 11434 端口直接暴露到公网。
运维检查
资料来源与下一步
请以 Ollama 官方 Linux 文档 和 快速入门 为准。需要浏览器界面时,可继续阅读 Open WebUI 部署教程。
Deployment steps部署步骤
Confirm the host architecture and capacity确认主机架构与资源
Confirm the Linux architecture, free disk and available memory. Select a model that fits the machine rather than assuming every model will run well.
确认 Linux 架构、可用硬盘和内存,并选择适合当前机器的模型,不要假设所有模型都能流畅运行。
uname -m
free -h
df -hInstall Ollama安装 Ollama
Use the current installation command from the official Linux documentation, then inspect the installed version.
使用官方 Linux 文档中的当前安装命令,并在完成后检查安装版本。
curl -fsSL https://ollama.com/install.sh | sh
ollama --versionCheck the service检查系统服务
On systemd-based distributions, confirm the service is active and inspect its recent logs if startup fails.
在使用 systemd 的发行版中确认服务已启动;如果启动失败,请查看近期日志。
systemctl status ollama --no-pager
journalctl -u ollama --no-pager -n 100Run a first model运行首个模型
Run a model listed in the official library. The first launch downloads model files, so time and disk usage vary.
运行官方模型库中的模型。首次启动会下载模型文件,因此耗时和硬盘占用会因模型而异。
ollama run gemma3Verify the local API验证本地 API
Verify the API from the same host. Keep the port private and connect remote applications through an authenticated layer.
从同一主机验证 API。保持端口仅内部可用,远程应用应通过带认证的服务层连接。
curl http://127.0.0.1:11434/api/generate -d '{"model":"gemma3","prompt":"Hello","stream":false}'