Install Roundcube webmail client

Go to End

8 May 2019: All "/var/www/web" changed to "/var/www/html/web". "<version number>" used instead of a specific number. More descriptions on settings added.

25 Dec 2014: First created.

Install new by downloading

The usual software installation command "$ sudo apt install roundcube" does not appear to work.

Download roundcubemail-<version number>-complete.tar.gz by selecting "Complete: <version number>" at, usually to own "Downloads" directory.

Use the file manager to extract the subdirectory "roundcubemail-<version number> in the compressed tar.gz file under the "Downloads" directory as "roundcubemail-<version number>".

Install Roundcube under "/var/www/html":

$ sudo mv /home/<own account name>/Downloads/roundcubemail-<version number>/* /var/www/html/roundcube
​$ cd /var/www/html/roundcube
$ sudo chown www-data:www-data logs
$ sudo chown www-data:www-data temp

Install MySQL database + PHP + phpMyAdmin, if not already installed.

Login phpmyadmin at web browser:


Create a database user "roundcube" with database "roundcube":

  • click "Users" at the top menu bar
  • click "Add user" at the page middle
  • enter "roundcube" at the User name entry
  • select "Local" at the Host entry
  • enter and re-type the password
  • click "Create database with same name and grant all privileges"
  • click "Go" at the bottom

Enter at web browser:


Configure Roundcube:

  • accept all of the defaults
  • enter database user "roundcube", database "roundcube" and password under Database setup
  • click: "CREATE CONFIG"
  • download the configuration file generated and save it as
  • move the downloaded file:
$ mv /home/<own account name>/Downloads/ /var/www/html/roundcube/config
  • click: "CONTINUE" on the webpage
  • click: "Initialize database"
  • enter sender and recipient email addresses to test SMTP config
  • enter username and password to test IMAP config

Remove installer directory:

$ sudo rm -R /var/www/html/roundcube/installer

Configure PHP5 only (not necessary for PHP7):

$ sudo gedit /etc/php5/apache2/php.ini
  • define:

date.timezone = Asia/Hong_Kong

otherwise the date column of the web mail would be blank. 

Restart Apache2 service:

$ sudo systemctl reload apache2
$ sudo service apache2 reload

Log in at web browser:



Click Settings > Identity to define some settings:

Click Settings > Preferences > User Interface > Date format > 24/7/2019 > Save.

Click Settings > Preferences > Composing Messages

> Compose HTML messages > always.

> when replying > start new message above the quote.

> deselect Force standard separator in signatures.

> Save.

Click Settings > Contacts > Import to import contacts files, e.g. previously exported from Google.

(more descriptions on settings added, 8 May 2019)


Download and extract the subdirectory of the new version to "Downloads" directory as "roundcubemail-<new version number>".

Upgrade existing directory using the script:

$ cd /home/<own account name>/Downloads/roundcubemail-<new version number>/bin
$ ./ /var/www/html/roundcube

In case of big trouble

Uninstall Roundcube:

$ sudo apt-get remove roundcube

Remove "/var/www/html/roundcube":

$ cd /var/www/html
$ sudo rm -r roundcube

Delete mySQL user "roundcube" and database "roundcube" using phpMyAdmin.

Intall Roundcube as new.

End of Page