Yes Its Possible
To install Discourse on a CyberPanel server that hosts multiple sites, follow these steps:
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>
<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.
Point your domain or subdomain to your server’s IP address. This is necessary for Discourse to function correctly.
<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.
That’s all
Open your site
To install Discourse on a CyberPanel server that hosts multiple sites, follow these steps:
- VPS/Dedicated Server: Ensure you have a VPS or dedicated server with CyberPanel installed.
- Docker: Discourse requires Docker. Ensure Docker is installed and running.
- 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>
- 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.
- Create DNS Records
Point your domain or subdomain to your server’s IP address. This is necessary for Discourse to function correctly.
- 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.
- Open CyberPanel Admin Panel: Log in to your CyberPanel dashboard.
- Navigate to Websites → List Websites: Find the website where you want to set up Discourse and click on ‘Manage’.
- Open .htaccess File: Under the ‘File Manager’, open the .htaccess file and add the following configuration:
image796×642 11 KB
Final Step
open litespeed admin
goto server configuration
add external App
image1880×642 53 KB
Add Proxy to you Virtual Host
image1916×775 67.2 KB
That’s all
Open your site