Discourse forum setup—the most efficient I’ve seen

Today, when setting up a Discourse forum on my own server, I encountered a problem: the server already had other web services occupying port 80. After some searching and experimenting, I finally found a concise and effective solution in the comments section of the official forum. I’m sharing my setup process below in hopes it will help anyone facing the same issue.

Problem Background

Following the official standard installation steps:

git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
chmod 700 containers
./discourse-setup

However, since port 80 was already in use, the installation couldn’t continue.

Solution (from the official forum)

  1. Clone the Discourse repository (as per the official instructions)

    git clone https://github.com/discourse/discourse_docker.git /var/discourse
    
  2. Copy the configuration file

    cp /var/discourse/samples/standalone.yml /var/discourse/containers/app.yml
    
  3. Edit the app.yml file, making the following key changes:

    DISCOURSE_HOSTNAME: 'domain.net'
    DISCOURSE_DEVELOPER_EMAILS: '[email protected],[email protected]'
    DISCOURSE_SMTP_ADDRESS: smtp.mail.me.com
    DISCOURSE_SMTP_PORT: 587
    DISCOURSE_SMTP_USER_NAME: [email protected]
    DISCOURSE_SMTP_PASSWORD: "safe-code-safe-code"
    DISCOURSE_NOTIFICATION_EMAIL: [email protected]
    DISCOURSE_SMTP_AUTHENTICATION: login
    
  4. Adjust port configuration:

    • Comment out 443:443 (since you’ll use nginx for reverse proxy, there’s no need to expose port 443)
    • Change 80:80 to 8001:80 (8001 can be replaced with any available port you like)
  5. Rebuild the app

    ./launcher rebuild app
    
  6. Set up port forwarding on nginx, then simply access the domain and register the initial account

Notes

  1. SMTP settings are crucial—be sure to fill in the correct email service information, or user registration and notification features won’t work properly.

  2. After changing the port, remember to set up reverse proxy rules in nginx or your web server, pointing the specific domain to port 8001.

  3. If emails can’t be sent, use the built-in diagnostic tool to troubleshoot.

./discourse-doctor

The whole process takes just a few minutes. Discourse will automatically download the required images and complete the configuration. Once installation is done, you can access your forum through your domain name.

Like they say, wisdom comes from the community! This solution is more flexible than the method described in the official documentation, especially suitable for server environments that already have web services running.

3 Likes

感谢 分享,用Discourse的越来越多啦

这个运行坏境还没搞懂

综合性社区 :ac01:

感谢分享

感谢楼主的心得分享。

可惜了serv00搞不了

牛啊 :xhj003:

膜拜大佬

感谢分享,非常成熟的方案

关键部署了不知道干嘛
现在对部署网站做东西 一头雾水

谢谢 分享

1 Like

真心不错

用Discourse的越来越多啦

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。