Manual Setup Guide
A comprehensive guide for developers who prefer hands-on control over their DeepWiki-Open development environment.Prerequisites
Before starting, ensure you have the following installed on your system:- Python 3.12+ (Required by pyproject.toml)
- Node.js 18+ (Required for Next.js)
- Git (For repository cloning)
- Basic terminal/command line knowledge
1. Environment Setup
1.1 Python Environment Setup
Option A: Using Virtual Environment (Recommended)
Option B: Using Conda
Option C: Using pyenv (Advanced)
1.2 Node.js and Package Manager Setup
Install Node.js
Option A: Using Node Version Manager (Recommended)Choose Package Manager
2. Project Setup
2.1 Clone and Initial Setup
2.2 Python Dependencies Installation
Using pip with requirements.txt
Using uv (Modern Python Package Manager)
Troubleshooting Python Dependencies
2.3 Node.js Dependencies Installation
3. Environment Configuration
3.1 Environment Variables Setup
Create a.env
file in the project root:
3.2 API Key Acquisition
Google AI Studio
- Visit Google AI Studio
- Create a new project or select existing
- Generate API key
- Copy to
GOOGLE_API_KEY
in.env
OpenAI Platform
- Visit OpenAI Platform
- Create account and add billing information
- Generate new secret key
- Copy to
OPENAI_API_KEY
in.env
OpenRouter
- Visit OpenRouter
- Sign up and add credits
- Generate API key from dashboard
- Copy to
OPENROUTER_API_KEY
in.env
Azure OpenAI
- Go to Azure Portal
- Create Azure OpenAI resource
- Get keys and endpoint from resource
- Configure all three Azure variables in
.env
4. Database and Storage Setup
4.1 Local Storage Directories
DeepWiki-Open uses local file storage. Create required directories:4.2 FAISS Vector Database
DeepWiki uses FAISS for vector storage (included in requirements):4.3 Storage Configuration
Editapi/config/embedder.json
to customize storage settings:
5. Service Configuration
5.1 Backend API Configuration
FastAPI Server Settings
Createapi/config/server.json
:
CORS Configuration
The API allows all origins by default. For production, modifyapi/api.py
:
5.2 Frontend Configuration
Next.js Configuration
Editnext.config.ts
:
Internationalization Setup
Configure supported languages insrc/i18n.ts
:
6. Development vs Production Configurations
6.1 Development Configuration
Backend Development:.env
:
6.2 Production Configuration
Backend Production:gunicorn.conf.py
:
.env
:
7. Process Management
7.1 Using PM2 (Recommended)
Install PM2
Create PM2 Configuration
Createecosystem.config.js
:
PM2 Commands
7.2 Using systemd (Linux)
Backend Service
Create/etc/systemd/system/deepwiki-api.service
:
Frontend Service
Create/etc/systemd/system/deepwiki-frontend.service
:
systemd Commands
8. Monitoring and Logging Setup
8.1 Application Logging
Python Logging Configuration
Createapi/logging_config.py
:
Next.js Logging
Createsrc/utils/logger.ts
:
8.2 Health Monitoring
Health Check Endpoint
Add toapi/api.py
:
Monitoring Script
Createscripts/monitor.py
:
8.3 Performance Monitoring
Simple Performance Tracking
Createscripts/performance_monitor.sh
:
9. Backup and Maintenance
9.1 Data Backup Strategy
Backup Script
Createscripts/backup.sh
:
9.2 Maintenance Tasks
Database Cleanup Script
Createscripts/maintenance.py
:
Automated Maintenance with Cron
Add to crontab (crontab -e
):
10. Troubleshooting
10.1 Common Issues and Solutions
Python Environment Issues
Node.js Issues
API Connection Issues
10.2 Performance Optimization
System Optimization
Application Optimization
Editapi/main.py
for production optimizations:
11. Security Considerations
11.1 API Security
Rate Limiting
Add toapi/api.py
:
Input Validation
11.2 Environment Security
12. Advanced Configuration
12.1 Custom Model Configurations
Editapi/config/generator.json
:
12.2 Custom Embedding Configuration
Editapi/config/embedder.json
:
Conclusion
This manual setup guide provides comprehensive control over your DeepWiki-Open installation. The manual approach offers:- Full Control: Complete visibility into every component and configuration
- Customization: Ability to modify any aspect of the system
- Debugging: Direct access to logs and processes for troubleshooting
- Performance Tuning: Fine-grained control over resource allocation
- Security: Implementation of custom security measures