To run Discourse on Google Cloud, follow these steps:
- Create a new Google Cloud project or use an existing one.
- Enable the Compute Engine API for the project in the Google Cloud Console.
- Install and set up the Google Cloud SDK on your local machine.
- Open the Cloud Shell from the Google Cloud Console.
- Create a new Compute Engine instance by running the following command in the Cloud Shell, replacing [INSTANCE_NAME] with your desired instance name:
gcloud compute instances create [INSTANCE_NAME] --image-family=ubuntu-2004-lts --image-project=ubuntu-os-cloud --boot-disk-size=10GB --tags=http-server,https-server
- SSH into the instance by running the following command, replacing [INSTANCE_NAME] with your instance name:
gcloud compute ssh [INSTANCE_NAME]
- Install Docker on the instance by running the following commands:
sudo apt-get update
sudo apt-get install -y docker.io
- Clone the Discourse repository by running the following command:
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
- Set up the Discourse configuration by running the following command:
sudo nano /var/discourse/containers/app.yml
Edit the file and replace the DISCOURSE_HOSTNAME value with your domain name.
- Start the Discourse installation by running the following command:
sudo /var/discourse/launcher bootstrap app
- Once the installation is complete, access Discourse by navigating to http://[YOUR-DOMAIN] in your web browser.
Note: Before running the above steps, make sure to set up DNS with a valid domain for your Discourse instance. Additionally, you may need to configure firewall rules and SSL certificates for HTTPS access.