Skip to content

Instantly share code, notes, and snippets.

@phanlyhuynh
Last active August 30, 2023 03:28
Show Gist options
  • Save phanlyhuynh/268d285fc050cd17a2b8988a2d4dfef6 to your computer and use it in GitHub Desktop.
Save phanlyhuynh/268d285fc050cd17a2b8988a2d4dfef6 to your computer and use it in GitHub Desktop.
Install mailhog on ubuntu
curl -OL https://golang.org/dl/go1.18.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go env -w GO111MODULE=off
go get github.com/mailhog/MailHog
sudo cp ./go/bin/MailHog /usr/local/bin/mailhog
cd /etc/systemd/system/
sudo nano mailhog.service
[Unit]
Description=MailHog service
[Service]
ExecStart=/usr/local/bin/mailhog \
-api-bind-addr 0.0.0.0:8025 \
-ui-bind-addr 0.0.0.0:8025 \
-smtp-bind-addr 0.0.0.0:1025
[Install]
WantedBy=multi-user.target
sudo systemctl start mailhog
sudo systemctl enable mailhog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment