{"id":15164695,"url":"https://github.com/chenycl/docker-ollama-with-https","last_synced_at":"2026-01-22T17:02:22.065Z","repository":{"id":253879508,"uuid":"844807754","full_name":"ChenYCL/docker-ollama-with-https","owner":"ChenYCL","description":"deploy service at https://localhost:11434 with ollama","archived":false,"fork":false,"pushed_at":"2024-08-22T06:53:36.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T11:02:10.540Z","etag":null,"topics":["ai","https","llama","llvm","localhost","model","ollama","translate"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChenYCL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-08-20T02:25:02.000Z","updated_at":"2024-08-22T06:53:40.000Z","dependencies_parsed_at":"2024-08-22T07:53:16.999Z","dependency_job_id":null,"html_url":"https://github.com/ChenYCL/docker-ollama-with-https","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"f6d0479ee422cb7d94591414604cc9229c2d7a08"},"previous_names":["chenycl/docker-ollama-with-https"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChenYCL%2Fdocker-ollama-with-https","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChenYCL%2Fdocker-ollama-with-https/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChenYCL%2Fdocker-ollama-with-https/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChenYCL%2Fdocker-ollama-with-https/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChenYCL","download_url":"https://codeload.github.com/ChenYCL/docker-ollama-with-https/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247865861,"owners_count":21009235,"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":["ai","https","llama","llvm","localhost","model","ollama","translate"],"created_at":"2024-09-27T03:43:24.453Z","updated_at":"2026-01-22T17:02:22.009Z","avatar_url":"https://github.com/ChenYCL.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Docker Ollama with HTTPS\n\n[![GitHub stars](https://img.shields.io/github/stars/ChenYCL/docker-ollama-with-https.svg?style=social\u0026label=Star\u0026maxAge=2592000)](https://github.com/ChenYCL/docker-ollama-with-https/stargazers/)\n[![GitHub forks](https://img.shields.io/github/forks/ChenYCL/docker-ollama-with-https.svg?style=social\u0026label=Fork\u0026maxAge=2592000)](https://github.com/ChenYCL/docker-ollama-with-https/network/)\n[![GitHub issues](https://img.shields.io/github/issues/ChenYCL/docker-ollama-with-https.svg)](https://github.com/ChenYCL/docker-ollama-with-https/issues/)\n[![GitHub license](https://img.shields.io/github/license/ChenYCL/docker-ollama-with-https.svg)](https://github.com/ChenYCL/docker-ollama-with-https/blob/main/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/ChenYCL/docker-ollama-with-https.svg)](https://github.com/ChenYCL/docker-ollama-with-https/releases/)\n\nThis project sets up Ollama with HTTPS support using Docker and Nginx.\n\n## Prerequisites\n\n- Docker\n- Docker Compose\n- OpenSSL (version 1.1.1 or higher)\n- curl\n- OrbStack(optional for MacOs)\n\n## Using Ollama with OrbStack on macOS\n\n### Prerequisites\n- macOS\n- OrbStack installed on your system\n\n### Steps\n\n1. Install OrbStack\n   Ensure you have OrbStack installed on your macOS. If not, download and install it from the official OrbStack website.\n\n2. Run Ollama Container\n   Open a terminal and execute the following command:\n   ```\n   docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama\n   ```\n   This command runs the Ollama container in detached mode, maps the necessary volume and port.\n\n3. Pull and Run a Model\n   Replace `\u003cmodelname\u003e` with your desired model (e.g., llama2, codellama, etc.):\n   ```\n   docker exec -it ollama ollama run \u003cmodelname\u003e\n   ```\n   This command pulls the specified model and runs it within the Ollama container.\n\n4. Test the Setup\n   Use the following curl command to test the Ollama API:\n   ```\n   curl https://ollama.orb.local/v1/chat/completions \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\n           \"model\": \"your_model_name\",\n           \"messages\": [\n               {\n                   \"role\": \"system\",\n                   \"content\": \"You are a helpful assistant.\"\n               },\n               {\n                   \"role\": \"user\",\n                   \"content\": \"Hello!\"\n               }\n           ]\n       }'\n   ```\n   Replace `your_model_name` with the model you pulled in step 3.\n\n### Notes\n- OrbStack automatically manages the HTTPS connection, so you can use `https://ollama.orb.local` without additional setup.\n- Ensure you have sufficient disk space for the Ollama images and models.\n- The Ollama API will be accessible at `https://ollama.orb.local:11434`.\n\nThis setup provides a straightforward way to run Ollama with HTTPS support on macOS using OrbStack, simplifying the process compared to traditional Docker setups.\n\n## Manual SetUp\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/ChenYCL/docker-ollama-with-https.git\n   cd docker-ollama-with-https\n   ```\nOr just download directly and extract file.\n \n \u003cimg width=\"424\" alt=\"image\" src=\"https://github.com/user-attachments/assets/37de4c85-6f6c-43c6-8bbb-a32b9253836f\"\u003e\n\n2. Run the setup script:\n   ```bash\n   chmod +x setup_ollama_https.sh\n   ./setup_ollama_https.sh\n   ```\n\n3. When prompted, enter the Ollama model names you want to use (comma-separated, e.g., qwen:4b,llama2:7b).\n\n4. The script will create necessary files, start Docker containers, and pull the specified models.\n\n5. To trust the self-signed certificate on your system, run:\n   ```bash\n   chmod +x install_cert.sh\n   sudo ./install_cert.sh\n   ```\n\n6. Access Ollama at `https://localhost:11434`.\n\n## Testing\n\nYou can test the setup using curl:\n\n```bash\ncurl  https://localhost:11434/v1/chat/completions \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n        \"model\": \"your_model_name\",\n        \"messages\": [\n            {\n                \"role\": \"system\",\n                \"content\": \"You are a helpful assistant.\"\n            },\n            {\n                \"role\": \"user\",\n                \"content\": \"Hello!\"\n            }\n        ]\n    }'\n```\n\nReplace `your_model_name` with one of the models you specified during setup.\n\n## Cleanup\n\nTo stop and remove the containers:\n```bash\ncd ollama_https_setup \u0026\u0026 docker-compose down\n```\n\nTo remove all generated files:\n```bash\ncd .. \u0026\u0026 rm -rf ollama_https_setup\n```\n\n## Notes and Considerations\n\n1. This setup uses a self-signed certificate, suitable for development and testing only.\n2. You may need to restart your browser or system after running `install_cert.sh`.\n3. Some applications may require additional steps to trust the certificate.\n4. The `-k` option in curl bypasses certificate verification (not recommended for production).\n5. For production, always use valid SSL certificates and proper verification.\n6. Regularly update your Ollama images and models.\n7. This setup is designed for local use. Additional security measures are needed for internet exposure.\n8. The default port is 11434. Modify `nginx.conf` and `docker-compose.yml` to change it.\n\n## Troubleshooting\n\n- If certificate trust issues occur, ensure you've run `install_cert.sh` and restarted your browser.\n- For Docker-related issues, check if Docker and Docker Compose are properly installed and running.\n- If models fail to pull, check your internet connection and ensure sufficient disk space.\n\n## Contributing\n\nContributions are welcome! Please submit issues and pull requests on the GitHub repository.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ChenYCL/docker-ollama-with-https\u0026type=Date)](https://star-history.com/#ChenYCL/docker-ollama-with-https\u0026Date)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenycl%2Fdocker-ollama-with-https","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenycl%2Fdocker-ollama-with-https","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenycl%2Fdocker-ollama-with-https/lists"}