---
# System prepended metadata

title: Bonfire Set-up Guide

---

# Bonfire Set-up Guide

### Overview 

This guideline goes through the six steps to set up a bonfire instance for your community 🔥 ✨

The general steps are 
1. 🖥 Get a Server (such as hetzner.com)
2. Set up domain-name, mail and DNS
	1. 👉 Domain name (through f.ex. namecheap) 
	2. 📧 Set up mail (such as Mailgun)
	3. 🌐 DNS set up (such as FreeDNS or via namecheap)
3. 🌥 Install Coop-Cloud on Server
4. 🪄Install Abra on your computer
	1. 🐰 Add your server to Abra
5. 🚦 Install Traefik
6. 🔥 Install Bonfire on Server

### Walkthrough

#### 1. Get a server

Bonfire can be setup on any server (dedicated/virtual/VPS/docker). We used hetzner to set up a virtual server in EU.  

- Hardware requirement: 8GB RAM
- Create an ssh key on your computer in terminal. The command varies but is usually "ssh keygen "
	- If you are new to ssh: If you give a password for your ssh key, make sure to save it in a secure password manager to minimize the chance of getting locked-out of your server 
- Activate firewalls after completing set up to minimize the potential issues for trouble shooting  

> [!Tip] Protip
> Save your SSH private and public keys in a password manager!

> [!note] Note
> Later on it is possible to store data (such as uploaded images) in a cloud service rather than your server (through any provider that supports the s3 API), yet this isn't necessary to do right away.


#### 2. Set up a domain, Mail and DNS 

##### 2.1 Domain name
The domain name can be a new *domain.org* that you purchase or a sub-domain of an existing site you already have such as *sub.domain.org*. All users on your instance will have the domain you select as part of their username, such as *user @ sub.domain.org*  

In this step we can use a domain name service such as namecheap, which was used in this tutorial.

> [!tip] Protip
>  It takes around 24h to propagate among the DNS servers so give yourself plenty of time to account for potential DNS set-up errors.

##### 2.2 Set up mail - SPF, DMARK, etc

Mailgun offers a free email routing service for up to 1 account.

Follow [this guideline](https://documentation.mailgun.com/docs/mailgun/quickstart-guide/quickstart/) for info on how to set up your Mailgun account. 

> [!Tip] Protip
> Your bonfire domain must be different than e-mail domain!


> [!tip] Protip
>  On Mailgun the EU / US interfaces are separate, make sure you stick to the same interface (little flag on the top)

##### 2.3 Add the details to DNS

On the DNS we will need to set up our details. The following outline is a general list of required details. the values are placeholders to show what it might look like. Brackets, such as `[insert]`, indicate that you add your own characters. 
	- **IPv4** as an A record
		- host: `@`
		- value: `[XXX.XXX.XXX.XXX]`
	- **Wildcard** DNS as an A record 
		- host: `*`
		- value: `[XXX.XXX.XXX.XXX]`
	- **CNAME** record 
		- host: `email.[sub]`
		- value: `eu.mailgun.org.`
	- **DMARC TXT** Record 
		- host: `dmarc.[sub]`
		- value: `v=DMARC1; p=none; pct=100; fo=1; ri=3600; rua=mailto :fcf2` etc...
	- **SPF TXT** Record 
		- host:  `[sub]`
		- value: `v=spf1 include:mailgun.org ~all`


> [!note] Note
>  The DMARC values are automatically added once DMARC is enabled through Mailgun

###### Optionally
-  add IPv6 as AAAA Record (*notice, different DNS require different formats for IPv6)*	- add wildcard DNS as an AAAA record with * as the hostname and the server IPv6
- MX set up if you want to be able to receive emails as well


> [!Tip] Protip
>  IPv6 sometimes messes things up. Optionally you can skip IPv6 to start with and add later once IPv4 is securely running.


#### 3. Install Coop-Cloud on server

Follow this  [Guideline to install Coop Cloud](https://docs.coopcloud.tech/operators/tutorial/) if you have any issues, here's a [guide for coop-cloud ssh issues](https://docs.coopcloud.tech/abra/trouble/#ssh-connection-issues):


> [!Tip] Protip
> Ensure .ssh/config file is set up
> ```
> Host [domain.org]
>     HostName [domain.org]
>     User [root]
>     IdentityFile ~/.ssh/[your_ssh_key]


#### 4. Install Abra

[Abra](https://docs.coopcloud.tech/abra/) is installed locally and acts as the remote control to Coop-Cloud, letting you manage software installations more easily from your local machine. [Click here for Abra installation tutorial](https://docs.coopcloud.tech/abra/install/).

##### 4.1. Add your server to Abra

Here's a guide for how to [add your server](https://docs.coopcloud.tech/operators/tutorial/#install-abra) to Abra. This tutorial works well until you need to install the app. When you reach the "Nextcloud" part of the guide, switch back to this guide.

- The command for adding the server is `abra server add *domain.org*`
- To see that it works, check `abra server ls` and you'll get a cute happy message

![[success-server.png]]

> [!Tip] Protip
> Try pinging *traefik.domain.org* to see that it works:
> `ping traefik.domain.org`


#### 5. Install Traefik

[Traefik](https://doc.traefik.io/traefik/) is a proxy that supports developers with publishing services. This will make it easy to ensure that your bonfire instance is up to date! 

Install by following this [recipie to install Traefik](https://recipes.coopcloud.tech/traefik)

A successful install will show a little message such as:
![[traefik-success.png]]

> [!note] Note
> This requires the wildcard DNS to be set up

#### 5. Install Bonfire on Server

Follow the guidelines for the [Bonfire Recipe](https://recipes.coopcloud.tech/bonfire) through Abra (your remote control for Coop-Cloud)
- secret or pass?
	- `--pass` is in case you're using the password manager called *pass*
	- otherwise just use `--secrets` to generate some default keys (save these in your password manager too!)
- edit config file
	-  `abra app config [domain.org]`
	- change the the email api key
```
	MAIL_BACKEND=mailgun
	MAIL_DOMAIN=[domain.org]
	MAIL_KEY=[your-mailgun-sending-key]
	MAIL_FROM=[from@domain.org]
```
- deploy 
`abra app deploy [domain.org]`

- if redeploying, you can force deploy
`abra app deploy [domain.org] --force`

> [!Tip] Protip
> You can turn the `~/abra/servers/domain.org` directory into a git repo and share it (privately!) with collaborators. It's also useful as a backup if you loose access to your machine or want to manager the server from a different place.


### 🎉 Tada 🎉 

That's it! Now you should be able to share invite links to your instance. 

> [!note] Notice
> The first person to sign up automatically becomes an admin. 


