CategoriesEmail Marketing

Postal Setup 2021 Guide. (RabbitMQ and ERLANG issues fixed)

Run all the below commands successfully to get a running Postal server. Ensure you are replacing with the actual domain name you intend to use.

This document only applies to ubuntu 18.04 (try at your own risk for other versions)

The 2021 method for postal installation needs to use Docker on The VPS.


1.Set up the repository

sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \

2. Add Docker’s official GPG key:

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

3. Use the following command to set up the stable repository

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

4. Install Docker Engine.

 sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli

5.  install Docker

 apt-cache madison docker-ce

6. Verify Docker is running on the server.

sudo docker run hello-world

7. Install Docker Compose (This command will fetch the latest stable version)

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

8. Apply executable permissions

sudo chmod +x /usr/local/bin/docker-compose

9. Check if installed successfully or not.

docker-compose --version

10. Proceed to Clone Git.

git clone /opt/postal/install
sudo ln -s /opt/postal/install/bin/postal /usr/bin/postal 

11. Install Maria DB

docker run -d \
   --name postal-mariadb \
   -p \
   --restart always \
   -e MARIADB_DATABASE=postal \

12. Install Rabbit MQ.

docker run -d \
   --name postal-rabbitmq \
   -p \
   --restart always \

13. Once all of the above three steps done. Issue command

sudo apt-get install jq
postal bootstrap  -- Change to your actual domain. 

14. Once issued, Proceed to edit the postal.yml file.

nano /opt/postal/config/postal.yml

15. Replace with your 

16. Initialize Database

postal initialize
postal make-user

Create user with email and password detail.

17. Start Postal

postal start

18. Install Caddy.

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

19. Login to postal UI using the postal username and password generated on Step16.

20. Build organization -Mailserver

21. Go to Domain and setup – your domain DKIM/SPF etc.

22. Configure Routes and tracking domains.

A Records

Hostname Type Value A AAAA 2a00:1234:abcd:1::3

SPF Record

You can configure a global SPF record for your mail server which means domains don’t need to each individually reference your server IPs. This allows you to make changes in the future.

Hostname Type Value TXT v=spf1 ip4: ip6:2a00:1234:abcd:1::3/128 ~all

Return Path

The return path domain is the default domain that is used as the MAIL FROM for all messages sent through a mail server. You should add DNS records as below.

Hostname Type Value A AAAA 2a00:1234:abcd:1::3 A TXT v=spf1 a mx ~all TXT Value from postal default-dkim-record

Route domain

If you wish to receive incoming e-mail by forwarding messages directly to routes in Postal, you’ll need to configure a domain for this just to point to your server using an MX record.

Hostname Type Value MX 10

Your postal.yml file should look like this below.


If you want to use IP pools.

  use_ip_pools: true

If you want to use spam assassin to check incoming emails you can install Spam Assassin.

sudo apt install spamassassin
sudo systemctl restart spamassassin

Go to postal.yml and then type in

  enabled: true
  port: 783

Do a postal restart for it to take effect

postal stop
postal start