This note records a minimal AstrBot deployment on a VPS.
Example values:
- service user:
astrbot - working directory:
/opt/astrbot - local port:
6185 - public domain:
bot.example.com - bot token:
example-bot-token-please-change - callback path:
/callback/astrbot
Replace all example secrets before using the config.
Install uv
curl -LsSf https://astral.sh/uv/install.sh | shuv --versionInstall AstrBot
uv tool install astrbotcommand -v astrbotastrbot --helpIf astrbot is installed under the service user’s home directory, use the absolute path in the systemd unit.
Environment File
sudo install -d -m 0750 -o astrbot -g astrbot /opt/astrbotsudo vim /opt/astrbot/.envExample .env:
BOT_TOKEN=example-bot-token-please-changeCALLBACK_URL=https://bot.example.com/callback/astrbotADMIN_ID=10000001PORT=6185systemd Unit
[Unit]Description=AstrBot ServiceAfter=network.target
[Service]Type=simpleUser=astrbotGroup=astrbotWorkingDirectory=/opt/astrbotEnvironmentFile=/opt/astrbot/.envExecStart=/home/astrbot/.local/bin/astrbotRestart=alwaysRestartSec=5
[Install]WantedBy=multi-user.targetEnable it:
sudo systemctl daemon-reloadsudo systemctl enable --now astrbotsudo systemctl status astrbotReverse Proxy
bot.example.com { reverse_proxy 127.0.0.1:6185}Logs
journalctl -u astrbot -e --no-pagerjournalctl -u astrbot -f