Installing Roundcube on Linux Mint

Roundcube is a webmail solution that can be installed on your Linux Mint system. In this tutorial, we will explain how to install Roundcube on Linux Mint.

Prerequisites

Before starting with the installation process, ensure that you have the following:

Step 1: Installing Roundcube

The first step to install Roundcube is to download the package from the official website of Roundcube at https://roundcube.net/download/. You can choose the latest version available.

Once downloaded, unzip the package using the following command:

sudo unzip roundcubemail-x.x.x.zip -d /var/www/html

Replace x.x.x with the version you have downloaded.

After extraction, rename the extracted directory to something simpler like roundcube.

sudo mv /var/www/html/roundcubemail-x.x.x /var/www/html/roundcube

Step 2: Creating a MySQL Database

Next, we need to create a MySQL database for Roundcube. Login to the MySQL shell using the following command:

sudo mysql -u root -p

Once logged in, execute the following SQL commands in order:

CREATE DATABASE roundcube_db;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON roundcube_db.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;
exit;

Replace the password with a password of your choice.

Step 3: Configuring Roundcube

Now we need to configure Roundcube to connect to the database we just created.

Copy the config.inc.sample.php configuration file to config.inc.php:

sudo cp /var/www/html/roundcube/config/config.inc.sample.php /var/www/html/roundcube/config/config.inc.php

Edit the config.inc.php file and update the database settings as follows:

$rcmail_config['default_host'] = 'localhost';
$rcmail_config['default_port'] = 143;
$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '';
$rcmail_config['smtp_pass'] = '';
$rcmail_config['support_url'] = '';
$rcmail_config['product_name'] = 'Roundcube Webmail';
$rcmail_config['des_key'] = '';
$rcmail_config['plugins'] = array();
$rcmail_config['db_dsnw'] = 'mysql://roundcube:password@localhost/roundcube_db';

Make sure to replace password with the database password you have set earlier.

Step 4: Configuring Apache

To configure Apache to serve Roundcube, create a new virtual host file with the following command:

sudo nano /etc/apache2/sites-available/roundcube.conf

Add the following content:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName webmail.example.com
        DocumentRoot /var/www/html/roundcube

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Make sure to replace webmail.example.com with your own domain name.

Save and close the file, then enable the newly created virtual host.

sudo a2ensite roundcube.conf

Finally, restart Apache to apply the changes.

sudo systemctl restart apache2

Step 5: Accessing Roundcube

With everything set up, you should now be able to access Roundcube webmail from your web browser by visiting http://webmail.example.com (replace webmail.example.com with your own domain name or IP address).

Conclusion

In this tutorial, we have successfully installed Roundcube on your Linux Mint distribution, and configured it to use MySQL and served through Apache web server. With this, you can access your mails through the Roundcube webmail interface.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!