Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Set Up a Postfix Mail Server on Ubuntu

Postfix is the classic MTA on Ubuntu. Usable mail also needs DNS (MX/SPF/DKIM) and often a relay; this guide gets the server ready to send as a base.

Steps

  1. Set an FQDN hostname and update /etc/hosts:

    sudo hostnamectl set-hostname mail.yourdomain.com
    hostname -f
  2. Install Postfix (choose Internet Site and your mail domain):

    sudo apt update
    sudo DEBIAN_FRONTEND=noninteractive apt install -y postfix
    sudo dpkg-reconfigure postfix
  3. Confirm it listens on port 25 and restart if needed:

    sudo systemctl enable --now postfix
    sudo ss -lntp | grep ':25'
  4. Test a local send:

    echo 'Xernode test' | mail -s 'Test' root
    sudo tail -n 30 /var/log/mail.log

Tips

  • Many providers block outbound port 25 — use an authenticated SMTP relay if mail never leaves.
  • Add MX, SPF and DKIM records in DNS before production use.

ext step

A clean-IP VPS for your stack: Deploy your Cloud VPS.

Related guides