Configure Roundcube with Postfix and Dovecot

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Follow these steps:

  • Install Postfix. Postfix is a free, open source Mail Transfer Agent which works to route and deliver email. Before installing Postfix, you will need to have a Fully Qualified Domain Name pointing to the server that you will be using. On Ubuntu and similar systems, Postfix can be installed using the command apt-get install postfix. On CentOS systems, Postfix can be installed using the command yum install postfix.

  • Once Postfix is installed, configure the following options in the /etc/postfix/ file.

      myhostname =
      home_mailbox = Maildir/
  • Install Dovecot. Dovecot is a open source Mail Delivery Agent that works with IMAP and POP3. On Ubuntu and similar systems, Postfix can be installed using the command apt-get install dovecot-imapd. On CentOS systems, Dovecot can be installed using the command yum -y install dovecot.

  • Once Dovecot is installed, configure the following option in the /etc/dovecot/conf.d/10-mail.conf file:

      mail_location = maildir:~/Maildir
  • Modify the RoundCube configuration file by appending the following lines to the end of the file. These lines define the configuration needed for Roundcube to work with Postfix and Dovecot:

    NOTE: Depending on your installation type, the RoundCube configuration file can be found in one of the following locations:

    • Approach A (Bitnami installations using system packages): /opt/bitnami/roundcube/config/*.

    • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/roundcube/htdocs/config/*.

      // IMAP
      $rcmail_config['default_host'] = 'HOSTNAME';
      $rcmail_config['default_port'] = 143;
      // SMTP
      $rcmail_config['smtp_server'] = 'HOSTNAME';
      $rcmail_config['smtp_port'] = 25;

    Note that you have to replace HOSTNAME with the correct Fully Qualified Domain Name for your server. In case your server is using different ports from the default ones shown above, replace the port numbers as well to reflect your server’s configuration.

Other configurations are also possible and supported. Refer to the Ubuntu community guides listed below for more information:

Last modification June 16, 2021