Mailpit binds to 0.0.0.0 in localhost mode (Local 10.2.0)

What issue or error are you experiencing?

I’m using Local 10.2.0 on macOS with Mailpit 1.24.1.

After switching Router Mode to localhost, my WordPress site and database listen only on loopback addresses. However, Mailpit continues listening on all network interfaces:

  • 0.0.0.0:10000 (Web UI/API)

  • 0.0.0.0:10001 (SMTP)

I confirmed that Local launches Mailpit with the following environment variables:

MP_UI_BIND_ADDR=0.0.0.0:10000
MP_SMTP_BIND_ADDR=0.0.0.0:10001

I would like to restrict Mailpit to 127.0.0.1 without modifying Local’s internal application files.

What steps can be taken to replicate the issue?

  1. Start Local 10.2.0 on macOS.

  2. Switch Router Mode to localhost under Preferences → Advanced.

  3. Start a local WordPress site.

  4. Check Mailpit’s listening addresses using lsof.

  5. Observe that Mailpit still binds to 0.0.0.0 on ports 10000 and 10001.

Questions

  1. Is there an officially supported way to bind Mailpit’s Web UI and SMTP services to localhost only?

  2. Can Mailpit be disabled independently while keeping WordPress running?

  3. Will the configuration persist after restarting or updating Local?

  4. Is there a recommended workaround or planned fix?

Thank you for your assistance.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:

  • Operating System (OS) and OS version:


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Dear Local Team,
I’m using Local 10.2.0 (Apple Silicon, macOS) to develop a private WordPress testing environment.
During initial testing, I noticed that Mailpit was listening on wildcard network interfaces rather than being restricted to localhost.
I investigated the issue and found that Local’s Mailpit launcher explicitly sets:

MP_UI_BIND_ADDR=0.0.0.0:<WEB_PORT>
MP_SMTP_BIND_ADDR=0.0.0.0:<SMTP_PORT>

On my system, the Mailpit UI and SMTP services were observed listening on IPv6 wildcard addresses, using ports 10001 and 10002.
In contrast, nginx and MySQL were correctly restricted to loopback interfaces.
For security reasons, I would prefer all development services to be accessible only from my local computer.
Could you please clarify:

  1. Is there an officially supported way to configure Mailpit to bind exclusively to 127.0.0.1?
  2. Can Mailpit be disabled for an individual Local site?
  3. Is this wildcard binding behaviour intentional in Local 10.2.0?
  4. Is there a recommended workaround or planned update to address this?
    I would prefer not to modify Local’s internal application files or service launch scripts.
    The development site is currently stopped pending clarification.
    Thank you for your assistance.
    Kind regards,
    William

Hi @yashinoki.3963 and @will.adi! Thank you for reaching out here.

I’ve passed this along to our Devs, who are doing some further investigation into your Mailpit concerns. For now, Local doesn’t currently offer a way to override the address. We’ll keep you posted with any updates!