Skip to content

Commit 9c4e927

Browse files
committed
wip: Document how to deploy a Prose Pod
1 parent a1d234d commit 9c4e927

1 file changed

Lines changed: 72 additions & 22 deletions

File tree

  • src/data/guides/operating/deploy

src/data/guides/operating/deploy/index.md

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ To copy-paste working commands from this guide, you should start by storing your
5454
YOUR_DOMAIN= # Insert your domain
5555
```
5656

57-
### Step 0: Create the `prose` user
57+
### Step 1: Create the `prose` user
5858

5959
For better isolation, you shouldn’t run Prose as root on your server. This guide uses a `prose` user that you should create using:
6060

6161
```bash
62+
addgroup --gid 1001 prose
6263
adduser --uid 1001 --gid 1001 --disabled-password --no-create-home --gecos 'Prose' prose
6364
```
6465

65-
### Step 1: Create required files and directories
66+
### Step 2: Create required files and directories
6667

6768
As detailed in [“Required files and directories”](#required-files-and-directories), Prose Pods require a certain amount of files and directories to exist. To create them, you can run:
6869

@@ -82,34 +83,39 @@ install -o prose -g prose -m 600 -T /dev/null \
8283

8384
In order for your Prose Pod to run correctly, you need to write a few configuration keys in `/etc/prose-pod-api/Prose.toml`.
8485

85-
You can find an up-to-date template at [github.com/prose-im/prose-pod-system/blob/master/Prose-template.toml](https://github.com/prose-im/prose-pod-system/blob/master/Prose-template.toml), or directly download it using:
86+
You can find an up-to-date template at [github.com/prose-im/prose-pod-system/blob/master/templates/Prose.toml](https://github.com/prose-im/prose-pod-system/blob/master/templates/Prose.toml), or directly download it using:
8687

8788
```bash
88-
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/Prose-template.toml -o /etc/prose-pod-api/Prose.toml
89+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/Prose.toml \
90+
| sed s/'{your_domain}'/"${YOUR_DOMAIN:?}"/g \
91+
> /etc/prose-pod-api/Prose.toml
8992
chown prose:prose /etc/prose-pod-api/Prose.toml
93+
# Then edit </etc/prose-pod-api/Prose.toml>!
9094
```
9195

92-
Once done, edit the file to replace all placeholders with your company information.
96+
Once done, **edit the file to replace all placeholders** with your company information.
9397

9498
!! For more information about all available configuration, see the [Pod configuration reference](http://localhost:8040/references/pod-config/).
9599

96100
#### SSL certificates
97101

98-
! This section supposes you’re using [nginx](https://nginx.org/en/). If you use another reverse proxy, please update insctructions accordingly.
102+
! This section supposes you’re using [nginx](https://nginx.org/en/). If you use another reverse proxy, please update instructions accordingly. If you don’t have nginx installed just yet, run `apt install -y nginx`.
99103

100104
1. Install [certbot](https://certbot.eff.org/):
101105

102106
```bash
103-
apt update
104-
apt install -y certbot
107+
apt install -y certbot python3-certbot-nginx
105108
```
106109

107110
2. Ensure you have `A`/`AAAA` DNS records pointing to your server (so certbot can pass its SSL challenge).
108111

109-
3. Request a SSL certificate for your server:
112+
3. Request a SSL certificate for your Prose Pod:
110113

111114
```bash
112-
certbot -d prose.${YOUR_DOMAIN:?} -d admin.prose.${YOUR_DOMAIN:?} -d groups.prose.${YOUR_DOMAIN:?}
115+
certbot --nginx \
116+
-d prose.${YOUR_DOMAIN:?} \
117+
-d admin.prose.${YOUR_DOMAIN:?} \
118+
-d groups.prose.${YOUR_DOMAIN:?}
113119
```
114120

115121
Note that certbot should have automatically created `/etc/cron.d/certbot` to handle certificates renewal.
@@ -145,15 +151,15 @@ Once done, edit the file to replace all placeholders with your company informati
145151
rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/
146152
```
147153

148-
! **Tip:** If you manage multiple certificates and want Prosody to only see the one you use for Prose, you can use `rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/prose.${YOUR_DOMAIN:?}/` instead.
154+
! **Tip:** If you manage multiple certificates and want Prosody to only see the one you use for Prose, you can use `rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/${YOUR_DOMAIN:?}/` instead.
149155

150-
5. certbot should have automatically created `/etc/cron.d/certbot` to handle certificates renewal, but you still have to add a certbot renewal hook to update Prosody certificates when certificates are renewed. For this, assign the command you executed previously in as `post_hook` under `[renewalparams]` in `/etc/letsencrypt/renewal/prose.{your_domain}.conf`. For example, if you used `rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/` you should set:
156+
5. certbot should have automatically created `/etc/cron.d/certbot` to handle certificates renewal, but you still have to add a certbot renewal hook to update Prosody certificates when certificates are renewed. For this, assign the command you executed previously in as `post_hook` under `[renewalparams]` in `/etc/letsencrypt/renewal/prose.${YOUR_DOMAIN:?}.conf`. For example, if you used `rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/` you should set:
151157

152158
```toml
153159
post_hook = "/bin/bash -c 'rsync -aL --chown=prose:prose /etc/{letsencrypt/live,prosody/certs}/'"
154160
```
155161

156-
### Step 2: Run your Prose Pod
162+
### Step 3: Run your Prose Pod
157163

158164
To run a Prose Pod on your premises, you have to run all of its parts independently. Each is released as a Docker image, on Docker Hub (see [hub.docker.com/u/proseim](https://hub.docker.com/u/proseim)) and on GitHub’s Container Registry (see [github.com/orgs/prose-im/packages](https://github.com/orgs/prose-im/packages)).
159165

@@ -184,33 +190,77 @@ If you want to use [Docker Compose](https://docs.docker.com/compose/) to deploy
184190
4. Configure [systemd](https://systemd.io/) to run Prose at startup and run it:
185191

186192
```bash
187-
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/prose.service -o /etc/systemd/system/prose.service
193+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/prose.service -o /etc/systemd/system/prose.service
188194
systemctl daemon-reload
189195
systemctl enable prose
190196
systemctl start prose
191197
```
192198

193-
### Step 3: Configure the reverse proxy
199+
While `systemctl start prose` should have failed if something was wrong, you can still run the following command to make sure every part of your Prose Pod is running (you should see an empty table, with headers only):
194200

195-
! This section supposes you’re using [nginx](https://nginx.org/en/). If you use another reverse proxy, please update insctructions accordingly.
201+
```bash
202+
docker compose -f /etc/prose/compose.yaml ps --status=exited
203+
```
196204

197-
[nginx-template.conf in github.com/prose-im/prose-pod-system](https://github.com/prose-im/prose-pod-system/blob/master/nginx-template.conf)
205+
If you see one that has exited, check its logs using:
198206

199207
```bash
200-
apt install -y nginx
208+
docker compose -f /etc/prose/compose.yaml logs --no-log-prefix -- {service_name}
201209
```
202210

211+
! If the error logs aren’t clear enough, don’t hesitate [reaching out to our technical support team](#crisp-chat-open).
212+
213+
### Step 4: Configure the reverse proxy
214+
215+
The traffic to your Prose Pod will need to be routed by a [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy).
216+
217+
! This section supposes you’re using [nginx](https://nginx.org/en/). If you use another reverse proxy, please update insctructions accordingly.
218+
219+
To make deployments easier, we maintain a nginx configuration file at [templates/nginx.conf in github.com/prose-im/prose-pod-system](https://github.com/prose-im/prose-pod-system/blob/master/templates/nginx.conf). You can download and enable it using:
220+
203221
```bash
204-
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/nginx-template.conf -o /etc/nginx/sites-available/prose."${YOUR_DOMAIN:?}"
205-
sed -i s/\{your_domain\}/"${YOUR_DOMAIN:?}"/g /etc/nginx/sites-available/prose."${YOUR_DOMAIN:?}"
222+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/nginx.conf \
223+
| sed s/'{your_domain}'/"${YOUR_DOMAIN:?}"/g \
224+
> /etc/nginx/sites-available/prose."${YOUR_DOMAIN:?}"
206225
ln -s /etc/nginx/sites-{available,enabled}/prose."${YOUR_DOMAIN:?}"
207226
```
208227

209228
```bash
210229
systemctl reload nginx
211230
```
212231

213-
### Step 3: Check that your Prose Pod is running correctly
232+
### Step 5: `.well-known/host-meta`
233+
234+
```bash
235+
mkdir -p /var/www/default/.well-known/
236+
# .well-known/host-meta (XML)
237+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/host-meta \
238+
| sed s/'{your_domain}'/"${YOUR_DOMAIN:?}"/g \
239+
> /var/www/default/.well-known/host-meta
240+
# .well-known/host-meta.json
241+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/host-meta.json \
242+
| sed s/'{your_domain}'/"${YOUR_DOMAIN:?}"/g \
243+
> /var/www/default/.well-known/host-meta.json
244+
```
245+
246+
If your server is the one serving your domain and you don’t have a certificate just yet, TODO
247+
248+
```bash
249+
certbot --nginx -d ${YOUR_DOMAIN:?}
250+
```
251+
252+
```bash
253+
curl -L https://raw.githubusercontent.com/prose-im/prose-pod-system/refs/heads/master/templates/nginx-well-known.conf \
254+
| sed s/'{your_domain}'/"${YOUR_DOMAIN:?}"/g \
255+
> /etc/nginx/sites-available/"${YOUR_DOMAIN:?}"
256+
ln -s /etc/nginx/sites-{available,enabled}/"${YOUR_DOMAIN:?}"
257+
```
258+
259+
```bash
260+
systemctl reload nginx
261+
```
262+
263+
### Step 6: Check that your Prose Pod is running correctly
214264

215265
If you have a Web browser, you can check that your Prose Pod has started successfully by opening the Dashboard at `http://localhost:3030`.
216266

@@ -240,7 +290,7 @@ docker compose -f /etc/prose/compose.yaml logs
240290

241291
If the logs you see still don’t guide you to a solution, [reach out to our technical support team](#crisp-chat-open) which will gladly help you fix any issue you encounter.
242292

243-
### Step 4: Initializing your Prose Pod
293+
### Step 7: Initializing your Prose Pod
244294

245295
Now that your Prose Pod is running, you need to create the first admin account, configure your DNS records and invite your first colleague. All of this can be done using the administration Dashboard which is accessible at `http://localhost:3030`.
246296

0 commit comments

Comments
 (0)