Skip to main content

Catch dev email in docker-compose with one service

Need an SMTP server in Docker for development? Add Buggregator as one more service in your docker-compose.yml, then set your app's mail host to buggregator and the port to 1025. Every email your app sends shows up in the Buggregator UI on port 8000 instead of a real inbox.

Steps

1. Add the service

Put Buggregator in your docker-compose.yml next to your other services. No environment configuration is needed.

yaml
services:
  buggregator:
    image: ghcr.io/buggregator/server:latest
    ports:
      - 127.0.0.1:8000:8000
      - 127.0.0.1:1025:1025
      - 127.0.0.1:9912:9912
      - 127.0.0.1:9913:9913

You only need to expose the ports for the features you use. Port 8000 is the web UI and the only required port. Port 1025 is the SMTP server. The 127.0.0.1: prefix keeps each port on your machine.

2. Point your app at the service name

Other services in the same Compose stack reach Buggregator by its service name. For a Laravel app, change these lines in .env:

dotenv
# SMTP — email capture
MAIL_HOST=buggregator
MAIL_PORT=1025

Other frameworks follow the same rule: wherever their docs say 127.0.0.1, use buggregator. For Symfony that means MAILER_DSN=smtp://buggregator:1025. No authentication is required.

3. Send an email and open the UI

Trigger any email from your app, then open http://127.0.0.1:8000. The email appears with the HTML preview, plain text, addresses, attachments and raw source.

Why it works

Buggregator includes a fake SMTP server on port 1025 that stores each email instead of delivering it. Inside one Compose stack, the service name resolves to the Buggregator container, so changing the host is the only change your app needs.

Checked on with Buggregator v2.8.0

Setup in 60 seconds

No registration. No account. Start it and point your app at it.

1

Start Buggregator

One file, installed with one command. The web UI opens on port 8000. Prefer containers? Use the Docker tab.

$ curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
$ HTTP_ADDR=127.0.0.1:8000 \
  SMTP_ADDR=127.0.0.1:1025 \
  VAR_DUMPER_ADDR=127.0.0.1:9912 \
  MONOLOG_ADDR=127.0.0.1:9913 \
  PROXY_ADDR=127.0.0.1:8080 \
  ~/.local/bin/buggregator

The script picks the file for your CPU: Intel/AMD or ARM.

One file for Linux, macOS and Windows, about 40 MB. Nothing else to install.

This run line keeps it on this computer. Without the *_ADDR settings it listens on all network interfaces →

Rather not run a script? Download the file yourself →

Runs on Windows, macOS and Linux, on Intel/AMD and ARM.

Prefer not to do it yourself? Your AI agent can set Buggregator up for you →