Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

added docker usage md

LearningCircuit40990f66c506
diff --git a/docs/docker-usage-readme.md b/docs/docker-usage-readme.md
new file mode 100644
index 0000000000..9cf0d85d03
--- /dev/null
+++ b/docs/docker-usage-readme.md
@@ -0,0 +1,233 @@
+# Using Local Deep Research with Docker
+
+This guide explains how to run Local Deep Research in a Docker container, making it easier to deploy and use across different environments.
+
+## Important: Ollama Configuration Requirement
+
+**Before starting**: By default, Ollama only listens on localhost (127.0.0.1), which prevents Docker containers from connecting to it. You'll need to configure Ollama to accept external connections:
+
+```bash
+# Stop any running Ollama instance first
+sudo systemctl stop ollama # if using systemd
+# or
+pkill ollama # alternative method
+
+# Start Ollama with external access enabled
+OLLAMA_HOST=0.0.0.0 ollama serve
+```
+
+This setting makes Ollama listen on all network interfaces instead of just localhost.
+
+## Quick Start
+
+```bash
+# Run with default settings (connects to Ollama running on the host)
+docker run --network=host \
+ -e LDR_LLM__PROVIDER="ollama" \
+ -e LDR_LLM__MODEL="mistral" \
+ local-deep-research
+```
+
+Then access the web interface at http://localhost:5000
+
+## Building the Docker Image
+
+You can build the Docker image yourself:
+
+```bash
+# Clone the repository
+git clone https://github.com/LearningCircuit/local-deep-research
+cd local-deep-research
+
+# Build the Docker image
+docker build -t local-deep-research .
+```
+
+## Container Configuration
+
+### Environment Variables
+
+Local Deep Research uses environment variables with a specific format to override settings in `settings.toml`:
+
+```
+LDR_SECTION__SETTING=value
+```
+
+Where:
+- `SECTION` corresponds to a section in settings.toml (like `web`, `llm`, `search`, etc.)
+- `SETTING` is the specific setting name
+- Note the double underscore (`__`) between section and setting
+
+### Common Environment Variables
+
+#### Web Interface
+```bash
+-e LDR_WEB__PORT=5000 # Web server port
+-e LDR_WEB__HOST="0.0.0.0" # Web server host
+```
+
+#### LLM Settings
+```bash
+-e LDR_LLM__PROVIDER="ollama" # LLM provider (ollama, openai, anthropic, etc.)
+-e LDR_LLM__MODEL="mistral" # Model name
+-e LDR_LLM__TEMPERATURE=0.7 # Temperature for generation
+```
+
+#### Search Settings
+```bash
+-e LDR_SEARCH__TOOL="auto" # Search engine (auto, wikipedia, arxiv, etc.)
+-e LDR_SEARCH__ITERATIONS=2 # Number of research cycles
+```
+
+### Container Networking
+
+#### Host Network (Recommended)
+```bash
+docker run --network=host local-deep-research
+```
+This shares the host's network with the container, allowing direct access to services running on the host (like Ollama).
+
+#### Port Mapping
+```bash
+docker run -p 5000:5000 local-deep-research
+```
+This exposes the web interface on port 5000.
+
+## Using with Ollama
+
+### Host Network Mode (Simplest)
+```bash
+docker run --network=host \
+ -e LDR_LLM__PROVIDER="ollama" \
+ -e LDR_LLM__MODEL="mistral" \
+ local-deep-research
+```
+
+### Remote Ollama Instance
+If Ollama is running on another machine, configure it to accept remote connections:
+
+1. On the Ollama machine, start Ollama with:
+ ```bash
+ OLLAMA_HOST=0.0.0.0 ollama serve
+ ```
+
+2. Run the container with:
+ ```bash
+ docker run -p 5000:5000 \
+ -e OLLAMA_BASE_URL="http://ollama-machine-ip:11434" \
+ -e LDR_LLM__PROVIDER="ollama" \
+ -e LDR_LLM__MODEL="mistral" \
+ local-deep-research
+ ```
+
+## Persistent Storage
+
+To persist configuration and research data:
+
+```bash
+docker run --network=host \
+ -v ./ldr-data:/root/.config/local_deep_research \
+ -e LDR_LLM__PROVIDER="ollama" \
+ -e LDR_LLM__MODEL="mistral" \
+ local-deep-research
+```
+
+## Using with Cloud LLM Providers
+
+To use cloud-based LLM providers instead of Ollama:
+
+### OpenAI
+
+```bash
+docker run -p 5000:5000 \
+ -e LDR_LLM__PROVIDER="openai" \
+ -e LDR_LLM__MODEL="gpt-4o" \
+ -e OPENAI_API_KEY="your-api-key-here" \
+ local-deep-research
+```
+
+### Anthropic
+
+```bash
+docker run -p 5000:5000 \
+ -e LDR_LLM__PROVIDER="anthropic" \
+ -e LDR_LLM__MODEL="claude-3-opus-20240229" \
+ -e ANTHROPIC_API_KEY="your-api-key-here" \
+ local-deep-research
+```
+
+### Using with OpenRouter or compatible API
+
+```bash
+docker run -p 5000:5000 \
+ -e LDR_LLM__PROVIDER="openai_endpoint" \
+ -e LDR_LLM__MODEL="your-model-name" \
+ -e LDR_LLM__OPENAI_ENDPOINT_URL="https://openrouter.ai/api/v1" \
+ -e OPENAI_ENDPOINT_API_KEY="your-api-key-here" \
+ local-deep-research
+```
+
+## Docker Compose Example
+
+For a complete setup with persistent storage:
+
+```yaml
+version: '3'
+services:
+ local-deep-research:
+ image: local-deep-research:latest
+ network_mode: host # For easy Ollama access
+ volumes:
+ - ./ldr-data:/root/.config/local_deep_research
+ environment:
+ - LDR_LLM__PROVIDER=ollama
+ - LDR_LLM__MODEL=mistral
+ - LDR_SEARCH__TOOL=auto
+ - LDR_SEARCH__ITERATIONS=3
+ restart: unless-stopped
+```
+
+Save this as `docker-compose.yml` and run with:
+
+```bash
+docker-compose up -d
+```
+
+## Troubleshooting
+
+### Connection Error with LLM Service
+
+If you encounter "Connection error with LLM service":
+
+1. Ensure Ollama is running on the host
+2. Verify Ollama is started with `OLLAMA_HOST=0.0.0.0`
+3. Use `--network=host` instead of port mapping
+4. Check that your Ollama model is installed:
+ ```bash
+ ollama list
+ ```
+5. If connecting to a remote Ollama, make sure it's configured with `OLLAMA_HOST=0.0.0.0`
+
+### Container Fails to Start
+
+If the container fails to start, check:
+
+1. Docker logs:
+ ```bash
+ docker logs <container-id>
+ ```
+2. Ensure no port conflicts if using `-p 5000:5000`
+3. Try running with increased memory:
+ ```bash
+ docker run --memory=2g --network=host local-deep-research
+ ```
+
+### Testing Connectivity to Ollama
+
+To test if your Docker container can reach Ollama:
+
+```bash
+docker run --rm curlimages/curl curl -v http://your-ollama-ip:11434/api/tags
+```
+
+This should return a JSON list of available Ollama models.