How To

PostfixAdmin Setup on Ubuntu 26.04

Managing virtual mail users manually can quickly become difficult on a busy mail server. That’s why many administrators prefer a PostfixAdmin Setup for handling domains, aliases, and mailboxes through an easy web interface.

PostfixAdmin works alongside Postfix and Dovecot, making email hosting simpler and more organized. In this guide, you’ll learn how to install PostfixAdmin on Ubuntu 26.04 with Nginx, PHP, MySQL, and free SSL protection.

Why Use PostfixAdmin Setup?

A proper PostfixAdmin Setup allows administrators to manage email accounts without editing database entries manually. It provides a clean browser-based interface for creating domains, adding users, and controlling mailbox settings.

This setup is especially useful for:

  • Self-hosted email platforms
  • Business mail infrastructure
  • Multi-domain email hosting
  • Secure virtual mailbox management

Before starting, make sure your Ubuntu 26.04 server has a valid domain name and sudo access.

Install Required Packages

Start by updating your server and installing the required components:

sudo apt updatesudo apt install nginx mysql-server php-fpm php-mysql php-cli composer git acl

These packages provide the web server, database backend, and PHP environment needed for PostfixAdmin.

Next, create a dedicated mail user:

sudo groupadd -g 5000 vmailsudo useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /var/mail/vmail -m vmail

This user stores all virtual mailbox data securely.

Download and Configure PostfixAdmin Setup

Download the latest PostfixAdmin release from GitHub and extract it into the web directory:

cd /tmpwget https://github.com/postfixadmin/postfixadmin/archive/refs/tags/v4.0.1.tar.gz

After extraction, move the files into /var/www/postfixadmin.

Now create a MySQL database for PostfixAdmin:

CREATE DATABASE postfixadmin;CREATE USER 'postfixadmin'@'localhost' IDENTIFIED BY 'strongpassword';GRANT ALL PRIVILEGES ON postfixadmin.* TO 'postfixadmin'@'localhost';FLUSH PRIVILEGES;

Then configure the application by editing:

sudo nano /var/www/postfixadmin/config.local.php

Add your database credentials and setup password hash.

Configure Nginx for PostfixAdmin Setup

Create an Nginx server block for your mail domain:

server {    listen 80;    server_name mail.example.com;    root /var/www/postfixadmin/public;}

Enable the configuration and restart Nginx:

sudo nginx -tsudo systemctl reload nginx

For security, install a free Let’s Encrypt SSL certificate:

sudo certbot --nginx -d mail.example.com

This enables encrypted HTTPS access to your admin panel.

Complete the Installation

Open the setup page in your browser:

https://mail.example.com/setup.php

From there, initialize the database schema and create your first super admin account.

Once completed, you can start managing:

  • Email domains
  • Virtual mailboxes
  • Forwarders and aliases
  • Mail administrators

The dashboard makes server-side email management much easier for Linux administrators.

Conclusion

A complete PostfixAdmin Setup on Ubuntu 26.04 gives you a reliable foundation for self-hosted email services. Combined with Postfix, Dovecot, and SSL encryption, it creates a secure and scalable mail platform for personal or business use.

With the web interface in place, managing domains and mail users becomes significantly easier while keeping your Linux mail infrastructure organized and secure.

Cyber Defence

Recent Posts

Install Pip on Ubuntu 18.04: Python 3 and Python 2 Setup Guide

Pip is the official package manager for Python and the standard way to install libraries from…

4 days ago

Install R on Ubuntu 18.04 from CRAN: Statistical Computing Setup

R is an open-source programming language and environment built for statistical computing and data visualization. It…

4 days ago

Install Jenkins on Ubuntu 18.04: CI/CD Server Setup Guide

Jenkins is an open-source automation server that makes it easy to build CI/CD pipelines. Continuous integration…

4 days ago

Install Android Studio on Ubuntu 18.04 with Snap and OpenJDK 8

Android Studio is the official IDE for Android development, built on JetBrains' IntelliJ IDEA platform. It…

4 days ago

Install and Configure GitLab on Ubuntu 18.04 with Omnibus

GitLab is a web-based, open-source Git repository manager written in Ruby. It includes built-in tools for…

4 days ago

Install Anaconda on Ubuntu 18.04: Python Data Science Setup Guide

Anaconda is the most widely used Python distribution for data science and machine learning. It bundles…

5 days ago