You are currently viewing How to Self Host Postal SMTP Server: Easy Guide (2026)
Self Host Postal SMTP Server

How to Self Host Postal SMTP Server: Easy Guide (2026)

How to Self-Host Postal SMTP Server: Easy Mode (2026)
Self Hosting • Email Infrastructure

How to Self-Host Postal SMTP Server: Easy Mode (2026)

By Vanel Sylvestre Updated for 2026 Approx. 30–45 minute setup

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.
Important: Postal is primarily a mail delivery platform. It is not a Gmail-style mailbox with IMAP folders and an inbox interface. It is best used for transactional and application-generated email.

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.

SMTP RelayConnect WordPress, applications, stores, CRMs, or automation tools using standard SMTP credentials.
HTTP APIDevelopers can integrate directly with Postal instead of relying only on SMTP.
Domain AuthenticationConfigure SPF and DKIM so receiving providers can verify your messages.
Delivery VisibilityReview sent messages, delivery attempts, bounces, and server activity from one dashboard.

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.

Self-hosting is not a shortcut around anti-spam rules. Use Postal for legitimate, permission-based email. A new VPS IP should be warmed gradually, and you should immediately stop sending to invalid or complaining recipients.

What You Need Before Installing Postal

RequirementRecommended starting point
VPS4 GB RAM, 2+ CPU cores, 25+ GB disk
Operating systemUbuntu 24.04 LTS
Root or sudo accessRequired
Domain nameA domain you control with DNS access
Public IPv4Preferably dedicated
Outbound port 25Must be permitted by the VPS provider
Reverse DNSProvider 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 Postal

1 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:

Postal hostname: postal.example.com Server IP: 192.0.2.100

Connect to the server:

ssh root@YOUR_SERVER_IP

Update the operating system:

apt update && apt upgrade -y

2 Test Outbound Port 25 Before Doing Anything Else

Install a simple network testing utility:

apt install -y telnet

Then try reaching a public SMTP server:

telnet smtp.gmail.com 25

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.

Do not ignore a blocked port 25. You may still be able to open the Postal dashboard, but normal direct-to-MX delivery will fail until the provider allows outbound SMTP traffic.

3 Set the Server Hostname

Choose a dedicated subdomain for Postal. A common pattern is postal.yourdomain.com or mail.yourdomain.com.

hostnamectl set-hostname postal.example.com hostname

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.

ufw default deny incoming ufw default allow outgoing ufw allow 22/tcp ufw allow 25/tcp ufw allow 80/tcp ufw allow 443/tcp ufw allow 587/tcp ufw –force enable ufw status verbose
Security check: Never enable UFW over SSH until port 22 has been allowed, or you can lock yourself out of the server.

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:

postal.example.com

After DNS has propagated, verify it:

dig -x YOUR_SERVER_IP +short

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:

TypeNameValueTTL
ApostalYOUR_SERVER_IPAuto

Then verify:

dig postal.example.com +short
Cloudflare users: Email-related DNS records generally should not be accidentally hidden behind an HTTP proxy. If certificate issuance or direct service connectivity behaves strangely, confirm your proxy and SSL settings.

7 Install Docker and the Postal Helper

Install Docker:

curl -fsSL https://get.docker.com | sh docker –version docker compose version

Clone the Postal installation helper and make the postal command globally available:

git clone https://github.com/postalserver/install /opt/postal/install ln -s /opt/postal/install/bin/postal /usr/bin/postal postal

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:

openssl rand -base64 24

Store that password securely, then start MariaDB. Replace YOUR_STRONG_PASSWORD below.

docker run -d \ –name postal-mariadb \ -p 127.0.0.1:3306:3306 \ –restart always \ -v postal-mariadb-data:/var/lib/mysql \ -e MARIADB_DATABASE=postal \ -e MARIADB_ROOT_PASSWORD=YOUR_STRONG_PASSWORD \ mariadb:11.4

Check the container:

docker ps docker logs postal-mariadb –tail 25

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:

postal bootstrap postal.example.com

Now open the main configuration file:

nano /opt/postal/config/postal.yml

Update the database credentials in the relevant database sections so they match the MariaDB container.

main_db: host: 127.0.0.1 username: root password: YOUR_STRONG_PASSWORD database: postal message_db: host: 127.0.0.1 username: root password: YOUR_STRONG_PASSWORD prefix: postal
Password mismatch = startup failure. If Postal later reports database connection errors, compare the password in postal.yml with the password used when MariaDB was created.

10 Initialize the Database and Create an Admin

Create Postal’s database structure:

postal initialize

Then create your first Postal administrator:

postal make-user

Postal will prompt you for the administrator details and password. Use a unique password and store it in a password manager.

11 Start Postal

postal start postal status

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.

docker run -d \ –name postal-caddy \ –restart always \ –network host \ -v /opt/postal/config/Caddyfile:/etc/caddy/Caddyfile \ -v /opt/postal/caddy-data:/data \ caddy

After DNS and certificate issuance are complete, open:

https://postal.example.com

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:

  1. Create your organization.
  2. Create a mail server inside it.
  3. Use a short internal identifier that is easy to recognize.
  4. Use development/testing mode first if you are still validating the setup.
  5. 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.

SPFDeclares which systems are authorized to send mail for your domain.
DKIMCryptographically signs messages so providers can verify the message was authorized by your domain.
PTR / rDNSMaps your sending IP back to the hostname of your mail server.
DMARCAdds policy and reporting on top of SPF/DKIM alignment.

A starter DMARC policy can be set to monitoring mode while you validate alignment:

v=DMARC1; p=none; rua=mailto:dmarc@example.com

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:

SettingExample
SMTP hostpostal.example.com
Port25 or a configured submission port such as 587
UsernameYour Postal-generated credential
PasswordYour Postal-generated password
EncryptionTLS when supported/configured

One useful command-line tester is swaks. On Ubuntu, install it with:

apt install -y swaks

Example test:

swaks –to you@example.net \ –from support@example.com \ –server postal.example.com \ –port 25 \ –auth LOGIN \ –auth-user YOUR_POSTAL_USERNAME \ –auth-password YOUR_POSTAL_PASSWORD \ –tls

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:

mkdir -p /opt/postal/backups

Create the backup script:

cat > /opt/postal/backup.sh << ‘EOF’ #!/bin/bash TIMESTAMP=$(date +%Y%m%d_%H%M%S) docker exec postal-mariadb \ mariadb-dump -uroot -pYOUR_STRONG_PASSWORD –all-databases 2>/dev/null \ | gzip > /opt/postal/backups/postal_$TIMESTAMP.sql.gz find /opt/postal/backups \ -name “postal_*.sql.gz” \ -mtime +7 \ -delete EOF chmod 700 /opt/postal/backup.sh

Test it:

/opt/postal/backup.sh ls -lh /opt/postal/backups/

Then schedule it for 3:00 AM each day:

(crontab -l 2>/dev/null; echo “0 3 * * * /opt/postal/backup.sh”) | crontab – crontab -l
A same-server backup is not enough. If the VPS is deleted, compromised, or suffers storage failure, the backup may disappear with it. Copy backups to a separate system or object-storage provider.

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.

Useful deliverability tools

MXToolbox Mail-Tester

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 status ufw status

Postal containers keep restarting

Inspect the logs. Database configuration errors are a common cause:

docker ps -a docker logs postal-mariadb –tail 100

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:

ufw allow 22/tcp

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.

Tip: Use a dedicated transactional From address such as notifications@yourdomain.com or support@yourdomain.com, and make sure that domain is authenticated inside Postal.

What to Do After Your First Successful Email

  1. Run a deliverability test and inspect every warning.
  2. Add DMARC reporting and watch the reports.
  3. Implement rate limits appropriate for your server and reputation.
  4. Configure Postal webhooks for bounces and delivery events if your application can process them.
  5. Move backups off-server.
  6. Monitor server disk, memory, database growth, and message queues.
  7. 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 VPS

Affiliate 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.

Vanel Sylvestre

I am Vanel Sylvestre , welcome to my world, i am a real estate investor, business owner and also i am an affiliate marketer with over 10 years of experience in online marketing i have been making thousands Online Using Online Marketing Tools. In This blog We share some online marketing tools that can help you grow your business, if this is something you are interested in, one more time welcome to my world.

Leave a Reply