For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 -y

Step 2: Install Postfix

sudo apt install postfix mailutils -y

Choose:

  • 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