How to Install Roundcube Email Client on an Ubuntu 18.04 VPS or Dedicated Server

Roundcube is a web-based email client that supports SMTP (Simple Mail Transfer Protocol) and IMAP (Internet Message Access Protocol). You can use this feature-rich software to send and read emails from a web browser.

Roundcube works pretty well on Ubuntu 18.04 provided you have installed an SMTP server such as Postfix and an IMAP server like Dovecot. Roundcube is popular for its extensive use of Ajax technologies that creates a good user interface for sending emails, (e.g., through drag and drop).

The software supports more than 70 languages and allows SSL/TLS communication. With its sophisticated privacy protection and support for HTML messages, Roundcube also supports an address book. It also has built-in caching for faster email retrieval.

You take advantage of Roundcube’s threaded email support to track your email responses without complex navigations. Our step-by-step guide will show you how to install Roundcube on your Ubuntu 18.04 server.


  • A VPS instance running Ubuntu 18.04 server (you can find a some of the best VPS plans here)
  • A domain name pointing to your server
  • SMTP and IMAP server(e.g. Postfix and Dovecot)
  • Apache, PHP, and MySQL
  • A non-root user with sudo privileges

Step 1: Download the Latest Version of Roundcube

First, update the package list by running:

$ sudo apt-get update

Then, we need to install Roundcube from a download source using the Linux ‘wget’ command. You can always get the link of the stable complete version from Roundcube official download page (

Before you download the archive file, CD to the ‘/tmp’ directory:

$ cd /tmp
$ wget

Step 2: Uncompress the Archive File

We have downloaded the archive file ‘roundcubemail-1.3.6-complete.tar.gz’ but we need to decompress it before we begin the installation. To do this, use the command below

$ tar -xvzf roundcubemail-1.3.6-complete.tar.gz

The above command will unzip all the files in a directory named ‘roundcubemail-1.3.6’ still in our ‘/tmp’ folder.

Step 3: Move the Content to the Root of your Website

In order for us to access Roundcube from a web browser, we need to move the content of the ‘roundcubemail-1.3.6’ directory to the root of our website using the command below:

$ sudo mv roundcubemail-1.3.6 /var/www/html/roundcube

Please not, you can specify any directory name depending on what’s easier for you to remember. In this guide, we have chosen ‘roundcube‘. So, to access our emails, we will just enter ‘’.

Step 4: Set the Correct Directory and File Permissions

For Roundcube to be able to access the right files through Apache web server, we need to set the right file permissions:

$ sudo chown -R www-data:www-data /var/www/html/roundcube/
$ sudo chmod 775 /var/www/html/roundcube/temp/ /var/www/html/roundcube/logs/

Step 5: Enable Additional Modules

In order for Roundcube to work without any problems, enable the following modules

Apache Mod Rewrite

$ sudo a2enmod rewrite

PHP modules

Download modules using the command below:

$ sudo apt-get install php-xml php-mbstring php-intl php-zip php-pear php-mysql

Then, restart Apache using the command below:

$ sudo apache2ctl restart

Step 6: Create a Database for Roundcube

Roundcube relies on MySQL to store some information. So we need to create a database for the same.

To do this, use the commands below:

$ sudo mysql -u root -p

Enter your MySQL server root password when prompted and then enter the below SQL commands:

mysql> CREATE DATABASE roundcube DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON roundcube.* TO 'username'@'localhost' IDENTIFIED BY 'PASSWORD';

Replace the username with your desired value and add a good value for the ‘PASSWORD’

Once you have created the database and user, we can initialize Roundcube database using the command below:

$ sudo mysql -u username -p roundcube < /var/www/roundcube/SQL/mysql.initial.sql

Enter the password when prompted.

Step 7: Finish the Installation

To finalize the installation, we must visit the URL below:


You should see a page similar to the one below:

Click ‘Next’ at the bottom of page to continue.

On the next page, navigate to Database Setup settings and enter the database name, user and password that you created above.

Under SMTP settings, check the box ‘Use the current IMAP username and password for SMTP authentication’

Enabling plugins is an optional step.

Then, click  ‘CREATE CONFIG’ at the bottom of the screen.

You will see a screen similar to the one below:

Just click on ‘CONTINUE’ to proceed

Step 8: Final Testing

On the next screen, you can test if the SMTP and IMAP server are responding as expected. Just enter your username and password and test each service as required.

Once everything is setup and working, consider removing the default Roundcube installation files by running the command below:

$ sudo rm -rf /var/www/roundcube/installer/

Finally, visit the URL below to login to Roundcube:



Those are the basic steps for installing Roundcube on your Ubuntu 18.04 server. Remember for the installation to work, you need to have a fully functional email server that supports SMTP and IMAP authentication.

Once you are logged in to Roundcube, you can send or receive email right from the dashboard. Roundcube supplements other email clients like Outlook and Thunderbird and it has a great advantage because it can be accessed from a browser.


Check out these top 3 VPS services:

Was this article helpful?