For those who don’t know, Postal Mail Server is a complete and full-featured mail server for websites and servers that provides similar services like Sendgrid, Mailgun, and Postmark, that you can run on your server in your environment. Postal provides an HTTP API that allows you to integrate it with your services and send emails from your sites and web apps, with strong spam and virus checking. For more about Postal Mail Server, please check its homepage. To get started with installing and configuring Postal Mail Server, follow the steps below:
Install MariaDB Database Server
Postal Mail Server needs a database server to store its content. To get a truly open-source database server, go and install the MariaDB server. To do that, run the commands below. After installing MariaDB, the commands below can be used to stop, start and enable the MariaDB service always to start up when the server boots. When you’re done, run the commands below to secure the MariaDB server by creating a root password and disallowing remote root access. When prompted, answer the questions below by following the guide.
Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter password Re-enter new password: Repeat password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
Restart MariaDB server To test if MariaDB is installed, run the commands below: That should display MariaDB’s service status.
Create Postal Mail Server Database
Now that you’ve installed the MariaDB server, run the commands below to create a blank database for Postal Mail Server. To do that, run the commands below to log on to MariaDB. When prompted for a password, type the root password you created above. Then create a database called postal Next, create a database user called postaluser with a new password After that, grant the user full access to the postaluser database. Finally, save your changes and exit.
Install Ruby and RabbitMQ
After the above, go and install Ruby, Erlang, and RabbitMQ packages on Ubuntu. These are required packages and are not available via Ubuntu default repositories. To install the latest version of Ruby, you might need to do it from a third-party PPA. Below is how to add the PPA and install Ruby. After that, run the commands below to update Ubuntu packages and install Ruby version 2.3. Now that you have installed Ruby, continue below to get RabbitMQ installed. A requirement to run RabbitMQ is to have Erlang. First, install Erlang. You can do that by adding its repository key to Ubuntu. Then run the commands below to add the repository After that, run the commands below to install Erlang. When you’re done installing Erlang, continue below to install RabbitMQ. To install RabbitMQ, first, add its repository to Ubuntu. You can do that by running the commands below. Next, run the commands below to add the repository’s key to the list above. After adding the RabbitMQ repository and key, run the commands below to install the RabbitMQ package After installing, the commands below can be used to stop, start and enable RabbitMQ always to start up when the server boots. RabbitMQ also provides and web management console for easy management. To enable it, run the commands below After that, open your browser and browse to the server name or IP address followed by port # 15672 Example: http://example.com:15672 You should see the RabbitMQ web management console to log on. the default username and password are guest. Username & Password: guest Log in and begin configuring your server Next, create Postal Mail Server RabbitMQ VirtualBox, user, and password. To do that, run the commands below.
Install Nodejs
To properly run Postal Mail Server, you’ll want to install Nodejs. That can easily be installed using the commands below:
Install Postal Mail Server
Now that your server has everything needed to run Postal Mail Server, continue below to get it installed and configured. First, create a service account for Postal Mail Server Next, allow Ruby to listen to web calls by running the commands below: Next, installed the required packages. Next, create a Postal Mail Server directory, download the latest version and extract it into the directory, then give Postal user access. Next, install dependencies and initialize Postal configurations. After that, open the Postal default configurations file Then make the highlighted changes and save. After making the changes above, save the file. then run the commands below to initialize Postal services and create an account for its web portal. You will be given an account detail similar to the one below: Finally, stop, start and check the Postal service status. The Postal is installed and ready. However, to browse via its portal you will need a web server. For this tutorial, we’re going to install Nginx.
Install Nginx
To manage Postal Mail Server via its web portal, you must install a web server. Run the commands below to install Nginx. Then copy the Postal Nginx config to use as its VirtualHost. Then create a self-signed SSL certificate to use with the portal. Answer the prompts as shown below: Next, open the Nginx configuration file and edit the server name to be postal.example.com Edit the server name and save: Restart Nginx After that, browse to the server name and log in. https://postal.example.com Log in and set up your environment. That should do it! Conclusion: This post showed you how to install Postal Mail Server on Ubuntu 18.04 | 16.04. If you find any error above, please use the form below to report it. You may also like the post below: