RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /How-to
  5. /How to configure the Ollama serve port for network access
HOW-TO · INF

How to configure the Ollama serve port for network access

intermediate·10 min·By Eruo Fredoline
Target environment
Ubuntu 24.04 · Ollama 0.4.x
PREREQUISITES

Ollama installed, command-line terminal access, basic networking knowledge

What this does

Rebinds the Ollama API server from localhost-only to a network-accessible address and port. After this guide remote clients will be able to reach the Ollama API over the network.

Steps

  1. Set the OLLAMA_HOST environment variable and restart. Changes the bind address to accept external connections.

    export OLLAMA_HOST=0.0.0.0:11434
    ollama serve
    

    Expected output: Server starts, listening on all interfaces.

  2. Configure the systemd service to persist the change. Adds the environment variable to the unit file.

    sudo mkdir -p /etc/systemd/system/ollama.service.d
    sudo tee /etc/systemd/system/ollama.service.d/override.conf << 'EOF'
    [Service]
    Environment=OLLAMA_HOST=0.0.0.0:11434
    EOF
    sudo systemctl daemon-reload && sudo systemctl restart ollama
    
  3. Open the firewall port. Allows inbound TCP traffic on the Ollama port.

    sudo ufw allow 11434/tcp && sudo ufw reload
    

    Expected output: Rule added and Rules updated.

  4. Test remote access. Sends an API request from another machine to confirm the service is reachable.

    curl http://<server-ip>:11434/api/tags
    

    Expected output: A JSON array of available models.

Verification

curl -s http://localhost:11434/api/tags | python3 -m json.tool
# Expected: valid JSON with non-empty "models" array

Common failures

  • connection refused - Firewall blocking the port; verify with sudo ufw status or check cloud security groups.
  • address already in use - Another process is on port 11434; use sudo lsof -i :11434 to identify it.
  • OLLAMA_HOST not respected - The daemon may be started by systemd which ignores the shell export; always use the override.conf method for systemd setups.
  • model unreachable after config - Client is using an IP that the server is not bound to; verify with ss -tlnp | grep ollama.

Operator checkpoint

Before treating this as solved, write down the local runtime, model or package version, hardware/backend if relevant, and the verification output. This keeps the guide useful as a Will-It-Run style decision instead of a one-off command transcript.

Related guides

  • How to run a model in the background as a persistent service
  • How to verify model integrity after downloading
RELATED GUIDES
INF
How to run a model in the background as a persistent service
INF
How to verify model integrity after downloading
← All how-to guidesCourses →