# Self-host Mailpit

> A local SMTP server and web inbox for catching and inspecting outgoing email during development.

- Page: https://levelrail.com/templates/mailpit/
- JSON: https://levelrail.com/templates/mailpit.json
- Category: Developer Tools
- Licence: MIT (Permissive license)
- Source: https://github.com/axllent/mailpit
- Upstream docs: https://mailpit.axllent.org/docs/

## Requirements
- Memory: about 128 MiB
- amd64: published, arm64: tested
- Needs configuration before start: no
- Pinned image tag: v1.21.8

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| mailpit | axllent/mailpit | v1.21.8 | 8025 | mailpit_data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| mailpit | MP_DATABASE | preset |

## Deploy

### CLI

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

### API

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

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

## Questions

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

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id mailpit for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image axllent/mailpit:v1.21.8 is what you deploy there.

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