Running large language models locally with Ollama is fantastic, but what if you want to access your powerful Windows machine's Ollama instance from other devices on your network? This guide shows you how to set up Ollama on Windows 11 and make it securely accessible to any device on your Tailscale network.
Why This Setup?
By the end of this tutorial, you'll have:
- Ollama running automatically as a background service on Windows
- Secure access from any device on your Tailscale network
- No GUI clutter or manual startup required
- A robust setup that survives reboots
Prerequisites
- Windows 11 Pro with administrator access
- Tailscale account and Tailscale installed on your devices
- Basic familiarity with PowerShell
Step 1: Install Ollama on Windows
- Download the Windows installer from ollama.ai
- Run the installer and complete the setup
- Ollama will install and likely add itself to Windows startup
Step 2: Install and Configure Tailscale
- Download Tailscale from tailscale.com
- Install and authenticate with your Tailscale account
- Note your Windows machine's Tailscale IP address:
tailscale ip -4
You'll get something like 100.119.78.59
Step 3: Stop Default Ollama Processes
The Windows installer starts Ollama automatically, but it only listens on localhost by default. We need to stop all running instances:
# Check for running Ollama processes
tasklist | findstr ollama
# Kill any running processes (replace PID with actual process IDs)
taskkill /f /pid [PID_NUMBER]
Step 4: Configure Ollama for Network Access
Set the environment variable to make Ollama listen on all network interfaces:
# Set system-wide environment variable
[Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0:14434", "Machine")
Note: We're using port 14434 instead of the default 11434 to avoid conflicts, but you can use any available port.
Step 5: Create an Automatic Startup Task
Instead of running Ollama as a manual service, we'll create a scheduled task that starts automatically:
# Create scheduled task (run as administrator)
schtasks /create /tn "OllamaAutoStart" /tr "C:\Users\[YOUR_USERNAME]\AppData\Local\Programs\Ollama\ollama.exe serve" /sc onstart /ru SYSTEM
Replace [YOUR_USERNAME]
with your actual Windows username.
Step 6: Test the Setup
Start the scheduled task manually to test:
# Run the task
schtasks /run /tn "OllamaAutoStart"
# Verify it's running
tasklist | findstr ollama
You should see Ollama running in the background.
Step 7: Test Network Access via Tailscale
From another device on your Tailscale network, test the connection:
curl http://[YOUR_TAILSCALE_IP]:14434/api/tags
Replace [YOUR_TAILSCALE_IP]
with the IP address from Step 2.
If successful, you should get a JSON response listing available models.
Step 8: Disable GUI Auto-Start (Optional)
If you prefer Ollama to run invisibly without the system tray icon:
- Press
Ctrl + Shift + Esc
to open Task Manager - Go to the "Startup" tab
- Find "Ollama" and right-click → "Disable"
Step 9: Configure Other Devices
On any other device in your Tailscale network, point Ollama to your Windows server:
export OLLAMA_HOST=http://[YOUR_TAILSCALE_IP]:14434
Now commands like ollama list
, ollama pull llama2
, and ollama run llama2
will use your Windows machine instead of requiring local installation.
Troubleshooting
Port Conflicts
If you get a "bind: Only one usage of each socket address" error:
# Check what's using the port
netstat -ano | findstr :14434
# Kill conflicting processes
taskkill /f /pid [PID]
Service Won't Start
If the scheduled task fails to start Ollama:
# Check task status
schtasks /query /tn "OllamaAutoStart"
# Delete and recreate if needed
schtasks /delete /tn "OllamaAutoStart"
Environment Variable Not Working
Ensure the environment variable is set system-wide:
# Check current value
$env:OLLAMA_HOST
# Reset if needed
[Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0:14434", "Machine")
Security Considerations
- Tailscale provides encryption: All traffic between your devices is end-to-end encrypted
- No public internet exposure: Your Ollama instance is only accessible within your Tailscale network
- Access control: Use Tailscale's ACL features to restrict which devices can access your Ollama server
Benefits of This Setup
- Centralized compute: Use your powerful Windows machine's GPU from lightweight devices
- Consistent models: All devices share the same model downloads and configurations
- Resource efficiency: No need to run Ollama on every device
- Secure remote access: Access your AI models from anywhere with Tailscale
- Automatic startup: Everything works after reboots without manual intervention
Conclusion
You now have a robust, automatically-starting Ollama server that's securely accessible across all your devices via Tailscale. This setup is perfect for scenarios where you have one powerful machine but want to access AI models from laptops, phones, or other devices anywhere you have internet access.
The combination of Ollama's simplicity, Windows' scheduled tasks, and Tailscale's secure networking creates a professional-grade AI inference setup that "just works."
Top comments (1)
Thanks for this detailed guide! Could you clarify if there are any extra firewall settings needed on Windows to allow Ollama to listen on the new port, or does Tailscale handle all the necessary exceptions automatically?