{"id":27629975,"url":"https://github.com/ffarps/ollama-openwebui","last_synced_at":"2025-04-23T16:16:55.358Z","repository":{"id":289314033,"uuid":"970816258","full_name":"ffarps/ollama-openwebui","owner":"ffarps","description":"Secure Local Deployment: Ollama + Open WebUI","archived":false,"fork":false,"pushed_at":"2025-04-22T16:14:52.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T16:16:50.323Z","etag":null,"topics":["ollama","openwebui"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffarps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-22T15:22:06.000Z","updated_at":"2025-04-22T16:14:56.000Z","dependencies_parsed_at":"2025-04-22T17:33:54.977Z","dependency_job_id":"29639aef-7bdc-4344-ade7-a8e764405092","html_url":"https://github.com/ffarps/ollama-openwebui","commit_stats":null,"previous_names":["ffarps/ollama-openwebui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffarps%2Follama-openwebui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffarps%2Follama-openwebui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffarps%2Follama-openwebui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffarps%2Follama-openwebui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffarps","download_url":"https://codeload.github.com/ffarps/ollama-openwebui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468277,"owners_count":21435453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ollama","openwebui"],"created_at":"2025-04-23T16:16:54.792Z","updated_at":"2025-04-23T16:16:55.352Z","avatar_url":"https://github.com/ffarps.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Local Deployment: Ollama + Open WebUI\n\nThis guide covers a secure and reliable setup for [Ollama](https://ollama.com) and [Open WebUI](https://github.com/open-webui/open-webui) with Docker.\n\n---\n\n## 1. Preparation\n\n- **Update OS and Docker:**\n  - For Arch: `sudo pacman -Syu`\n  - For Ubuntu/Debian: `sudo apt update \u0026\u0026 sudo apt upgrade`\n  - Update Docker (if needed): `sudo pacman -Syu docker`\n\n- **Install Ollama:**  \n  `curl -fsSL https://ollama.com/install.sh | sh`\n\n- **(Recommended) Create non-root user for Ollama:**\n  ```bash\n  sudo useradd -r -m -d /var/lib/ollama -s /usr/bin/nologin ollama\n  sudo chown -R ollama:ollama /var/lib/ollama\n  ```\n\n## 2. Restrict Ollama Network Access\n\n- By default, Ollama listens on `127.0.0.1` (localhost).  \n- For Docker access, set Ollama to `0.0.0.0` and restrict with a firewall.\n\n  Example (UFW):\n  ```bash\n  sudo ufw allow from 127.0.0.1 to any port 11434\n  sudo ufw allow from 172.17.0.0/16 to any port 11434\n  sudo ufw deny 11434\n  ```\n\n## 3. Configure Ollama systemd Service\n\n- Find Ollama’s service file (`/usr/lib/systemd/system/ollama.service` or `/etc/systemd/system/ollama.service`):\n  The path of the file is here\n  ```bash\n  sudo systemctl status ollama\n  ```\n- Edit the file:  \n  Add above `ExecStart`:\n  ```\n  Environment=\"OLLAMA_HOST=0.0.0.0\"\n  ```\n- Reload and restart:\n  ```bash\n  sudo systemctl daemon-reload\n  sudo systemctl restart ollama\n  ```\n- Verify:\n  ```bash\n  ss -tuln | grep 11434\n  ```\n\n## 4. Test Ollama\n\n- From host:  \n  `curl http://localhost:11434`\n- From Docker:  \n  `docker run --rm curlimages/curl:latest curl http://host.docker.internal:11434/api/version`\n\n## 5. Run Open WebUI\n\n- **Set secret key:**  \n  `export WEBUI_SECRET_KEY=$(openssl rand -hex 32)`\n\n- **(Optional) Update Open WebUI:**  \n  `docker pull ghcr.io/open-webui/open-webui:latest`\n\n- **Run:**  \n  ```bash\n  docker run -d -p 3000:8080 \\\n    --add-host=host.docker.internal:host-gateway \\\n    -e OLLAMA_BASE_URL=http://host.docker.internal:11434 \\\n    -e WEBUI_SECRET_KEY=$WEBUI_SECRET_KEY \\\n    -v open-webui:/app/backend/data \\\n    --name open-webui \\\n    --restart always \\\n    ghcr.io/open-webui/open-webui:latest\n  ```\n- Access: [http://localhost:3000](http://localhost:3000)\n\n## 6. Secure Open WebUI\n\n- Change default admin password after first login.\n- Never expose port 3000 to the public internet.\n- For remote access, use VPN or SSH tunnel.\n\n## 7. Monitor Logs\n\n- Open WebUI: `docker logs -f open-webui`\n- Ollama: `sudo journalctl -u ollama`\n\n## 8. Troubleshooting\n\n- Ensure Ollama listens on `0.0.0.0`\n- In Open WebUI, use `http://host.docker.internal:11434` for Ollama\n- Check firewall rules\n- Test with `curl` from both host and Docker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffarps%2Follama-openwebui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffarps%2Follama-openwebui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffarps%2Follama-openwebui/lists"}