Skip to main content

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 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)
Option B: Direct Installation Download from nodejs.org or use package managers:

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:
Basic Configuration:
Development Configuration:
Production Configuration:

3.2 API Key Acquisition

Google AI Studio

  1. Visit Google AI Studio
  2. Create a new project or select existing
  3. Generate API key
  4. Copy to GOOGLE_API_KEY in .env

OpenAI Platform

  1. Visit OpenAI Platform
  2. Create account and add billing information
  3. Generate new secret key
  4. Copy to OPENAI_API_KEY in .env

OpenRouter

  1. Visit OpenRouter
  2. Sign up and add credits
  3. Generate API key from dashboard
  4. Copy to OPENROUTER_API_KEY in .env

Azure OpenAI

  1. Go to Azure Portal
  2. Create Azure OpenAI resource
  3. Get keys and endpoint from resource
  4. 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

Edit api/config/embedder.json to customize storage settings:

5. Service Configuration

5.1 Backend API Configuration

FastAPI Server Settings

Create api/config/server.json:

CORS Configuration

The API allows all origins by default. For production, modify api/api.py:

5.2 Frontend Configuration

Next.js Configuration

Edit next.config.ts:

Internationalization Setup

Configure supported languages in src/i18n.ts:

6. Development vs Production Configurations

6.1 Development Configuration

Backend Development:
Frontend Development:
Development .env:

6.2 Production Configuration

Backend Production:
gunicorn.conf.py:
Frontend Production:
Production .env:

7. Process Management

Install PM2

Create PM2 Configuration

Create ecosystem.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

Create api/logging_config.py:

Next.js Logging

Create src/utils/logger.ts:

8.2 Health Monitoring

Health Check Endpoint

Add to api/api.py:

Monitoring Script

Create scripts/monitor.py:

8.3 Performance Monitoring

Simple Performance Tracking

Create scripts/performance_monitor.sh:

9. Backup and Maintenance

9.1 Data Backup Strategy

Backup Script

Create scripts/backup.sh:

9.2 Maintenance Tasks

Database Cleanup Script

Create scripts/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

Edit api/main.py for production optimizations:

11. Security Considerations

11.1 API Security

Rate Limiting

Add to api/api.py:

Input Validation

11.2 Environment Security

12. Advanced Configuration

12.1 Custom Model Configurations

Edit api/config/generator.json:

12.2 Custom Embedding Configuration

Edit api/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
Choose the components and configurations that best fit your development workflow and production requirements. Regular maintenance and monitoring will ensure optimal performance and reliability of your DeepWiki-Open installation. For additional support, refer to the project’s GitHub repository or community forums.