Record of Deploying AstrBot + NapCat + QQBot

Published 2026-08-17 23:25 371 words 2 min read

Learn how to deploy AstrBot + NapCat + QQBot using Docker

Deploying AstrBot + NapCat + QQBot

Preview

AstrBot Official Documentation

This time, deployment is done with Docker. Command summary:

mkdir astrbot
cd astrbot
wget https://raw.githubusercontent.com/NapNeko/NapCat-Docker/main/compose/astrbot.yml
sudo docker compose -f astrbot.yml up -d

Deployment Process

Deploying with Docker

After running the commands in the summary above, a display like the one below means the installation succeeded and the container is running.

image.png
image.png

Viewing the Target Container's Runtime Logs

sudo docker logs -f astrbot
image.png
image.png

From the image above it is clear that AstrBot is ready, and there is an account with a default password.

Allowing Ports Through the Firewall

Two default ports need to be allowed: AstrBot: 6185; NapCat: 6099

image.png
image.png

Changing the Password and User

docker logs -f astrbot docker logs -f napcat

Log in with the account and password recorded in the logs, then reset the user and password. Reaching the interface shown below means it succeeded.

image.png
image.png

For NapCat, scroll up in the logs to find the token and enter it.

If QR-code login reports: The current device's network is unstable or in a complex network environment xxx, switch to a proxy and log in with account and password

Creating a Shared Docker Network and Connecting the Running Containers

# Create the network
docker network create astrbot_net

# Add napcat and astrbot to this network
docker network connect astrbot_net napcat
docker network connect astrbot_net astrbot

# Restart both containers for the network configuration to take effect
docker restart napcat astrbot

Connecting NapCat to AstrBot

  1. Enter the NapCat UI and click 网络配置
  2. Click New and select Websocket客户端
  3. The name can be anything; fill in the URL: ws://astrbot:6199/ws
  4. Copy the Token
  5. Open the AstrtBot UI and click the 欢迎 tab
  6. Select 配置平台机器人, and for the message platform type choose OneBot v11
  7. Port 6199, fill in the reverse Websocket Token with the Token just copied from NapCat
  8. Return to the napcat网页 and click 猫猫日记 to view the logs
    image.png
    image.png

END

If you enjoyed this, leave a comment~

... Page views
© 2021 - 2026 Vullfin @VV
Powered by theme astro-koharu · Inspired by Shoka