Before starting this tutorial please go through the Quick Start in Depth guide.
This is a walkthrough of how to use DigitalOcean as your cloud provider for Forem selfhost.
To set up a Forem on DigitalOcean you must first create an account. Navigate to the
DigitalOcean 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 DigitalOcean Ansible collection with:
ansible-galaxy collection install community.digitaloceanor install all collections with:
ansible-galaxy collection install -r requirements.yml
The DigitalOcean provisioning target has a few preset variables you will set up further down in the instructions with DigitalOcean's CLI doctl. First you will need to install doctl.
- On MacOS you can install doctl with the following command:
brew install doctl
Save your generated token. It will be used when we configure the preset variables for the DigitalOcean provisioning target.
- In your terminal run
doctl auth initand pass in the API token you created. If you have set it up correctly you should see the followin gmessage in your terminal:
Validating token... OK
Note: if you have an old API token set up for DigitalOcean already you can update it with the following command:
doctl auth init --access-token <your-new-key>
2.) Verify that you can authenticate to the DigitalOCean API with the following command:
doctl account get
Run the DigitalOcean provider playbook to set up your Forem
- In your terminal type:
ansible-playbook -i inventory/forem/setup.yml playbooks/providers/digitalocean.yml
- 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.
ok: [forem] => msg: - The public IPv4 IP Address for www.creativecommunity.club is 220.127.116.11 - Please add an A entry for www.creativecommunity.club that points to 18.104.22.168 - 'Example:' - ' www.creativecommunity.club IN A 22.214.171.124' - 'Once you have DNS resolving to this EC2 instance please read the Forem Admin Docs: <https://forem-admin.netlify.app/>'
- 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 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