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):
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.
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.
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.
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
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.
Restart the application:
On the target server, start the Discourse application:
./launcher start app
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.
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?
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…