How can we help?
< All Topics

Configuring a Mail Server with Postfix, Dovecot, and Roundcube on ServerStadium


In the era of digital communication, having a reliable and secure mail server is crucial for both personal and business correspondence. Configuring your own mail server provides control over your email data and customization that commercial email services may not offer. This guide will walk you through setting up a fully functional mail server using Postfix for handling outbound mail, Dovecot for incoming mail, and Roundcube as a user-friendly webmail interface on ServerStadium’s infrastructure. Whether you’re managing business communications or personal emails, this setup will give you the independence and flexibility you need.


  • A ServerStadium VM or dedicated server (VM Pricing, Dedicated Servers).
  • A registered domain name.
  • Basic knowledge of Linux server administration.

Step 1: Prepare Your ServerStadium Environment

  1. Server Selection and Setup: Update and upgrade your system:

    sudo apt update sudo apt upgrade

Step 2: Install and Configure Postfix

  1. Install Postfix:

    sudo apt install postfix

  2. Configure Postfix:

    Edit the main configuration file:

    sudo nano /etc/postfix/

    Configure settings:

    myhostname = myorigin = /etc/mailname mydestination = $myhostname,,, , localhost relayhost = mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all

  3. Restart Postfix:

    sudo systemctl restart postfix

Step 3: Install and Configure Dovecot

  1. Install Dovecot:

    sudo apt install dovecot-core dovecot-imapd

  2. Configure Dovecot:

    Edit the Dovecot configuration:

    sudo nano /etc/dovecot/dovecot.conf


    listen = *

    Configure mail location:

    sudo nano /etc/dovecot/conf.d/10-mail.conf


    mail_location = maildir:~/Maildir

  3. Restart Dovecot:

    sudo systemctl restart dovecot

Step 4: Install and Configure Roundcube

  1. Install Roundcube:

    sudo apt install roundcube roundcube-core roundcube-mysql roundcube-plugins

  2. Configure Apache for Roundcube:

    Enable the Roundcube site in Apache:

    sudo ln -s /etc/roundcube/apache.conf /etc/apache2/conf-enabled/roundcube.conf sudo systemctl restart apache2

  3. Access Roundcube: Navigate to http://your_server_ip/roundcube.

Step 5: Secure Your Mail Server

  1. SSL/TLS: Secure your mail server with SSL/TLS certificates (consider using Let’s Encrypt).
  2. Configure Postfix and Dovecot for SSL/TLS:

    Edit Postfix and Dovecot configurations to enable SSL/TLS.

Step 6: Testing and Finalization

  1. Test Email Sending and Receiving.
  2. Roundcube Configuration: Customize as needed.


Your mail server with Postfix, Dovecot, and Roundcube is ready on your ServerStadium server. For additional support, check out our knowledge base or contact our support team.

Table of Contents