userguide:postal

Postal with docker on Nethserver


Part 1: Configure External Dns


1. Config A record on external dns ie

nethserver.domain.tld

⇒ public ip of

nethserver.domain.tld

2. Config second A record on external dns ie

postal.domain.tld

⇒ public ip of

nethserver.domain.tld

3. Config MX record on external dns ie

yourdomain.tld

⇒ public ip of

nethserver.domain.tld

nethserver.domain.tld

10


Part 2: Configure Nethserver through Cockpit


1. On the Dashboard set Hostname to FQDN ie

nethserver.domain.tld

and add an ALIAS with

portal.domain.tld

2. Set dns resolvers

3. In DNS settings (in system on dashboard) set

nethserver.domain.tld

⇒ Public IP of

nethserver.domain.tld

4. In Certificates (in system on dashboard) set Lets Encrypt with both

nethserver.domain.tld

and

portal.domain.tld

, generate and make sure its set to default

5. In Software Center install Reverse Proxy (apache proxypass) and Docker Community


Step 3: Install Prerequisites and create the database in Terminal


1. In terminal install Prerequisites

yum -y install git curl jq

2. Clone the Postal installation helper repository

git clone https://postalserver.io/start/install /opt/postal/install
sudo ln -s /opt/postal/install/bin/postal /usr/bin/postal

3. Install Docker Compose from terminal

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

4. Apply executable permissions to the binary

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

5. Create a symbolic link to /usr/bin

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

6. Create the Postal DB

mysql -e "create database postal; grant all on postal.* to postal@localhost identified by 'strongpassw00rd'"

Step 4: Install RabbitMQ in Terminal


1. Install a RabbitMQ instance and have it listen on port

5672
docker run -d \ --name postal-rabbitmq \ -p 127.0.0.1:5672:5672 \ --restart always \ -e RABBITMQ_DEFAULT_USER=postal \ -e RABBITMQ_DEFAULT_PASS=differentstrongpassw00d \ -e RABBITMQ_DEFAULT_VHOST=postal \ rabbitmq:3.8

* *Be sure to choose a secure password. You'll need to put this in your Postal configuration when you install it so be sure to make a (secure) note of it.*


Step 5: Configuration


1. Run the command and replace

postal.yourdomain.tld

with the actual hostname you want to access your Postal web interface at.

*This will generate three files in

/opt/postal/config``*
* *<code>postal.yml`` is the main postal configuration file*
* *<code>signing.key`` is the private key used to sign various things in Postal*
* *<code>Caddyfile`` ignore this as we don't use it*

*Once generated, you should open up /opt/postal/config/postal.yml and add all the appropriate values for your installation (database passwords etc...).*

><div style="font-family: 'Apple Color Emoji', EmptyFont2">ℹ </div>Note that the docker setup mounts <code>/opt/postal/config

as

/config

so any full directory paths mentioned in

postal.yml

will likely need to start with

/config

and not

/opt/postal/config

Step 6: Initialising the database


1. Initialise your database by adding all the appropriate tables. Run the following commands to create the schema

postal initialise

2. Then create your first admin user.

postal make-user

Step 7: Running postal


1. You're now ready to actually run Postal itself. You can go ahead and do this by running

postal start

Step 8: Reverse Proxy


1. Setup the reverse proxy in Cockpit as follows

postal.yourdomain.tld

http://127.0.0.1:5000

and select the first three options with ssl and save

  • userguide/postal.txt
  • Last modified: 2022/01/13 05:26
  • by Shane Treweek