How To Configure RoundCube WebMail On Ubuntu
Introduction
In this tutorial, you will learn how to download, install, and Configure RoundCube WebMail using Nginx Webserver. RoundCube will be configured to use secure TLS and SSL connections.
Prerequisites
- Root access, or a non-root user with sudo privileges for downloading RoundCube.
- An SSL enabled domain name. If you don’t have one yet, read the LetsEncrypt tutorial.
- An Email Server up and running. In case you haven’t set one yet, take the Postfix-Dovecot tutorial.
Step 1 – Download RoundCube WebMail Client
Your RoundCube installation now resides in /usr/share/mail. The next step is to create the MySQL database required.
Step 2 – Create The MySQL Database
We will create the Roundcube database, create a user, and then assign full privileges on that database for the specific user.
There is no need to create tables on the database, because RoundCube will create them automatically during its Web Interface setup.
Step 3 – Configure RoundCube Nginx Location
For simplicity and maintainability reasons, we will use the folder “snippers” located in /etc/nginx/snippets, and will will create our configuration file in it. This can be done like so:
And paste the location code below:
And then open your main site configuration file, and add:
Just before the last closing bracket.
In Nginx, when a folder is included in configuration with the *.conf suffix, it means that all .conf files within that folder will be enabled.
Step 4 – RoundCube Configuration
Vist the location where roundcube is installed. In our example is example.com/mail
.
Normally you will see the RoundCube login screen, but we need to make some extra configuration for the database connection. For that you will have to visit example.com/mail/installer
. The screen you will see, will look very symilar with the one below.
Next click on “Create Config”. In this page we are only interested in the Database setup information. Fill in the appropriate values that you have choosen during the MySQL user creation (Database name, user, and password, and click update config.
Now a new configuration file will be created (config.inc.php) which needs to be edited. Open it with vi like so :
You will notice that the $config[‘db_dsnw’] varible is a little weird, and this is actually the only variable that you need to keep for your current config.inc.php. Feel free to delete all the rest, and replace them with the code below:
Save the file, and exit.
You will normally now be able to send a receive emails using RoundCube WebMail!