Skip to content

Commit b216dea

Browse files
authored
docs: Improve documentation with quick start guide and clarifications (#705)
1 parent 9109a51 commit b216dea

8 files changed

Lines changed: 85 additions & 19 deletions

File tree

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,37 @@ The documentation includes:
4141

4242
See the [documentation](https://jeboehm.github.io/docker-mailserver/) for a complete feature list.
4343

44+
## Quick start
45+
46+
```bash
47+
# 1. Clone the repository or download a release
48+
git clone https://github.com/jeboehm/docker-mailserver.git
49+
cd docker-mailserver
50+
51+
# 2. Copy and edit the environment file (set passwords for MYSQL_PASSWORD,
52+
# REDIS_PASSWORD, CONTROLLER_PASSWORD, and DOVEADM_API_KEY)
53+
cp .env.dist .env
54+
55+
# 3. Pull images and start services
56+
bin/production.sh pull
57+
bin/production.sh up -d --wait
58+
59+
# 4. Create the first email account and admin user
60+
bin/production.sh run --rm web setup.sh
61+
```
62+
63+
After setup, access the management interface at
64+
`http://127.0.0.1:81/manager/` and webmail at `http://127.0.0.1:81/webmail/`.
65+
66+
For a complete walkthrough, see the
67+
[Getting Started tutorial](docs/tutorials/getting-started.md).
68+
4469
## Setup
4570

4671
`docker-mailserver` can be set up using Docker or Kubernetes.
4772

48-
For detailed installation instructions, see the [Installation Guide](https://jeboehm.github.io/docker-mailserver/installation/) in the documentation.
73+
For detailed installation instructions, see the
74+
[Installation Guide](docs/installation.md).
4975

5076
## Screenshots
5177

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This project enables you to operate your own email services, providing independe
1313
The documentation is organised by purpose:
1414

1515
- **[Tutorial: Getting Started](tutorials/getting-started.md)** — A step-by-step lesson to install docker-mailserver with Docker Compose and create your first mailbox.
16-
- **How-to guides** — Task-oriented guides for specific goals (install on Kubernetes, configure DNS, manage users, configure TLS, and more). See the [How-to](how-to/install-docker.md) section in the navigation.
16+
- **How-to guides** — Task-oriented guides for specific goals: [install with Docker](how-to/install-docker.md), [install on Kubernetes](how-to/install-kubernetes.md), [configure DNS](how-to/configure-dns.md), [configure TLS](how-to/configure-tls.md), [manage users](how-to/manage-users.md), and more.
1717
- **Reference** — Technical descriptions: [environment variables](reference/environment-variables.md), [DNS records](reference/dns-records.md), [ports](reference/ports.md), [service architecture](reference/service-architecture.md), [user roles](reference/user-roles.md), and related topics.
1818
- **Explanation** — Background and context: [architecture](explanation/architecture.md), [DNS and email delivery](explanation/dns-and-email.md), [observability](explanation/observability.md).
1919

docs/how-to/configure-tls.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# How to Configure TLS Certificates
22

3-
By default the mailserver uses a shared `data-tls` volume with internally generated certificates. To use external certificates (e.g. Let’s Encrypt), mount certificate and key files into the MTA and MDA containers.
3+
This guide covers TLS for mail protocols (SMTP, IMAP, POP3) served by the MTA (Postfix) and MDA (Dovecot) containers. To terminate TLS for the web interface (port 81), use a reverse proxy — see [How to configure a reverse proxy](configure-reverse-proxy.md).
4+
5+
By default the mailserver uses a shared `data-tls` volume with internally generated certificates. To use external certificates (e.g. Let's Encrypt), mount certificate and key files into the MTA and MDA containers.
46

57
## Certificate locations
68

docs/how-to/install-docker.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
This guide describes how to install docker-mailserver using Docker Compose.
44

5+
If you are setting up docker-mailserver for the first time, the [Getting Started tutorial](../tutorials/getting-started.md) provides a step-by-step walkthrough that covers these same steps with more explanation.
6+
57
## Prerequisites
68

7-
- Docker and Docker Compose
8-
- Domain name with DNS configured
9-
- Basic familiarity with email server administration
9+
- Docker and Docker Compose installed on the host
10+
- A domain name
11+
- Root or sudo access on the host
1012

1113
## Steps
1214

docs/how-to/install-kubernetes.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# How to Install on Kubernetes
22

3-
This guide describes how to deploy docker-mailserver on Kubernetes with Kustomize. An external MySQL-compatible database is required; the kustomization does not provision a database.
3+
This guide describes how to deploy docker-mailserver on Kubernetes with
4+
Kustomize. An external MySQL-compatible database is required; the
5+
kustomization does not provision a database.
46

5-
A full example is in [example-configs/kustomize/external-db-and-https-ingress](https://github.com/jeboehm/docker-mailserver/tree/main/docs/example-configs/kustomize/external-db-and-https-ingress).
7+
A full example is in [example-configs/kustomize/external-db-and-https-ingress](../example-configs/kustomize/external-db-and-https-ingress/).
68

79
## Prerequisites
810

@@ -12,9 +14,16 @@ A full example is in [example-configs/kustomize/external-db-and-https-ingress](h
1214

1315
## Steps
1416

15-
### 1. Configure environment (ConfigMap)
17+
### 1. Configure environment (ConfigMap and Secrets)
1618

17-
Copy `.env.dist` to `.env`, edit it, and create a ConfigMap from it. Create Kubernetes secrets for database credentials and other sensitive values. See [Environment variables reference](../reference/environment-variables.md).
19+
Use `.env.dist` as a reference for required variables. Create a Kubernetes
20+
ConfigMap for non-sensitive values and Secrets for sensitive values
21+
(credentials, passwords, API keys). See [Environment variables reference](../reference/environment-variables.md) for the full list.
22+
23+
See the
24+
[example-configs/kustomize/external-db-and-https-ingress](../example-configs/kustomize/external-db-and-https-ingress/)
25+
directory for a sample configuration showing how to structure these
26+
resources.
1827

1928
### 2. Create namespace
2029

@@ -28,6 +37,10 @@ kubectl create namespace mail
2837
bin/create-tls-certs.sh
2938
```
3039

40+
This writes a self-signed certificate to `config/tls/tls.crt` and key to
41+
`config/tls/tls.key`. For production, use CA certificates (e.g.
42+
cert-manager with Let's Encrypt) instead.
43+
3144
### 4. Create TLS secret
3245

3346
```bash
@@ -58,13 +71,24 @@ Wait until all pods are running and healthy.
5871
kubectl exec -n mail -it deployment/web -c php-fpm -- setup.sh
5972
```
6073

61-
Use the wizard to set initial configuration, create the first email address, and create an admin user.
74+
Use the wizard to set initial configuration, create the first email
75+
address, and create an admin user.
6276

6377
### 8. Access the management interface
6478

6579
Use your configured ingress and the admin credentials from the wizard.
6680

6781
## Post-installation
6882

69-
- Configure DNS and TLS as for Docker. See [How to configure DNS](configure-dns.md) and [How to configure TLS certificates](configure-tls.md).
83+
- Configure DNS and TLS like Docker deployment. See [How to configure DNS](configure-dns.md) and [How to configure TLS certificates](configure-tls.md).
7084
- Change `DOVEADM_API_KEY` from default if using observability (v7.3+).
85+
86+
## Troubleshooting
87+
88+
- **Pods not starting:** Check logs with `kubectl logs -n mail <pod-name>`
89+
and events with `kubectl describe pod -n mail <pod-name>`.
90+
- **Database errors:** Verify database connectivity and that the
91+
`MYSQL_*` variables in ConfigMap/Secrets are correct.
92+
- **TLS errors:** Confirm the `tls-certs` secret exists in the `mail`
93+
namespace and certificate paths are correct.
94+
- **Setup wizard fails:** Ensure the web pod is running (`kubectl get pods -n mail`) before running the exec command.

docs/reference/environment-variables.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@ When using the Redis service provided by docker-mailserver compose or kustomize,
4444

4545
### Relay
4646

47-
| Variable | Default | Description |
48-
| ------------------- | ------- | --------------------------------- |
49-
| `RELAYHOST` | `false` | SMTP relay host for outgoing mail |
50-
| `RELAY_PASSWD_FILE` | `false` | Path to relay authentication file |
47+
Set `RELAYHOST` to `[hostname]:port` to route all outgoing mail through an external SMTP server. Leave unset to deliver directly.
48+
49+
| Variable | Default | Description |
50+
| ------------------- | ------------ | ----------------------------------------------------------------- |
51+
| `RELAYHOST` | _(disabled)_ | SMTP relay host for outgoing mail (e.g. `[smtp.example.com]:587`) |
52+
| `RELAY_PASSWD_FILE` | _(disabled)_ | Path to relay authentication file (inside the MTA container) |
5153

5254
### Filter
5355

54-
| Variable | Default | Description |
55-
| ------------- | ------- | ---------------------------- |
56-
| `FILTER_MIME` | `false` | Enable MIME header filtering |
56+
| Variable | Default | Description |
57+
| ------------- | ------------ | ---------------------------- |
58+
| `FILTER_MIME` | _(disabled)_ | Enable MIME header filtering |
5759

5860
## Extended Configuration
5961

docs/reference/ports.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ Services and ports exposed by docker-mailserver.
1313
| Management Interface | http://127.0.0.1:81/manager/ |
1414
| Webmail | http://127.0.0.1:81/webmail/ |
1515
| Rspamd web interface | http://127.0.0.1:81/rspamd/ |
16+
17+
## Binding and exposure
18+
19+
The base `docker-compose.yml` creates no host port bindings. `bin/production.sh` includes `docker-compose.production.yml`, which binds all mail and web ports to `0.0.0.0` — making them accessible from the internet. Use host firewall rules to control which source IPs can reach these ports.
20+
21+
The management interface, webmail, and Rspamd web interface (port 81) use plain HTTP. Terminate TLS at a reverse proxy before exposing these to a network. See [How to configure a reverse proxy](../how-to/configure-reverse-proxy.md).

docs/tutorials/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Edit `.env` and set at least:
3636
- `CONTROLLER_PASSWORD` (required for Rspamd)
3737
- `DOVEADM_API_KEY` (required for Dovecot API)
3838

39+
Use strong, unique values for each password — do not leave them empty or use the same value for all. These credentials protect internal service communication.
40+
3941
For a full list of variables, see [Environment variables reference](../reference/environment-variables.md).
4042

4143
## Step 3: Pull and start services
@@ -73,6 +75,8 @@ Open a browser and go to:
7375

7476
Log in with the admin credentials you set in the wizard. You should see the dashboard.
7577

78+
> **Note:** Port 81 uses plain HTTP. For production, place the mailserver behind a reverse proxy that terminates TLS. See [How to configure a reverse proxy](../how-to/configure-reverse-proxy.md).
79+
7680
## Step 6: Check the dashboard
7781

7882
On the dashboard you will see an overview of the mailserver: domains, users, and quick links. From here you can add domains, users, and aliases.

0 commit comments

Comments
 (0)