Skip to content

Commit 2014ea5

Browse files
committed
installation/docker: Document how to use Docker images
1 parent 2bfb822 commit 2014ea5

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

docs/installation/docker.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
--
2+
layout: doc
3+
title: Running with Docker
4+
order: 8
5+
--
6+
7+
# Running with Docker
8+
9+
Dovecot CE comes with Docker images published at https://hub.docker.com/r/dovecot/dovecot.
10+
11+
## Minimal setup
12+
13+
To run Dovecot you can start it with:
14+
15+
```console
16+
docker run -p 143:31143 -p 993:31993 dovecot/dovecot:latest
17+
```
18+
19+
This will expose IMAP and IMAPS ports, but all data is kept locally.
20+
21+
## Persisting mail data
22+
23+
To persist data, mount volume to `/srv/vmail`. Remember that this needs to be writable to UID 1000 internally.
24+
25+
Example:
26+
27+
```console
28+
docker run -v /srv/vmail:/srv/vmail -p 143:31143 -p 993:31993 dovecot/dovecot:latest
29+
```
30+
31+
## Configuring instance
32+
33+
34+
These docker images are rootless since v2.4.0. This means they are ran with vmail (UID 1000).
35+
36+
To change configuration, put configuration drop-ins to `/etc/dovecot/conf.d`.
37+
38+
Example:
39+
40+
```console
41+
docker run -v /etc/dovecot-config:/etc/dovecot/conf.d,ro -v /srv/vmail:/srv/vmail -p 143:31143 -p 993:31993 dovecot/dovecot:latest
42+
```
43+
44+
Dovecot uses TLS certificates from `/etc/dovecot/ssl` directory. The full chain certificate name is expected to be `tls.crt`, and key file `tls.key`.
45+
46+
POP3 service is not enabled by default, if you need pop3, place a pop3.conf drop-in to conf.d:
47+
48+
```
49+
protocols {
50+
pop3 = yes
51+
}
52+
```
53+
54+
By default imap, submission, lmtp and sieve protocols are enabled.
55+
56+
## Listening ports
57+
58+
Since v2.4.1 ports are exposed as non-privileged ports. You need to map these
59+
to the ports that you need.
60+
61+
### Exposed protocols
62+
63+
| Protocol | Port |
64+
| ----------- | ----- |
65+
| imap | 31143 |
66+
| imaps | 31993 |
67+
| pop3 | 31110 |
68+
| pop3s | 31990 |
69+
| submissions | 31465 |
70+
| submission | 31587 |
71+
| lmtps | 31024 |
72+
| managesieve | 34190 |
73+
| HTTP API | 8080 |
74+
| Metrics | 9090 |
75+
76+
## Running read-only
77+
78+
To run the system fully read-only, use:
79+
80+
```console
81+
docker run --read-only --tmpfs /tmp --tmpfs /run/dovecot -v /srv/vmail:/srv/vmail --rm -it dovecot/dovecot:latest
82+
```
83+
84+
Dovecot will need write permissions to `/tmp`, `/run` and persistent mail storage at `/srv/vmail`.
85+
86+
## Running without Linux capabilities
87+
88+
By default, Dovecot needs `CAP_SYS_CHROOT` capability. To remove this requirements, you can prevent chrooting
89+
by placing no-chroot.conf to drop-in directory:
90+
91+
```
92+
service submission-login {
93+
chroot =
94+
}
95+
service imap-login {
96+
chroot =
97+
}
98+
service pop3-login {
99+
chroot =
100+
}
101+
service managesieve-login {
102+
chroot =
103+
}
104+
service imap-urlauth-login {
105+
chroot =
106+
}
107+
```
108+
109+
and run Dovecot using:
110+
111+
```console
112+
docker run -v /etc/dovecot-config:/etc/dovecot/conf.d,ro --security-opt "no-new-privileges" --rm -it dovecot/dovecot:latest
113+
```

0 commit comments

Comments
 (0)