This section details NekoBot installation methods, configuration options, and deployment options.
# Clone repository
git clone https://github.com/NekoBotTeam/NekoBot.git
cd NekoBot
# Install with uv
uv pip install -e .
# Start
uv run main.py# Clone repository
git clone https://github.com/NekoBotTeam/NekoBot.git
cd NekoBot
# Install with pip
pip install -e .
# Start
python main.pyNekoBot provides Docker deployment support.
# Build and start
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down# Build image
docker build -t nekobot .
# Run container
docker run -d -p 6285:6285 --name nekobot nekobotNekoBot configuration files are located in the data/ directory.
data/cmd_config.json {
"command_prefix": "/",
"server": {
"host": "0.0.0.0",
"port": 6285
},
"jwt": {
"secret_key": "your-secret-key-here",
"algorithm": "HS256",
"access_token_expire_minutes": 30
},
"webui_enabled": true,
"demo": false
}| Option | Type | Default | Description |
|---|---|---|---|
command_prefix | string | / | Command prefix |
server.host | string | 0.0.0.0 | Server listening address |
server.port | number | 6285 | Server listening port |
jwt.secret_key | string | - | JWT secret key (change in production) |
jwt.algorithm | string | HS256 | JWT algorithm |
jwt.access_token_expire_minutes | number | 30 | Token expiration time (minutes) |
webui_enabled | boolean | true | Enable Web dashboard |
demo | boolean | false | Demo mode |
data/platforms_sources.json {
"aiocqhttp": {
"type": "aiocqhttp",
"enable": true,
"id": "aiocqhttp",
"name": "NekoBot",
"ws_host": "0.0.0.0",
"ws_port": 6299,
"command_prefix": "/"
}
}data/llm_providers.json {
"openai": {
"type": "openai",
"enable": true,
"id": "openai",
"api_key": "your-api-key-here",
"base_url": "https://api.openai.com/v1",
"model": "gpt-4"
}
}NekoBot/
├── data/ # Data directory
│ ├── plugins/ # User plugins
│ ├── plugin_data/ # Plugin data
│ ├── cmd_config.json # Main configuration file
│ ├── platforms_sources.json # Platform configuration
│ ├── llm_providers.json # LLM configuration
│ ├── users.json # User data
│ └── dist/ # Web dashboard static files
│
├── dashboard/ # React frontend source
├── packages/
│ └── backend/ # Backend code
├── main.py # Main entry point
├── pyproject.toml # Python project configuration
└── docker-compose.yaml # Docker configurationnekobotnekobotpython main.py reset-passwordUser data is stored in the data/users.json file with bcrypt password encryption.
NekoBot uses loguru for log management.
DEBUG: Debug informationINFO: General informationWARNING: Warning informationERROR: Error informationModify log configuration in main.py:
logger.remove()
logger.add(
sys.stdout,
format="{time:YYYY-MM-DD HH:mm:ss.SSS} <level>[{level}]</level> {message}",
level="DEBUG",
colorize=True,
)jwt.secret_key to a random stringdata/ directoryGenerate a random secret key using Python:
import secrets
print(secrets.token_urlsafe(32))server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:6285;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}your-domain.com {
reverse_proxy 127.0.0.1:6285
}If port 6285 is already in use, modify the port configuration in data/cmd_config.json.
Check if the plugin directory structure is correct:
data/plugins/your_plugin/
├── main.py
├── _conf_schema.json (optional)
└── metadata.yaml (optional)Check if the API key is correct and if the network can access the LLM service provider.
Ensure the reverse proxy is correctly configured with WebSocket support.