# Self-host smtp4dev

> Fake SMTP server that catches outgoing mail in a web inbox, for testing apps without sending real email.

- Page: https://levelrail.com/templates/smtp4dev/
- JSON: https://levelrail.com/templates/smtp4dev.json
- Category: Developer Tools
- Licence: BSD-3-Clause (Permissive license)
- Source: https://github.com/rnwood/smtp4dev
- Upstream docs: https://github.com/rnwood/smtp4dev/wiki

## Requirements
- Memory: about 128 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 3.16.1

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| smtp4dev | rnwood/smtp4dev | 3.16.1 | 80, 25 | data -> /smtp4dev |

## Deploy

### CLI

```bash
levelrail-cli templates deploy smtp4dev --name my-smtp4dev
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/smtp4dev/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Point your app at port 25 of this container and open the address to read what it sent. It has no login, so keep it private.

## Questions

### Can I deploy smtp4dev on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for smtp4dev, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image rnwood/smtp4dev:3.16.1 is what you deploy there.

Self-host smtp4dev, smtp4dev docker compose file, deploy smtp4dev on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
