To install Discourse on Cloudways, follow the steps below:
- Sign in to your Cloudways account or create a new account if you don't have one.
- Once logged in, click on the "Launch" button from the top-right corner of the window.
- Select your desired server infrastructure, such as AWS, Google Cloud, Linode, etc., and configure the server size and location according to your requirements. Click on the "Launch Now" button to set up your server.
- After the server is launched, go to the "Applications" tab from the top menu and click on the "Add Application" button.
- In the Application tab, select "PHP" from the available options and choose the desired PHP version from the dropdown menu. Give a suitable name to your application, like "discourse", and click on the "Add Application" button.
- Once the application is added, you will be redirected to the "Application Details" page. Scroll down to the "Access Details" section and note down the username and password for your application.
- Access your server using SSH by clicking on the "Launch SSH Terminal" button on the top-right corner of the page.
- In the SSH terminal, run the following command to navigate to the public_html folder:
- Create a new folder for your Discourse installation by running the following command:
- Use the following command to navigate to the newly created folder:
- Download Discourse using the following command:
git clone https://github.com/discourse/discourse.git .
- After the download is complete, go back to the Cloudways platform, and in the "Application Details" page, copy the database details, including the database name, username, and password.
- Add these database details to the Discourse's configuration file by running the following command in the SSH terminal:
cp config/database.yml.pgsql config/database.yml
- In the nano editor, replace the database name, username, and password with the appropriate values copied from the Cloudways platform. Save the changes and exit the editor.
- Run the following command to install Discourse dependencies:
- After the installation is complete, go back to the Cloudways platform, and in the "Application Details" page, note down the public IP address of your server.
- Open a web browser and access your Discourse installation by entering the following URL:
Replace [server_public_ip_address] with the actual public IP address obtained in the previous step.
- You will be redirected to the Discourse configuration page. Follow the instructions to set up your Discourse forum, including entering the admin email, username, and password.
- Once the configuration is complete, your Discourse forum will be ready for use. You can customize the forum settings, themes, and plugins as per your requirements.
That's it! You have successfully installed Discourse on Cloudways.