Debug SMTP with style using MailCatcher NG. All images are based on Alpine Linux
100K+
MailCatcher NG on the latest Alpine Linux. Catch every email your application sends, and read them in a web UI, without delivering anything to real recipients.
docker run -d --name mailcatcher -p 1080:1080 -p 1025:1025 stpaquet/alpinemailcatcher
localhost:1025.On Docker Machine setups (Windows or older Mac), use the Docker Machine IP instead of localhost.
Set these with -e on docker run or in a docker-compose.yml file.
| Variable | Default | Description |
|---|---|---|
MAIL_LIMIT | 50 | Maximum number of messages kept in memory |
TIMEZONE | UTC | Timezone used inside the container |
LANG | en_US.UTF-8 | Locale |
LC_ALL | en_US.UTF-8 | Locale |
LANGUAGE | en_US.UTF-8 | Language |
Example: keep up to 60 messages.
docker run -d --name mailcatcher -p 1080:1080 -p 1025:1025 -e MAIL_LIMIT=60 stpaquet/alpinemailcatcher
The ports inside the container are fixed. Change the host side of the mapping instead. This example exposes the web UI on 3080 and SMTP on 3025:
docker run -d --name mailcatcher -p 3080:1080 -p 3025:1025 stpaquet/alpinemailcatcher
services:
mailcatcher:
image: stpaquet/alpinemailcatcher:latest
container_name: mailcatcher
restart: on-failure:10
environment:
- MAIL_LIMIT=70
- TIMEZONE=America/Los_Angeles
ports:
- "1080:1080"
- "1025:1025"
By default messages live in memory and are lost when the container stops. To store them in SQLite, mount a volume on the MailCatcher home directory and start MailCatcher with --persistence:
docker run -d --name mailcatcher \
-p 1080:1080 -p 1025:1025 \
-v mailcatcher-data:/home/mailcatcher/.mailcatcher \
stpaquet/alpinemailcatcher \
sh -c "mailcatcher --foreground --smtp-port=1025 --http-port=1080 --ip=0.0.0.0 --messages-limit=50 --persistence"
The database is stored at /home/mailcatcher/.mailcatcher/mailcatcher.db inside the container.
With Docker Compose:
services:
mailcatcher:
image: stpaquet/alpinemailcatcher:latest
ports:
- "1080:1080"
- "1025:1025"
volumes:
- mailcatcher-data:/home/mailcatcher/.mailcatcher
command: sh -c "mailcatcher --foreground --smtp-port=1025 --http-port=1080 --ip=0.0.0.0 --messages-limit=$$MAIL_LIMIT --persistence"
volumes:
mailcatcher-data:
docker pull stpaquet/alpinemailcatcher:latest
If docker pull fails with unauthorized: please use personal access token, your Docker Hub account uses 2FA. Create a Docker Hub access token, then run docker login --username <username> and use the token as the password.
| Component | Version |
|---|---|
| Alpine Linux | 3.24.4 |
| MailCatcher NG | 1.7.0 |
| Ruby | 3.4.9 |
| SQLite | 3.54.1 |
Ruby and SQLite versions can change when the image is rebuilt. To list every installed package in a running container:
docker exec -i mailcatcher apk info -vv | sort
linux/amd64 (x86_64)linux/arm64 (Apple Silicon, ARM servers)linux/386 (x86_32)linux/arm/v7 and linux/arm/v6Need another architecture? Update the Dockerfile and open a pull request.
Released under the MIT License.
Content type
Image
Digest
sha256:0dbd32a2b…
Size
27.1 MB
Last updated
1 day ago
docker pull stpaquet/alpinemailcatcher