Before starting this tutorial please go through the Quick Start in Depth guide.
To set up a Forem on Google Cloud, you must first create an account. Navigate to the
Google Cloud Homepage and fill in the appropriate information to create your account.
- In your terminal make sure you are in the selfhost directory with:
- Install the Ansible Google Cloud collections with:
ansible-galaxy collection install google.cloudor install all collections with:
ansible-galaxy collection install -r requirements.yml
google-authpip modules with:
pip3 install requests google-auth
You will need to set up a Google Cloud Service Account and add privileges
1.) Open the Service accounts page.
3.) Setting up Roles
- Navigate to the
Roleslink in the side menu.
- In the filter search bar type Computer Instance Admin and choose the v1 option
- Check the box to add the Computer Instance Admin (v1) role to the forem-selfhost
1.) Navigate back to the home page of your current project.
- Hover over the
APIs & Servicesside menu link and click the
Credentialslink in the dropdown menu.
8.) Find the name of your downloaded file and place it in
First create a directory on your computer called ~/.gcp with the following command:
Then move the dowloaded json file to
~/.gcp with the following command:
mv ~/my_gcp_forem.json ~/.gcp/forem.json
You can check to see if the file is in the correct place with the following commands:
cd ~/.gcp to navigate to the directory
ls to list what files are in the directory.
You should see your forem.json file listed in the
Now you are ready to run your ansible playbook.
- In your terminal type:
ansible-playbook -i inventory/forem/setup.yml playbooks/providers/gcp.yml
ansible-playbook -i inventory/forem/setup.yml playbooks/providers/gcp.yml -e ansible_python_interpreter=/usr/local/bin/python3
- Once you run the command, you should see an output in your terminal similar to the code below with your community's domain name and IP address.
- You will need to create an
A recordand point DNS at the IP address that is output at the end of the provider playbook.
You can see an example of how I set an A record for my namecheap domain below:
In Advanced DNS I added an A record for my domain and subdomain and set the value to the IP address that was outputted after provisioning. I also set TTL to 1minute.
This will defer depending on where your DNS is hosted.
Once DNS is pointed at your Forem VM, you will need to restart the Forem Traefik service.
- You will need to run the command via SSH. In your terminal type:
ssh core@<SERVER IP ADDRESS>replacing with your community name. In the example below I am using my community:
- You may be prompted to continue. Type
yesin to your terminal.
Congratulations on setting up your first Forem!🎉
For more details on how to configure your Forem please visit our Forem Admin Docs.