DropVPS Team
Writer: John hens
How to setup smtp server in ubuntu 25.10

Table of Contents
Setting up an SMTP server on Ubuntu 25.10 allows you to send emails directly from your server for applications, notifications, or personal use.
Step 1: Update Your System
Before installing any software, make sure your system is up to date. This prevents compatibility issues and ensures a smooth setup.
sudo apt update && sudo apt upgrade -y
Step 2: Install Postfix
Postfix is a powerful and widely used SMTP server that handles sending and receiving emails efficiently. Installing it on Ubuntu 25.10 ensures a stable foundation for your email server setup.
sudo apt install postfix -y
Step 3: Configure Postfix
After installing Postfix, it’s essential to configure it properly to handle outgoing emails, define your domain, and ensure secure and reliable mail delivery on Ubuntu 25.10.
sudo nano /etc/postfix/main.cf
Add or update these lines (replace yourdomain.com with your actual domain):
myhostname = mail.yourdomain.com
mydomain = yourdomain.com
myorigin = /etc/mailname
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
Step 4: Restart Postfix
After configuring Postfix, you need to restart the service to apply all changes and ensure your SMTP server is running correctly and ready to handle email traffic on Ubuntu 25.10.
sudo systemctl restart postfix
sudo systemctl enable postfix
Step 5: Configure Firewall
To allow your SMTP server to send and receive emails, you must open the SMTP port in the firewall. This ensures secure and uninterrupted email communication on your Ubuntu 25.10 system.
sudo ufw allow 25/tcp
sudo ufw reload
Step 6: Test SMTP Server
Once Postfix is installed and the firewall is configured, it’s important to test your SMTP server to ensure it is working correctly and can send and receive emails without issues.
telnet localhost 25
Step 7: Enable SMTP Authentication
For enhanced security and to prevent unauthorized use of your SMTP server, it’s recommended to enable SMTP authentication. This ensures that only verified users can send emails through your server.
sudo apt install libsasl2-modules
sudo postconf -e 'smtpd_sasl_auth_enable = yes'
sudo systemctl restart postfix