Install Roundcube webmail client

Install new

Download roundcubemail-1.2.0-complete.tar.gz by selecting "Complete: 1.0.2" at http://roundcube.net/download/, usually to own "Downloads" directory.

Use the file manager to extract the contents of the compressed file under the "Downloads" directory as "roundcubemail-1.2.0".

Install Roundcube under "/var/www":

$ sudo mv /home/<own account name>/Downloads/roundcubemail-1.2.0 /var/www/roundcube
​$ cd /var/www/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:

http://localhost/phpmyadmin

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:

http://localhost/roundcube/installer

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 config.inc.php
  • move the downloaded file:
$ mv /home/<own account name>/Downloads/config.inc.php /var/www/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/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
or
$ sudo service apache2 reload

Log in at web browser:

http://localhost/roundcube

or

http://www.kctang.com.hk/roundcube

Click Settings > Identity to define some settings:

Click Settings > Address Book > Import to import contacts files, e.g. exported from Google.

Upgrade

Download roundcubemail-1.2.0-complete.tar.gz by selecting "Complete: 1.1.4" at http://roundcube.net/download/, usually to own "Downloads" directory.

Use the file manager to extract the contents of the compressed file under the "Downloads" directory as "roundcubemail-1.2.0".

Upgrade existing directory using the installto.sh script:

$ cd /home/<own account name>/Downloads/roundcubemail-1.2.0/bin
$ ./installto.sh /var/www/roundcube

In case of big trouble

Uninstall Roundcube:

$ sudo apt-get remove roundcube

Remove "/var/www/roundcube":

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

Delete mysql user "roundcube" and database "roundcube" using phpmyadmin.

Intall Roundcube as new.