# 宝塔面板安装discourse论坛

**URL:** <https://www.isharkfly.com/t/discourse/15796>\
**Category:** Discourse\
**Tags:** discourse\
**Created:** [May 26, 2024, 4:11am UTC](https://www.isharkfly.com/t/discourse/15796 "2024-05-26T04:11:22Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [May 26, 2024, 4:11am UTC](https://www.isharkfly.com/t/discourse/15796/1 "2024-05-26T04:11:22Z")

</div>

![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/c/c74cf2d7418919a80848d7118b96e77beb141935.png)

debian 12系统  
宝塔面板安装discourse论坛

第一步

### 1. 更新系统

首先，确保你的系统是最新的。

```auto
sudo apt update && sudo apt upgrade -y

```

### 2. 安装 Docker 和 Docker Compose

**安装 Docker 的必要依赖包**

```auto
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

```

**添加 Docker 的 GPG 密钥**

```auto
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

```

**设置 Docker 的 stable 仓库**

```auto
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

```

**更新包列表并安装 Docker** ：

```auto
sudo apt update

sudo apt install -y docker-ce docker-ce-cli containerd.io

```

**安装 Docker Compose**

```auto
sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

```

### 安装宝塔面板

1. **下载并安装宝塔面板**

```auto
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh

sudo bash install.sh

```

1. **记录安装过程中提供的面板访问地址、用户名和密码**  
如果不记得在你的终端 输入 `bt` 指令自行修改

### 安装 LNMP 环境

**在宝塔面板中安装 LNMP 环境** ：  
安装 Nginx、MySQL 和 PHP。如果计划运行其他需要 PHP 的应用程序，可以选择合适的 PHP 版本【安装不安装也无所容】

### 安装 Discourse

1. **创建目录并下载 Discourse Docker** ：

```auto
sudo mkdir /var/discourse

sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse

cd /var/discourse

```

#### 使用宝塔面板编辑配置文件

1. **通过宝塔面板登录并导航到文件管理器** 。
2. **找到 `app.yml` 文件** ，路径是 `/var/discourse/containers/app.yml`。
3. **点击编辑** ，根据需要修改文件中的配置，特别是电子邮件部分。
4. **寻找**

```auto
expose:
  - "80:80" # http [修改这个前面的80 如3000:80]
  - "443:443" # https

```

> [@Discourse app.yml翻译](https://www.isharkfly.com/t/discourse-app-yml/15782/1):
>
> ## 这是一个独立的 Discourse Docker 容器模板 ## ## 在对此文件进行更改后，您必须重新构建 ## /var/discourse/launcher rebuild app ## ## 在编辑时一定要非常小心！ ## YAML 文件对空白或对齐的错误非常敏感！ ## 您可以访问 http://www.yamllint.com/ 验证此文件是否需要修正。 templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/web.template.yml" ## 取消下一行的注释以启用 IPv6 监听器 #- "templates/web.ipv6.template.yml" - "templates/web.ratelimited.template.yml" ## ## 如果您希望添加 Lets Encrypt（https），请取消下面两行的注释 - "templates/web.ssl.template.yml"…

#### 启动 Discourse

1. **使用指令**

```auto
cd /var/discourse

sudo ./launcher bootstrap app 

sudo ./launcher start app

```

#### 配置宝塔面板

1. **登录宝塔面板** 。
2. **添加新网站** ：

- **域名** ：你的域名

1. **配置反向代理**

- **目标地址** ：`http://127.0.0.1:3000`  
 ![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/8/8ed5ade7a843a51c5d43ad8e493af2c8c24caf15.png)

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [May 26, 2024, 6:54am UTC](https://www.isharkfly.com/t/discourse/15796/2 "2024-05-26T06:54:43Z")

</div>

注意啊 443一定要改  
不然你其他的泛域名会自动上www域名的SSL

---

<div class="post-metadata">

**Author:** ![CAKE\_NICE](https://www.isharkfly.com/user_avatar/www.isharkfly.com/cake_nice/32/14319_2.png) [@CAKE\_NICE](https://www.isharkfly.com/u/CAKE_NICE)\
**Post date:** [June 12, 2024, 6:12am UTC](https://www.isharkfly.com/t/discourse/15796/3 "2024-06-12T06:12:30Z")

</div>

意思是上面的教程只改了80 但是实际生产过程中最好80和443都改？

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [June 12, 2024, 6:22am UTC](https://www.isharkfly.com/t/discourse/15796/4 "2024-06-12T06:22:04Z")

</div>

![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/optimized/2X/0/02b5e761386715ced5de947e3ca7a80870015155_2_690x35.png)

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [June 12, 2024, 6:22am UTC](https://www.isharkfly.com/t/discourse/15796/5 "2024-06-12T06:22:24Z")

</div>

看图吧这样改即可 🥰

---

<div class="post-metadata">

**Author:** ![CAKE\_NICE](https://www.isharkfly.com/user_avatar/www.isharkfly.com/cake_nice/32/14319_2.png) [@CAKE\_NICE](https://www.isharkfly.com/u/CAKE_NICE)\
**Post date:** [June 12, 2024, 8:36am UTC](https://www.isharkfly.com/t/discourse/15796/6 "2024-06-12T08:36:15Z")

</div>

不过我在部署个过程中，因为我的宝塔已经有了Nginx，部署的时候需要先把Nginx关闭才能部署discourse，discourse会检测80端口是否被占用

---

<div class="post-metadata">

**Author:** ![Hilton\_Mehok](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hilton_mehok/32/14707_2.png) [@Hilton\_Mehok](https://www.isharkfly.com/u/Hilton_Mehok)\
**Post date:** [July 3, 2024, 12:32am UTC](https://www.isharkfly.com/t/discourse/15796/7 "2024-07-03T00:32:02Z")

</div>

为什么我在腾讯云部署后，设置好反代地址，打开就是502，有没有人帮忙看下？实在太头疼了，这个问题一直解决不了

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [July 3, 2024, 3:03am UTC](https://www.isharkfly.com/t/discourse/15796/8 "2024-07-03T03:03:18Z")

</div>

你的宝塔里面的 **Docker** 也要改

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [July 3, 2024, 3:03am UTC](https://www.isharkfly.com/t/discourse/15796/9 "2024-07-03T03:03:24Z")

</div>

**Docker**

---

<div class="post-metadata">

**Author:** ![Hilton\_Mehok](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hilton_mehok/32/14707_2.png) [@Hilton\_Mehok](https://www.isharkfly.com/u/Hilton_Mehok)\
**Post date:** [July 3, 2024, 11:05am UTC](https://www.isharkfly.com/t/discourse/15796/10 "2024-07-03T11:05:18Z")

</div>

非常感谢，我今天重新安装一次，安装另外一个人发的帖子改好了

---

<div class="post-metadata">

**Author:** ![Nero\_Z](https://www.isharkfly.com/user_avatar/www.isharkfly.com/nero_z/32/15794_2.png) [@Nero\_Z](https://www.isharkfly.com/u/Nero_Z)\
**Post date:** [October 29, 2024, 11:35am UTC](https://www.isharkfly.com/t/discourse/15796/11 "2024-10-29T11:35:18Z")

</div>

请问是哪个帖子，我现在也遇到了同样的问题，宝塔 nginx发代 不成功 😰

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [October 29, 2024, 2:06pm UTC](https://www.isharkfly.com/t/discourse/15796/12 "2024-10-29T14:06:01Z")

</div>

建议你可以PM 消息下 @VegaMonika

在宝塔面板里面的安装，@VegaMonika 做得多一些，或者用下搜索吧。

 ![2024-10-29_10-06-17](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/4/4baebb3e0c1675f02b45198c3ecac631782a0e8b.png)

---

<div class="post-metadata">

**Author:** ![Ava](https://www.isharkfly.com/user_avatar/www.isharkfly.com/ava/32/15917_2.png) [@Ava](https://www.isharkfly.com/u/Ava)\
**Post date:** [November 12, 2024, 7:35am UTC](https://www.isharkfly.com/t/discourse/15796/13 "2024-11-12T07:35:04Z")

</div>

大佬，有1panel安装教程不？

---

<div class="post-metadata">

**Author:** ![xqbn](https://www.isharkfly.com/user_avatar/www.isharkfly.com/xqbn/32/21208_2.png) [@xqbn](https://www.isharkfly.com/u/xqbn)\
**Post date:** [January 27, 2026, 7:05am UTC](https://www.isharkfly.com/t/discourse/15796/14 "2026-01-27T07:05:07Z")

</div>

我参考笔记安装成功了，但是注册管理员账户的时候，一直收不到验证邮件。

头大

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [January 27, 2026, 1:36pm UTC](https://www.isharkfly.com/t/discourse/15796/15 "2026-01-27T13:36:02Z")

</div>

> [@xqbn](#):
>
> 一直收不到验证邮件

使用的是第三方的邮件服务吗？

---

<div class="post-metadata">

**Author:** ![xqbn](https://www.isharkfly.com/user_avatar/www.isharkfly.com/xqbn/32/21208_2.png) [@xqbn](https://www.isharkfly.com/u/xqbn)\
**Post date:** [January 28, 2026, 1:44pm UTC](https://www.isharkfly.com/t/discourse/15796/16 "2026-01-28T13:44:25Z")

</div>

对，使用的Lark免费邮件，收不到注册激活邮件
