Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AsyncFuncAI/deepwiki-open/llms.txt

Use this file to discover all available pages before exploring further.

Once the basic deployment is running, several environment variables let you tune DeepWiki’s behaviour for production environments: custom ports, structured logging, alternative config directories, enterprise API endpoints, and self-signed certificate support. This page covers each option with concrete examples.

Custom port configuration

By default the FastAPI backend listens on port 8001 and the Next.js frontend on port 3000. Change PORT and SERVER_BASE_URL together whenever you need a different backend port — the frontend reads SERVER_BASE_URL to know where to send API requests.
PORT=9000
SERVER_BASE_URL=http://localhost:9000

Custom config directory

By default, DeepWiki reads generator.json, embedder.json, and repo.json from api/config/. Set DEEPWIKI_CONFIG_DIR to point to a different directory — useful when you want to maintain a shared config volume or override settings without modifying the image.
DEEPWIKI_CONFIG_DIR=/etc/deepwiki/config
The three expected files in that directory are:
FilePurpose
generator.jsonLLM provider definitions, models, and generation parameters
embedder.jsonEmbedding model selection and RAG retriever settings
repo.jsonFile filters, repository size limits, and processing rules

Logging configuration

DeepWiki uses Python’s standard logging module. Two environment variables control logging output:
VariableDefaultDescription
LOG_LEVELINFOVerbosity: DEBUG, INFO, WARNING, ERROR, or CRITICAL
LOG_FILE_PATHapi/logs/application.logFile path for log output
LOG_LEVEL=DEBUG
LOG_FILE_PATH=api/logs/debug.log
When running with Docker Compose, the ./api/logs directory on your host is bind-mounted to /app/api/logs inside the container, so log files persist across restarts and are accessible from the host.
LOG_FILE_PATH must resolve to a path within the project’s api/logs directory. The application enforces this restriction to prevent path traversal attacks and unauthorised writes to arbitrary filesystem locations. In production, also secure the api/logs directory with appropriate filesystem permissions so only the DeepWiki process can write to it.

adalflow data directory

All cloned repositories, vector embeddings, and generated wiki cache are stored under ~/.adalflow on the host. When running with Docker, mount this directory as a volume to persist data across container restarts:
-v ~/.adalflow:/root/.adalflow
The directory layout is:
SubdirectoryContents
~/.adalflow/repos/Cloned repository source code
~/.adalflow/databases/FAISS vector indexes for each repo
~/.adalflow/wikicache/Cached generated wiki pages

Enterprise private channel configuration

The OPENAI_BASE_URL variable overrides the base URL used by the OpenAI client. This is designed for enterprise deployments that route requests through a private API gateway, a self-hosted LLM proxy, or an OpenAI-compatible third-party service.
OPENAI_API_KEY=your_enterprise_key
OPENAI_BASE_URL=https://api.internal.example.com/v1
To use an OpenAI-compatible embedding service alongside a private endpoint, replace api/config/embedder.json with the contents of api/config/embedder.openai_compatible.json.bak, then set the two variables above. DeepWiki substitutes environment variable placeholders in the config file automatically at startup.

Self-signed certificate setup

In enterprise environments where internal services use self-signed or private CA certificates, the Docker build accepts a CUSTOM_CERT_DIR build argument. Certificates placed in that directory are installed into the system trust store during the image build via update-ca-certificates.
1

Create a certificate directory

mkdir certs
2

Copy your certificate files

Place .crt or .pem files into the directory. All files in the directory are processed.
cp /path/to/internal-ca.crt certs/
3

Build the image with the certificate directory

docker build .

Authorization mode

Authorization mode restricts wiki generation to users who present a valid code. Enable it when you want to share your DeepWiki instance with a limited group without exposing unrestricted access.
DEEPWIKI_AUTH_MODE=true
DEEPWIKI_AUTH_CODE=your_secret_code
When DEEPWIKI_AUTH_MODE is true or 1, the frontend displays an authorization code input field. Generation and cache deletion are blocked without the correct code. Note that this protects the frontend flow but does not fully restrict direct backend API calls.

Multi-language support

DeepWiki can generate wiki content in multiple languages. The supported language codes are defined in api/config/lang.json. You select the output language via the language selector in the UI or by passing a language field in the API request. No additional environment variables are needed.

Full environment variable reference

VariableDefaultDescription
GOOGLE_API_KEYGoogle Gemini API key
OPENAI_API_KEYOpenAI API key
OPENAI_BASE_URLCustom base URL for OpenAI client (enterprise channels)
OPENROUTER_API_KEYOpenRouter API key
AZURE_OPENAI_API_KEYAzure OpenAI API key
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint URL
AZURE_OPENAI_VERSIONAzure OpenAI API version
OLLAMA_HOSThttp://localhost:11434Ollama server URL
DEEPWIKI_EMBEDDER_TYPEopenaiEmbedder: openai, google, ollama, or bedrock
DEEPWIKI_CONFIG_DIRapi/configPath to JSON config files
PORT8001Backend API port
SERVER_BASE_URLhttp://localhost:8001Backend API base URL (read by frontend)
LOG_LEVELINFOLogging verbosity
LOG_FILE_PATHapi/logs/application.logLog file destination
DEEPWIKI_AUTH_MODEfalseEnable authorization mode (true or 1)
DEEPWIKI_AUTH_CODESecret code required when auth mode is enabled
AWS_ACCESS_KEY_IDAWS credentials for Bedrock
AWS_SECRET_ACCESS_KEYAWS credentials for Bedrock
AWS_SESSION_TOKENAWS STS session token for Bedrock
AWS_REGIONus-east-1AWS region for Bedrock
AWS_ROLE_ARNAWS role ARN to assume for Bedrock

Build docs developers (and LLMs) love