Install Postfix on an Ubuntu test server
Install the distribution package, choose a local-only starting configuration, and inspect Postfix before configuring an Internet-facing mail domain.
Reviewed
Postfix is an SMTP mail transfer agent, not a complete IMAP or webmail suite. This guide installs the Ubuntu package on an isolated test host and keeps network access restricted while you prepare domain and relay policy. It does not configure production mail delivery.
Still choosing the software? Our Linux mail-server comparison explains where Postfix fits beside integrated servers and packaged stacks.
Prepare a clean test host
Use a supported Ubuntu Server release with sudo access and no existing mail workload. Installing an MTA can replace another package that provides the system mail service: review apt’s proposed removals before approving them. Do not run this on a host whose mail queue you need to preserve.
Keep inbound SMTP blocked at the host/provider firewall during installation; packages may start services automatically. Leave production MX records unchanged. For later public delivery, you will need a hostname you control, suitable DNS, permitted SMTP traffic, and reverse DNS if sending directly.
Install the package and select local-only operation
Following Ubuntu’s Postfix installation documentation, run:
sudo apt update
sudo apt install postfix
sudo dpkg-reconfigure postfix
In the configuration wizard, choose Local only for this initial test. Use your intended host identity when prompted; do not copy a tutorial’s example domain or add an entire cloud subnet to trusted networks. If the installer already ran the wizard, the reconfiguration command lets you review its choices.
Inspect the resulting configuration and service:
sudo postfix check
postconf inet_interfaces myhostname mydestination mynetworks
systemctl status postfix --no-pager
sudo ss -ltnp
postfix check reports configuration/permission problems; no output alone does not prove delivery works. Confirm SMTP is restricted to the expected local listeners and trusted networks. Some distribution service units are wrappers, so check listeners and logs as well as service status. Keep configuration output private if it exposes infrastructure names.
Configure a domain before exposing SMTP
Continue with Postfix domain and relay policy before changing listeners or MX. Configure accepted recipients, local delivery, TLS, and the rejection of unauthorized relay deliberately. If applications need to submit outgoing mail, use the separate authenticated submission guide.
IMAP access requires another service such as Dovecot. A successful package installation supplies neither mailbox access nor SPF/DKIM/DMARC configuration, backups, or a trustworthy sending IP. Keep the host isolated until acceptance, rejection, and recovery tests pass.
These are source-based installation instructions, not a claim that MailKite has installed or load-tested this exact Ubuntu/Postfix combination.