How to install Discourse on a server that already has a panel installed

In many cases, running just a single Discourse on a server is a luxury. At the same time, to facilitate server management, many people install control panel programs, so how do you install Discourse on a server that already has a panel installed?

First, be sure to read the previous installation tutorial and familiarize yourself with the installation operations.

Once you are familiar with it, you can run the installation program like this to skip the domain check:

./discourse-setup --skip-connection-test

Then fill in the information as usual, and press Ctrl+C to terminate the installation program right before it is about to start the actual installation.

Modify the expose section in the containers/app.yml file and adjust it to any unused port. (In most control panels, ports 80 and 433 are usually occupied by Nginx.)

After completing this, run ./launcher rebuild app to restart the installation and wait for the installation to finish.

After the installation is complete, add a website in the panel and configure a reverse proxy to the port you set earlier. (Note that some panels require you to additionally modify and delete the location blocks related to CSS/JS in the site configuration file, otherwise the styles and JS will be lost, leading to abnormal display.)

For more information, you can read the official documentation (the official documentation uses socket mode):

If I already have other software installed on my server, is it okay to install BT (Baota) Panel directly on this server?

Okay, there is no conflict.

I am looking for an image-based tutorial for aaPanel (Baota Panel). I am not allowed to host my website in /var


I don’t know how to use this, could I please get an image-based tutorial?

If it is not located under /var, you can use a soft link to link /var/discourse to the actual directory.

It’s not working. I’ve already moved my files to www to try it out

I am looking for an image tutorial.



Can I directly change the port Nginx uses to solve this problem?

I can’t even access my forum right now.

Alright, I recommend everyone do not create unnecessary trouble for yourselves.
cd /var/discourse
./launcher stop app
./launcher backup app
Run these commands to create a backup.
Backup files are stored in the /var/discourse/shared/standalone/backups/default directory.

  1. Transfer the backup file:
  • Transfer the backup file to the target server. You can use SCP (Secure Copy Protocol), SFTP (SSH File Transfer Protocol), or other file transfer methods.
  1. Deploy Discourse on the target server:
  • Set up the Discourse environment on the target server. This may involve cloning the Discourse GitHub repository and installing Docker and Docker Compose on the new server.
  1. Restore the backup:
  • On the target server, use Discourse’s restore tool to restore the backup you created previously. Access the new server via SSH, then run:
cd /var/discourse
./launcher stop app
./launcher restore app

Rebuild:

  • On the target server, run the rebuild command to ensure all components are correctly installed and configured:
./launcher rebuild app

  1. Update DNS settings (if required):
  • If your site’s domain has changed, be sure to update your DNS settings to point to the IP address of the new server.
  1. Restart the application:
  • On the target server, start the Discourse application:
./launcher start app

  1. Monitor logs:
  • Monitor the logs of the Discourse application to ensure that no errors or other issues occur.

Please note that the migration process may vary depending on the complexity of your site and the plugins you use. Be sure to read Discourse’s official documentation before performing the migration to get the latest migration steps and precautions. Additionally, be sure to perform comprehensive testing before migration to ensure your site runs correctly on the new server.

Did you write 8080:80 in your configuration file?

I configured my app to 8080:80. Could you please provide a complete tutorial with images? I can’t open the website at all right now.
image

Did your website use HTTPS before? If so, you should map port 443.

Ports cannot be any of the commonly used ports: 21, 25, 443, 888, 8888, 8443

These ports are restricted by Baota (BT Panel) and cannot be used.

I had no other choice, so in the end I spent 300 to get a shop on Taobao to help me solve the problem.


In the end I took a big loss of 300 switching to BT Panel (Baota)

The installation is complete, but neither the port nor the domain works. It’s really weird. Can someone make a Docker image that we can just pull directly?

A default Discourse installation comes with a built-in reverse proxy, so adding new configuration settings can easily cause problems.

This is such a gem of a post. I’ve encountered all the problems you guys have had. I’ve been messing around with this for two days straight, I’m almost going crazy. I was this close to switching to NODEBB…