{"id":11956,"date":"2022-03-29T08:05:03","date_gmt":"2022-03-29T05:05:03","guid":{"rendered":"https:\/\/kifarunix.com\/?p=11956"},"modified":"2024-03-09T10:37:27","modified_gmt":"2024-03-09T07:37:27","slug":"install-roundcube-webmail-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-roundcube-webmail-on-ubuntu-22-04\/","title":{"rendered":"Install Roundcube Webmail on Ubuntu 22.04"},"content":{"rendered":"\n
In this tutorial, we are going to learn how to install Roundcube webmail on Ubuntu 22.04. Roundcube<\/a> webmail is a free and open source web-based IMAP email client. It is written in PHP and works just like any other email client. It provides a handful of features;<\/p>\n\n\n\n You can find comprehensive list of features of Roundcube here<\/a>.<\/p>\n\n\n\n As stated, Roundcube Webmail is written in PHP and thus it runs on a standard LAMPP server. The following are the minimum server requirements;<\/p>\n\n\n\n Before you can proceed with installation and configuration of Roundcube webmail on Ubuntu 22.04, update your package cache;<\/p>\n\n\n\n Install LAMP stack by running the command below;<\/p>\n\n\n\n Next, iInstall other required PHP modules;<\/p>\n\n\n\n The latest stable release version for Roundcube can be installed by downloading the source code from the Roundcube downloads page<\/a>.<\/p>\n\n\n\n NOTE that Roundcube is availble on the default Ubuntu repos.<\/p>\n\n\n\n However, the repositories do not usually provide an up-to-date version. As of this writing, Roundcube 1.5.2 is the latest stable release version.<\/p>\n\n\n\n Thus, you can simply get the link to the current release version of Roundcub and pull the tarball as follows;<\/p>\n\n\n\n Be sure to download the complete package<\/strong>.<\/p>\n\n\n\n Extract the Roundcube tarball archive to your web root directory, in our case, this directory is Create this directory if it doesn’t exist.<\/p>\n\n\n\n Set proper ownership for roundcube root directory and permissions for Roundcube The Create a dedicated Apache VirtualHost configuration file for Roundcube;<\/p>\n\n\n\n Save and quit the configuration file.<\/p>\n\n\n\n If you need to use HTTPS, obtain the SSL\/TLS certificates and configure Apache appropriately.<\/p>\n\n\n\n Disable Apache default site<\/p>\n\n\n\n Enable Roundcube site.<\/p>\n\n\n\n Enable the following Apache Modules<\/p>\n\n\n\n Verify syntactical errors in Rouncube site configuration.<\/p>\n\n\n\n If there are syntax errors, restart Apache if there is error.<\/p>\n\n\n\n Roundcube supports various database backends as stated above.<\/p>\n\n\n\n In this guide, we are going to use MySQL server which we already installed in the guide whose link is given above.<\/p>\n\n\n\n Login to MySQL and create Roundcube databases.<\/p>\n\n\n\n Replace the database and database user names accordingly.<\/p>\n\n\n\n Create Roundcube database user and grant all privileges on Roundcube database.<\/p>\n\n\n\n Reload privileges tables and exit the database;<\/p>\n\n\n\n To begin, ensure the mbstring, xml, dom, intl PHP modules are enabled;<\/p>\n\n\n\n Set default time zone in php.ini;<\/p>\n\n\n\n You can now complete the setup of Roundcube from browser by accessing the When the installer runs, it first checks if all required dependencies are met. Ensure that everything is in an OK<\/strong> state before proceeding.<\/p>\n\n\n\n <\/p>\n\n\n\n Once all the requirements are met, click step 2 to create configuration for Roundcube.<\/p>\n\n\n\n For the General configuration<\/strong> and Logging & Debugging<\/strong> settings, let us go with the defaults.<\/p>\n\n\n\n Set the database connection settings as per what you created above.<\/p>\n\n\n For both IMAP and SMTP settings, we are using GMAIL relay. Hence just set the hosts and ports.<\/p>\n\n\n\n For the rest of the settings, you can leave the defaults or update them to your preference.<\/p>\n\n\n\n At the bottom of the page, CREATE CONFIG<\/strong> to create your Roundcube configuration with the options you have defined.<\/p>\n\n\n\n You should see a message that the configuration has been created successfully.<\/p>\n\n\n\n Click CONTINUE<\/strong> to proceed and Test the configuration.<\/strong><\/p>\n\n\n Test your mail relay message deliverability by ending your email and password and click Send Test mail<\/strong>.<\/p>\n\n\n Test your message receivability, click Check login<\/strong> to verify.<\/p>\n\n\n After completing the installation and the final tests remove<\/strong> the whole installer folder from the web root directory.<\/p>\n\n\n\n You can simply disable the installer by running the command below;<\/p>\n\n\n\n You can now access your Roundcube webmail via the address http:\/\/server-IP-or-hostname<\/strong>. This takes you to the login screen.<\/p>\n\n\n Use your email account credentials for logging in. In my case, am using my Gmail account.<\/p>\n\n\n\n There you go. Roundcube is now up and running on Ubuntu 22.04. You can explore various functionalities of the tool further.<\/p>\n\n\n\n That marks the end of our guide on how to install Roundcube Webmail.<\/p>\n\n\n\n Roundcube HowTo wiki<\/a><\/p>\n\n\n\n How to Install and Setup Roundcube Webmail on Debian 9<\/a><\/p>\n\n\n\n Configure Sendmail to Use Gmail Relay on Ubuntu 18.04\/Debian 10\/9<\/a><\/p>\n\n\n\n How to Install and Setup iRedMail Mail Server on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n\n
Install Roundcube Webmail on Ubuntu 22.04<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
\n
Run system Update<\/h3>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
Install and Setup LAMP Stack On Ubuntu<\/h3>\n\n\n\n
apt install apache2 php mariadb-server mariadb-client -y<\/code><\/pre>\n\n\n\n
apt install openssl composer php-{net-smtp,mysql,gd,xml,mbstring,intl,zip,json,pear,bz2,gmp,imap,imagick,auth-sasl,mail-mime,net-ldap3,net-sieve,curl} libapache2-mod-php curl -y<\/code><\/pre>\n\n\n\n
Download Roundcube<\/h3>\n\n\n\n
apt info roundcube-core<\/code><\/pre>\n\n\n\n
VER=1.5.2<\/code><\/pre>\n\n\n\n
wget -P \/tmp\/ https:\/\/github.com\/roundcube\/roundcubemail\/releases\/download\/$VER\/roundcubemail-$VER-complete.tar.gz<\/strong><\/code><\/pre>\n\n\n\n
Extract Roundcube to Apache Web Root Directory<\/h3>\n\n\n\n
\/var\/www\/html\/roundcube<\/code>.<\/p>\n\n\n\n
mkdir \/var\/www\/html\/roundcube<\/code><\/pre>\n\n\n\n
tar xzf \/tmp\/roundcubemail-$VER-complete.tar.gz -C \/var\/www\/html\/roundcube --strip-components 1<\/code><\/pre>\n\n\n\n
\/temp<\/code> and
\/logs<\/code> directories;<\/p>\n\n\n\n
chown -R www-data.www-data \/var\/www\/html\/roundcube\/\nchmod -R 775 \/var\/www\/html\/roundcube\/{temp,logs}<\/code><\/pre>\n\n\n\n
\/config<\/code>,
\/temp<\/code> and
\/logs<\/code> directories should be protected against access from the browser.<\/p>\n\n\n\n
Configure Apache VirtualHost for Roundcube<\/h3>\n\n\n\n
tee \/etc\/apache2\/sites-available\/roundcube.conf << 'EOL'\n<VirtualHost *:80>\n ServerName roundcube.kifarunix-demo.com\n ServerAdmin master@kifarunix-demo.com\n DocumentRoot \/var\/www\/html\/roundcube\n\n\t<Directory \/var\/www\/html\/roundcube>\n\t\tOptions +FollowSymLinks\n\t\tAddType text\/x-component .htc\n\t\t<IfModule mod_php.c>\n\t\t\tphp_flag display_errors Off\n\t\t\tphp_flag log_errors On\n\t\t\tphp_value upload_max_filesize 10M\n\t\t\tphp_value post_max_size 12M\n\t\t\tphp_value memory_limit 64M\n\t\t\tphp_flag zlib.output_compression Off\n\t\t\tphp_flag magic_quotes_gpc Off\n\t\t\tphp_flag magic_quotes_runtime Off\n\t\t\tphp_flag zend.ze1_compatibility_mode Off\n\t\t\tphp_flag suhosin.session.encrypt Off\n\t\t\tphp_flag session.auto_start Off\n\t\t\tphp_value session.gc_maxlifetime 21600\n\t\t\tphp_value session.gc_divisor 500\n\t\t\tphp_value session.gc_probability 1\n\t\t<\/IfModule>\n\t\t<IfModule mod_rewrite.c>\n\t\t\tRewriteEngine On\n\t\t\tRewriteRule ^favicon\\.ico$ skins\/larry\/images\/favicon.ico\n\t\t\tRewriteRule ^(?!installer)(\\.?[^\\.]+)$ - [F]\n\t\t\tRewriteRule ^\/?(\\.git|\\.tx|SQL|bin|config|logs|temp|tests|program\\\/(include|lib|localization|steps)) - [F]\n\t\t\tRewriteRule \/?(README\\.md|composer\\.json-dist|composer\\.json|package\\.xml)$ - [F]\n\t\t<\/IfModule>\n\t\t<IfModule mod_deflate.c>\n\t\t\tSetOutputFilter DEFLATE\n\t\t<\/IfModule>\n\t\t<IfModule mod_headers.c>\n\t\t\t# replace 'append' with 'merge' for Apache version 2.2.9 and later\n\t\t\t# Header append Cache-Control public env=!NO_CACHE\n\t\t<\/IfModule>\n\t\t<IfModule mod_expires.c>\n\t\t\tExpiresActive On\n\t\t\tExpiresDefault \"access plus 1 month\"\n\t\t<\/IfModule>\n\t\tFileETag MTime Size\n\t\t<IfModule mod_autoindex.c>\n\t\t\tOptions -Indexes\n\t\t<\/ifModule>\n\t\tAllowOverride None\n\t\tRequire all granted\n\t<\/Directory>\n\t\n\t<Directory \/var\/www\/html\/roundcube\/plugins\/enigma\/home>\n\t\tOptions -FollowSymLinks\n\t\tAllowOverride None\n\t\tRequire all denied\n\t<\/Directory>\n\t<Directory \/var\/www\/html\/roundcube\/config>\n\t\tOptions -FollowSymLinks\n\t\tAllowOverride None\n\t\tRequire all denied\n\t<\/Directory>\n\t<Directory \/var\/www\/html\/roundcube\/temp>\n\t\tOptions -FollowSymLinks\n\t\tAllowOverride None\n\t\tRequire all denied\n\t<\/Directory>\n\t<Directory \/var\/www\/html\/roundcube\/logs>\n\t\tOptions -FollowSymLinks\n\t\tAllowOverride None\n\t\tRequire all denied\n\t<\/Directory>\n ErrorLog ${APACHE_LOG_DIR}\/roundcube-error.log\n CustomLog ${APACHE_LOG_DIR}\/roundcube-access.log combined\n<\/VirtualHost>\nEOL\n<\/code><\/pre>\n\n\n\n
a2dissite 000-default<\/code><\/pre>\n\n\n\n
a2ensite roundcube<\/code><\/pre>\n\n\n\n
a2enmod deflate expires headers rewrite<\/code><\/pre>\n\n\n\n
apachectl -t<\/code><\/pre>\n\n\n\n
Syntax OK<\/code><\/pre>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\n
Create Roundcube Database and Database User<\/h3>\n\n\n\n
systemctl enable --now mariadb<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
create database roundcube;<\/code><\/pre>\n\n\n\n
create user rcadmin@localhost identified by 'StrongPassword';<\/code><\/pre>\n\n\n\n
grant all on roundcube.* to rcadmin@localhost;<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
Import Roundcube initial database into MySQL database created above;<\/h3>\n\n\n\n
mysql -u rcadmin -p roundcube < \/var\/www\/html\/roundcube\/SQL\/mysql.initial.sql<\/code><\/pre>\n\n\n\n
Configure PHP for Roundcube<\/h3>\n\n\n\n
php -m | grep -iE \"mbstring|xml|dom|intl\"<\/code><\/pre>\n\n\n\n
sed -i 's\/^;date.timezone =\/date.timezone = Asia\\\/Nicosia\/' \/etc\/php\/*\/apache2\/php.ini<\/code><\/pre>\n\n\n\n
Configure Roundcube Webmail on Ubuntu 22.04<\/h3>\n\n\n\n
http:\/\/server-IP-or-hostname\/installer<\/strong><\/code> link.<\/p>\n\n\n\n
Check the Prerequisites<\/h4>\n\n\n\n
Create Roundcube Configuration<\/h4>\n\n\n\n
<\/figure><\/div>\n\n\n
<\/figure>\n\n\n
<\/figure><\/div>\n\n\n
<\/figure><\/div>\n\n\n
<\/figure><\/div>\n\n\n
<\/figure><\/div>\n\n\n
rm -rf \/var\/www\/html\/roundcube\/installer\/<\/code><\/pre>\n\n\n\n
echo \"$config['enable_installer'] = false;\" >> \/var\/www\/html\/roundcube\/config\/config.inc.php<\/code><\/pre>\n\n\n\n
Login to Roundcube Webmail<\/h3>\n\n\n\n
<\/figure><\/div>\n\n\n
<\/figure><\/div><\/a><\/div>\n\n\n\n
Further Reading<\/h3>\n\n\n\n
Related Tutorials<\/h3>\n\n\n\n