前期准备
-
域名配置
准备一个域名(例如我的 discourse.us.kg [失效链接]),在CloudFlare面板中配置SSL/TLS加密模式为「完全」,否则会导致重定向过多问题(除非不使用SSL证书)。 -
服务器选择
推荐使用HZ Finland Medium及以上配置机型,Mini机型(内存<2GB)通常无法完成安装。 -
系统安装
选择Ubuntu系统,务必开启VNC(除非您有可用的ipv6客户端连接环境)。
部署流程
初始配置
- 将服务器IP解析到域名并启用CloudFlare代理(小黄云)
- IPv6服务器需要安装WARP:
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh
环境准备
sudo apt update
sudo apt install git docker.io -y
Discourse安装
sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
chmod 700 containers
# 关键参数说明:必须添加 --skip-connection-test 避免域名绑定失败
./discourse-setup --skip-connection-test
配置参数示例
安装过程中需要填写以下信息(以Serv00邮箱服务为例):
Hostname for your Discourse? [discourse.example.com]: discourse.us.kg
Email address for admin account(s)? [[email protected]]: [email protected]
SMTP server address? [smtp.example.com]: mail5.serv00.com
SMTP port? [587]: 587
SMTP user name? [[email protected]]: [email protected]
SMTP password? [pa$$word]: Discourse@pw123
Let's Encrypt account email? : [email protected]
Optional Maxmind License key: [直接回车跳过]
完成部署
等待自动安装完成后访问网站完成初始化配置。