How to Self-Host Postal SMTP Server: Easy Mode (2026)
If you want your websites, SaaS tools, automations, or WordPress projects to send transactional email without paying a fee for every message, Postal is one of the strongest open-source SMTP platforms you can run on your own server.
TL;DR
This tutorial walks through a practical Postal SMTP installation on an Ubuntu VPS using Docker. You will configure the server hostname, firewall, reverse DNS, Postal itself, HTTPS, sending domains, SPF, DKIM, SMTP credentials, testing, backups, and basic deliverability.
What you should have at the end
- A self-hosted Postal server with a private web dashboard.
- SMTP credentials for apps and websites.
- A verified sending domain with SPF and DKIM.
- Reverse DNS/PTR configured for better deliverability.
- HTTPS access to the Postal admin interface.
- A firewall exposing only the services you need.
- Automated database backups.
What Is Postal SMTP?
Postal is an open-source mail delivery platform designed for sending messages from applications and online services. It gives you an SMTP server and HTTP API while also providing message logs, domain management, bounce information, delivery events, DKIM signing, and other tools normally associated with paid email delivery services.
Why Self-Host Postal Instead of Paying for an SMTP Service?
The biggest advantage is control. With a hosted SMTP provider, pricing, account limits, acceptable-use rules, and retention policies are controlled by another company. With Postal, the software and delivery infrastructure run on your own VPS.
Self-hosting can also become attractive as sending volume grows because your cost is primarily the server rather than a per-message fee. That said, you are also responsible for your own IP reputation, DNS authentication, monitoring, security, backups, and abuse prevention.
What You Need Before Installing Postal
| Requirement | Recommended starting point |
|---|---|
| VPS | 4 GB RAM, 2+ CPU cores, 25+ GB disk |
| Operating system | Ubuntu 24.04 LTS |
| Root or sudo access | Required |
| Domain name | A domain you control with DNS access |
| Public IPv4 | Preferably dedicated |
| Outbound port 25 | Must be permitted by the VPS provider |
| Reverse DNS | Provider must allow a PTR record |
Choose a VPS That Allows SMTP
Port 25 policy is one of the first things you should verify. Some cloud platforms restrict outbound SMTP by default or require an approval process. Do not finish an entire mail-server installation before discovering that your host does not permit the traffic you need.
Need a VPS for self-hosting?
Hostinger is one option worth checking for an Ubuntu VPS. Always confirm its current SMTP and port-25 policy for your location and account before purchasing specifically for Postal.
Check Hostinger VPS Visit Postal1 Provision Your Ubuntu VPS
Create a fresh VPS using Ubuntu 24.04 LTS. Record the public IPv4 address and your root credentials. For this tutorial, the examples use:
Connect to the server:
Update the operating system:
2 Test Outbound Port 25 Before Doing Anything Else
Install a simple network testing utility:
Then try reaching a public SMTP server:
If the connection succeeds and you receive an SMTP banner, outbound port 25 is reachable. If it times out or is blocked, contact your VPS provider before continuing.
3 Set the Server Hostname
Choose a dedicated subdomain for Postal. A common pattern is postal.yourdomain.com or mail.yourdomain.com.
The second command should return the hostname you configured.
4 Lock Down the Firewall
Use UFW to deny unsolicited inbound connections while allowing the ports required for SSH, SMTP, HTTP validation, HTTPS, and SMTP submission.
5 Configure Reverse DNS / PTR
Reverse DNS is especially important for email. Your VPS IP should resolve back to the Postal hostname you chose. In your hosting provider’s networking or IP-management panel, set the PTR value for the IPv4 address to:
After DNS has propagated, verify it:
The result should be your Postal hostname. If the PTR value does not match, fix it before judging your email deliverability.
6 Point Your Postal Hostname to the VPS
At your DNS provider, create an A record:
| Type | Name | Value | TTL |
|---|---|---|---|
| A | postal | YOUR_SERVER_IP | Auto |
Then verify:
7 Install Docker and the Postal Helper
Install Docker:
Clone the Postal installation helper and make the postal command globally available:
If Postal’s upstream installation procedure changes, use the current commands in the official Postal documentation rather than forcing an outdated command to work.
8 Start MariaDB with Persistent Storage
Create a strong database password:
Store that password securely, then start MariaDB. Replace YOUR_STRONG_PASSWORD below.
Check the container:
Binding MariaDB to 127.0.0.1 keeps the database from listening publicly on the VPS network interface.
9 Bootstrap Postal Configuration
Create Postal’s base configuration:
Now open the main configuration file:
Update the database credentials in the relevant database sections so they match the MariaDB container.
postal.yml with the password used when MariaDB was created.
10 Initialize the Database and Create an Admin
Create Postal’s database structure:
Then create your first Postal administrator:
Postal will prompt you for the administrator details and password. Use a unique password and store it in a password manager.
11 Start Postal
The Postal web, SMTP, and worker components should be running. If one repeatedly exits, inspect its Docker logs instead of repeatedly restarting the entire server.
12 Put the Postal Dashboard Behind HTTPS
Postal’s bootstrap process can generate a Caddy configuration. Caddy is useful here because it can automatically request and renew TLS certificates.
After DNS and certificate issuance are complete, open:
Log in with the admin account created earlier.
13 Create an Organization and Mail Server
Postal separates configuration into organizations and mail servers. After you log in:
- Create your organization.
- Create a mail server inside it.
- Use a short internal identifier that is easy to recognize.
- Use development/testing mode first if you are still validating the setup.
- Switch to live sending only when DNS and deliverability checks are ready.
14 Add Your Sending Domain, SPF, and DKIM
Your Postal dashboard hostname and your sending domain can be different. For example, the dashboard could be postal.example.com while messages are sent from support@example.com.
Add the sending domain inside Postal. The interface will give you the DNS records required for that domain. Copy the values exactly into your DNS provider.
A starter DMARC policy can be set to monitoring mode while you validate alignment:
Do not blindly copy SPF or DKIM values from another server. Postal generates values for your own configuration, and those are the records you should publish.
15 Generate SMTP Credentials and Send a Test
Inside your Postal mail server, create a new SMTP credential. Save the generated username and password securely.
Your application will generally need:
| Setting | Example |
|---|---|
| SMTP host | postal.example.com |
| Port | 25 or a configured submission port such as 587 |
| Username | Your Postal-generated credential |
| Password | Your Postal-generated password |
| Encryption | TLS when supported/configured |
One useful command-line tester is swaks. On Ubuntu, install it with:
Example test:
After sending, inspect both the receiving inbox and the Postal message logs. Do not consider the setup complete merely because the command returns without an error.
16 Create Automatic Database Backups
Create a backup directory:
Create the backup script:
Test it:
Then schedule it for 3:00 AM each day:
Postal SMTP Deliverability Checklist
Getting Postal to send a message is easier than building a good sender reputation. Before increasing volume, check each of these items.
- PTR / reverse DNS matches the server hostname.
- Forward DNS points the hostname back to the same server IP.
- SPF validates for the sending domain.
- DKIM validates and aligns with the From domain.
- DMARC is published and monitored.
- The server IP is not listed on major blocklists.
- The sending IP is warmed gradually rather than immediately sending at high volume.
- Bounced and complaining addresses are suppressed.
- Messages contain legitimate, expected content and accurate sender identity.
Common Postal SMTP Problems and Fixes
Emails arrive in spam
Start with DNS authentication and IP reputation. Confirm PTR, SPF, DKIM, and DMARC. Then inspect the IP on a reputable blocklist checker. For a brand-new IP, keep initial sending volume low and increase it over time.
SMTP says “connection refused”
Verify Postal is running and confirm the firewall allows the relevant port:
Postal containers keep restarting
Inspect the logs. Database configuration errors are a common cause:
For Postal-managed containers, use postal status and the applicable Postal/Docker logs for the component that is failing.
Caddy cannot issue an SSL certificate
Confirm that the Postal hostname resolves to the server, ports 80 and 443 are reachable, and no conflicting web server is already listening on those ports.
I enabled UFW and lost SSH access
Use your hosting provider’s emergency console or web console to regain access, then allow port 22:
Connecting Postal to WordPress
Once Postal generates your SMTP credential, you can use it with a reputable WordPress SMTP plugin. Enter the Postal hostname, the correct configured port, SMTP username, SMTP password, and encryption method. Send a test email from the plugin before relying on it for WooCommerce receipts, account emails, password resets, or form notifications.
notifications@yourdomain.com or support@yourdomain.com, and make sure that domain is authenticated inside Postal.
What to Do After Your First Successful Email
- Run a deliverability test and inspect every warning.
- Add DMARC reporting and watch the reports.
- Implement rate limits appropriate for your server and reputation.
- Configure Postal webhooks for bounces and delivery events if your application can process them.
- Move backups off-server.
- Monitor server disk, memory, database growth, and message queues.
- Keep Ubuntu, Docker, Postal, and database components patched.
Frequently Asked Questions
Is Postal SMTP free?
Postal is open-source software. You still pay for the infrastructure you run it on, such as the VPS, domain name, backups, and any monitoring or storage services you choose.
Can Postal replace SendGrid, Mailgun, or Postmark?
For many transactional-email workloads, it can provide comparable core infrastructure such as SMTP delivery, API sending, domain authentication, logs, and delivery events. The trade-off is that you become responsible for maintaining the system and sender reputation.
Can I use Postal to receive normal inbox email?
Postal can participate in inbound routing workflows, but it is not a full Gmail-style mailbox platform. If you need human inboxes with IMAP/webmail, use a solution designed for mailbox hosting.
How much RAM should I give Postal?
For a small production installation, 4 GB is a practical starting point. Actual requirements depend on message volume, queue depth, logging, database growth, and what else runs on the server.
Why is reverse DNS so important?
Receiving providers compare the connecting IP address with the host identity of the mail server. A missing or inconsistent PTR record is a strong negative signal and can contribute to rejection or spam placement.
Should I send thousands of messages immediately from a new VPS?
No. New IPs have little or no reputation. Increase volume carefully, send only to people who expect the mail, and watch bounce and complaint signals as you scale.
Can I use Postal with WooCommerce?
Yes. WooCommerce sends through WordPress, so a WordPress SMTP plugin can relay those messages through your Postal credentials.
What ports should I expose?
Typical deployments need SSH, SMTP, HTTP for certificate validation, HTTPS for the dashboard, and a submission port such as 587 if you intend to use it. Do not expose database ports publicly.
Can I migrate from another SMTP provider?
Usually yes. Create and authenticate your sending domain in Postal, generate new credentials, warm the new IP carefully, and then change your application’s SMTP settings. Avoid moving all production volume to a fresh IP in one step.
Where should Postal backups be stored?
Keep a local short-retention backup for fast recovery, but also copy backups to another server or object-storage location so a single VPS failure cannot destroy both production data and backups.
Related Self-Hosting Guides
Ready to build your own email infrastructure?
Start with a VPS, confirm outbound SMTP is permitted, then follow the installation sequence above from top to bottom. DNS and IP reputation matter just as much as the software installation.
Explore Hostinger VPSAffiliate disclosure: Some links on this page may be affiliate links. If you purchase through an affiliate link, the site owner may receive a commission at no additional cost to you. Hosting-provider SMTP policies can change, so confirm current port and acceptable-use rules before buying a VPS specifically for email delivery.