System update
apt update && apt upgrade -y
Switch apt mirrors
// vim 不熟练就 nano
vim /etc/apt/sources.list
apt update
Go find what you need on the Tsinghua mirror yourself. If you’re on Debian 11 (bullseye) like me, just copy this:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
Change hosts
Because of Tencent intranet restrictions, you have to change the hosts.
vim /etc/resolv.conf
For DNS I usually use 114.114.114.114 and 1.1.1.1. Both are widely proven, decent DNS. Not much to say.
Delete Tencent Cloud monitoring
crontab -r && /usr/local/qcloud/stargate/admin/uninstall.sh && /usr/local/qcloud/YunJing/uninst.sh && /usr/local/qcloud/monitor/barad/admin/uninstall.sh && rm -rf /usr/local/qcloud && rm /home/lighthouse/.ssh/authorized_keys
Prep before you start
Grab the download link from the release page, then wget it onto the server. We’re on a mainland server here, so GitHub is definitely not going to connect well. Just download it to your computer and upload it to the server.
wget <go-cqhttp.tar.gz>
tar -xzf go-cqhttp_linux_amd64.tar.gz
At this point, everything is ready.
Start configuring
./go-cqhttp
Then follow the wizard. Anyway I picked option 0, and then your config file should be generated. After that, edit config.yml. The Chinese comments are detailed enough, no need for me to keep talking.
My experience: you only need to change two places, 账号 and 监听地址. Set the listen address to 0.0.0.0. Change it yourself if you know what you’re doing.
Finally, run ./go-cqhttp one more time. In theory it should just work. If it doesn’t, tough luck.
Keep the process alive
I only know how to use screen. From CentOS to Ubuntu to Debian — if you ask, it’s because I can’t be bothered to learn anything else.
apt install screen
screen
./go-cqhttp
Then detach from screen with Ctrl+A+D, and you can drop SSH. All the work is done. Now you just need to open the server ip