Due to application versions, I have 3 laravel Homestead boxes. I'm using MacOS.
For each of them I do:
v10.17
laravel/homestead 9.7.2
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-124-generic x86_64)
$ vagrant ssh
then
$ mailhog
2021/09/28 23:10:17 Using in-memory storage
2021/09/28 23:10:17 [SMTP] Binding to address: 0.0.0.0:1025
[HTTP] Binding to address: 0.0.0.0:8025
2021/09/28 23:10:17 Serving under http://0.0.0.0:8025/
2021/09/28 23:10:17 [SMTP] Error listening on socket: listen tcp 0.0.0.0:1025: bind: address already in use
Does mailhog work at http://localhost:8025/ ? YES!
v12.2.0
laravel/homestead 11.3.0
$ vagrant ssh
$ mailhog
2021/09/29 00:13:39 Using in-memory storage
2021/09/29 00:13:39 [SMTP] Binding to address: 0.0.0.0:1025
2021/09/29 00:13:39 [SMTP] Error listening on socket: listen tcp 0.0.0.0:1025: bind: address already in use
Does mailhog work at http://localhost:8025/ ? YES!
v12.6.0
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-73-generic x86_64)
* Homestead v12.6.0 | Thanks for using Homestead
* Settler v11.4.0
$ mailhog
2021/09/28 23:12:59 Using in-memory storage
2021/09/28 23:12:59 [SMTP] Binding to address: 0.0.0.0:1025
[HTTP] Binding to address: 0.0.0.0:8025
2021/09/28 23:12:59 [SMTP] Error listening on socket: listen tcp 0.0.0.0:1025: bind: address already in use
Does mailhog work at http://localhost:8025/ ? NO :(
Why isn't mailhog working in my latest Laravel Homestead?
Final notes: In my case, Mailhog does work in laravel/homestead box v11.3.0, but not on v11.4.0 , why?
In recent releases of Laravel Homestead, the server IP address has changed. For example, in latest Laravel Homestead, the IP address is 192.168.56.56
. So in order to access to mailhog in the browser, I must type the given IP address, followed by the Mailhog port like so:
http://192.168.56.56:8025/
and that did the trick.