Linux Setup Guide (Debian, Ubuntu, Rocky Linux, Fedora, openSUSE)

August 23, 2026 · View on GitHub

Every example in this repo runs on any of these distributions — the SMTP connection itself (port 587/465, TLS) is identical everywhere. What differs is how you install the prerequisites. This page is a quick reference so you don't have to guess package names per distro.

Don't want to install anything locally at all? Open this repo in the included Dev Container (or as a GitHub Codespace via the badge in the README) — every runtime in the tables below comes preinstalled.

The username and password come from an account, and the account is free. Register at msgwing.com, activate, and copy the generated login and password — they are shown once. Mail leaves from that generated @msgwing.com address rather than your own domain, and the cap is 200 messages a day with no paid tier that lifts it. Both limits are stated here rather than discovered later; if either one rules this out for you, the alternatives page names the tools that do not have them.

Base tools (curl, openssl)

Needed for check-connection.sh and bash-curl-zerosmtp.sh.

DistroCommand
Debian / Ubuntusudo apt update && sudo apt install -y curl openssl
Rocky Linuxsudo dnf install -y curl openssl
Fedorasudo dnf install -y curl openssl
openSUSEsudo zypper install -y curl openssl

curl and openssl ship preinstalled on most of these distros already — this is only needed for minimal/container base images.

swaks (for bash-swaks-zerosmtp.sh)

swaks isn't in every distro's default repos the same way:

DistroCommand
Debian / Ubuntusudo apt install -y swaks
Fedorasudo dnf install -y swaks (in Fedora's own repos)
Rocky Linuxsudo dnf install -y epel-release && sudo dnf install -y swaks (needs EPEL)
openSUSEsudo zypper addrepo https://download.opensuse.org/repositories/server:mail/openSUSE_Tumbleweed/server:mail.repo && sudo zypper refresh && sudo zypper install -y swaks (adjust the repo URL for your openSUSE version)

Language runtimes

Only install what you need for the example(s) you're using — see the Code Examples table for which file needs which.

LanguageDebian/Ubuntu (apt)Rocky/Fedora (dnf)openSUSE (zypper)
Pythonpython3python3python3
PHP + Composerphp-cli composerphp-cli composerphp composer
Node.js / TypeScriptnodejs npmnodejs npmnodejs npm
Rubyrubyrubyruby
Lualua5.4 lua-socket lua-seclua lua-socket lua-seclua54 lua-socket lua-sec
Perllibio-socket-ssl-perl libauthen-sasl-perlperl-IO-Socket-SSL perl-Authen-SASLperl-IO-Socket-SSL perl-Authen-SASL
C (libcurl)gcc libcurl4-openssl-devgcc libcurl-develgcc libcurl-devel
Dartsee Dart's install docs — package names vary by distrosamesame
Gogolang-gogolanggo
Javadefault-jdkjava-21-openjdk-develjava-21-openjdk-devel
Kotlininstall Gradle manually (no build needed — gradle build fetches Kotlin itself)samesame
.NET / C#see Microsoft's install docs — package names vary by exact distro versionsamesame
Rustcurl https://sh.rustup.rs -sSf | sh (via rustup, same on every distro)samesame
Maven (for the Java example)mavenmavenmaven

Want the whole system to relay through ZeroSMTP?

If you want cron jobs, mail/sendmail, or monitoring tools to send through ZeroSMTP instead of a specific script, see SYSTEM-MTA.md for Postfix (satellite/smarthost mode), msmtp, and Exim4 configuration.

More than one machine

Doing the msmtp setup by hand is fine once. For a fleet, use ansible-zerosmtp.yml, which does the same thing — installs msmtp and the sendmail shim, writes /etc/msmtprc at mode 0600, redirects root's mail to a real address, and verifies the result with msmtp --pretend:

ansible-playbook -i inventory.ini ansible-zerosmtp.yml -e zerosmtp_username=you@msgwing.com -e zerosmtp_password=... -e zerosmtp_from=you@msgwing.com -e zerosmtp_to=alerts@example.com

Keep the password out of your shell history by putting these variables in an ansible-vault file instead and running with --ask-vault-pass.

Connectivity

Everything else — firewall rules, ports, TLS — behaves the same across all five distros; there's nothing distro-specific to configure for outbound SMTP. If a send hangs or times out, it's almost always the network (cloud provider or ISP blocking outbound SMTP), not the OS — run check-connection.sh first and see TROUBLESHOOTING.md.