How to install Postfix on Ubuntu
Want to send emails from your applications? Postfix is a reliable and secure mail transfer agent (MTA). This guide sets up a basic, secure outbound mail server.
Requirements
Linux VPS (Ubuntu 20.04+ recommended)
Domain name (DNS access required)
Open ports: 25, 587
Step 1: Update system
sudo apt update(Optional)
sudo apt upgrade -yStep 2: Install Postfix
sudo apt install postfix mailutils -yChoose:
Internet Site
Domain:
example.com
Step 3: Basic configuration
Minimal config:
Step 4: Start Postfix
Step 5: Test sending
Check logs:
Step 6: DNS setup (IMPORTANT)
Add:
MX → mail.example.com
A → mail.example.com → your IP
SPF:
Step 7: Enable authentication (basic)
Common issues
Emails go to spam
Missing SPF
No reverse DNS (PTR)
No DKIM
Done 🎉
Postfix is ready to send emails.
Last updated