How to install discourse on cyberpanel with multiple sites hosted 2024

admk

Member
8
2009
2
330
Yes Its Possible
To install Discourse on a CyberPanel server that hosts multiple sites, follow these steps:



  1. VPS/Dedicated Server: Ensure you have a VPS or dedicated server with CyberPanel installed.
  2. Docker: Discourse requires Docker. Ensure Docker is installed and running.
  3. Domain: You need a domain or subdomain for Discourse.



If Docker is not already installed, you can install it by running:



curl -fsSL https:<span>//get.docker.com -o get-docker.sh</span><br>sh <span>get</span>-docker.sh<br><br>

  1. Install Docker Compose



<span>sudo</span> curl -L <span>"https://github.com/docker/compose/releases/download/1.29.2/docker-compose-<span>$(uname -s)</span>-<span>$(uname -m)</span>"</span> -o /usr/local/bin/docker-compose<br><span>sudo</span> <span>chmod</span> +x /usr/local/bin/docker-compose<br><br>

Set Up CyberPanel for Multiple Sites


Ensure your CyberPanel is configured to manage multiple websites. Create a new website for Discourse if you haven’t already.


  1. Create DNS Records

Point your domain or subdomain to your server’s IP address. This is necessary for Discourse to function correctly.


  1. Install Discourse
    Create a Directory for Discourse:



<span>mkdir</span> /var/discourse<br>git <span>clone</span> https://github.com/discourse/discourse_docker.git /var/discourse<br><span>cd</span> /var/discourse<br>

Create a Configuration File:




<span>cp</span> samples/standalone.yml containers/app.yml<br><br>

Edit the Configuration File: Open the app.yml file in a text editor:




nano containers/app.yml<br><br>

Modify the following parameters:




<span>DISCOURSE_HOSTNAME: 'your.discourse.domain'</span><br><span>DISCOURSE_SMTP_ADDRESS: smtp.your-email.com</span><br><span>DISCOURSE_SMTP_PORT: 587</span><br><span>DISCOURSE_SMTP_USER_NAME: user@your-email.com</span><br><span>DISCOURSE_SMTP_PASSWORD: your_password</span><br><br>

Important
Find the section that configures the ports and change it to a different port (e.g., 8080):





<span>expose:</span><br> - <span>"8080:80"</span> <span># http</span><br> - <span>"8443:443"</span> <span># https</span><br><br>

Save and exit the editor.
Bootstrap Discourse:




./launcher bootstrap app<br>./launcher start app<br>


Since CyberPanel uses OpenLiteSpeed, you need to set up a reverse proxy for Discourse.


  1. Open CyberPanel Admin Panel: Log in to your CyberPanel dashboard.
  2. Navigate to Websites → List Websites: Find the website where you want to set up Discourse and click on ‘Manage’.
  3. Open .htaccess File: Under the ‘File Manager’, open the .htaccess file and add the following configuration:
    image
    image796×642 11 KB

    Final Step
    open litespeed admin
    goto server configuration
    add external App
    image
    image1880×642 53 KB

    Add Proxy to you Virtual Host
    image
    image1916×775 67.2 KB
I found this article here
That’s all
Open your site
 
Back
Top