How to install Poste.io on Debian 11/10/9

Poste.io is a mail server solution that provides a simple, fast, and secure way to send and receive emails. In this tutorial, we will learn how to install Poste.io on Debian 11/10/9.


Prerequisites

Before installing Poste.io, make sure your system meets the following requirements:

  • A user account with sudo privileges
  • Docker is installed on the server
  • A domain pointing to your servers IP address

Note

This will only work on a system without a webserver like nginx running on it. Else some ports may already be in use thus making the installation disfunctional.

Step 1: Update the System

First, update the system package list and upgrade the installed packages to their latest versions.

sudo apt update
sudo apt upgrade -y
Update and upgrade the system

Step 2: Create a dir for the data

Next we need to create a directory for the mail data. You can choose a location yourself. Here, I chose /root/mail:

sudo mkdir /root/mail
Create directory for mail data

Step 3: Start the poste.io container

Then, use this command to start the poste.io docker container after customizing the configuration for your server:

docker run \
    --net=host \
    -e TZ=Europe/Prague \
    -v /your-data-dir/data:/data \
    --name "mailserver" \
    -h "mail.example.com" \
    -t analogic/poste.io
Start command for poste.io docker container

--net=host makes it so every port of the docker container is mapped to the same port on the server.

-e TZ=Europe/Prague sets the variable for the timezone. Replace Europe with the region and Prague with the main city in your region.

-v /your-data-dir/data:/data sets the directory where your mail data is stored. Replace /your-data-dir/data with the directory you created in the last step.

--name "mailserver" sets the name of the docker container.

-h "mail.example.com" is the hostname of your container. Set this to the domain of your mail server. I recommend using mail.<your-domain>. You'll have to set this in your DNS records though.

-t analogic/poste.io is the name of the docker image of poste.io, don't change this.

Step 5: Configure the server & DNS

Open http://<server-ip> and follow the configuration steps.

PTR-Record or reverse DNS

A very important part of making your emails not go directly into the spam folder, is having the right PTR-Record. This is a record about what domain a server belongs to. To change it, get in contact with the ISP of your server or, if you are hosting in the cloud, find the right setting or ask support to change it.

Note: Some cloud hosting providers block email ports out of the box, ask support to open them

DNS records

Then, open your domain hosting DNS records. We'll need to create some records to make your email work.

First, create a A record for your mail server, if you haven't. This could be mail.<your-domain> A <server-ip>.

If you are using the subdomain mail for your mail server, set an MX record like this: <your-domain> MX mail.<your-domain.com>.

For the next entry, open the admin panel /admin and go to Virtual Domains and select your Domain, then copy the text part of the DKIM Key. It starts with "k=rsa; p=MIIBI...". In front of the text part, you'll see the subdomain where the txt entry should go. It's along the lines of s391849._domainkey.example.com.

And that's it. We've installed and setup a mail server with poste.io for your domain.


If I have helped you, consider signing up for free to get access to all my guides and my newsletter.

💪
Consider signing up for free to get access to all my guides and my newsletter