A Step-by-Step Guide: Installing Roundcube Email Client on Linux Ubuntu 22.04


Roundcube is a reliable and user-friendly open-source email solution. It simplifies email management for both individuals and organizations with its intuitive interface and extensive features. If you’re using Linux Ubuntu 22.04 LTS and looking for a good email client, installing Roundcube is a wise decision. In this guide, we will take you through the installation process step-by-step.


In order to complete the installation successfully, the following is a list of items that are needed:
1) A server with atleast 4GB of RAM, a dual core processor and atleast 50GB of free disk space
2) Linux Ubuntu Server 22.04 LTS or any newer version
3) A public static IP address and a fully qualified domain name
4) An SSH client such as Putty or the terminal app for MacOS
5) A stable internet connection.


The following is an overview of the steps covered in this guide:
1) Update the system repository and upgrade system packages
2) Download and install the LAMP stack
3) Create a database for Roundcube
4) Download and extract the Roundcube application files
5) Configure the Roundcube application files and complete the installation

Step 1: Update the system repository and upgrade system packages

Before installing any new software, it’s a good practice to update your system packages to ensure you have the latest versions and security patches. Run the following commands to update the system repository and upgrade system packages to the latest available versions:
sudo apt update
sudo apt upgrade

Step 2: Download and install the LAMP stack

Roundcube requires a web server, PHP, and a database system. You can install the LAMP (Linux, Apache, MySQL, PHP) stack to meet these requirements. Copy, paste and run the following commands to install the LAMP stack:
sudo apt install apache2 mariadb-server -y
sudo systemctl start apache2
sudo systemctl start mariadb
sudo systemctl enable apache2
sudo systemctl enable mariadb
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej.php
sudo apt update
sudo apt install php8.0
sudo apt install php8.0-mysql php8.0-gd php8.0-common php8.0-imagick php8.0-imap php8.0-xml php8.0-opcache php8.0-mbstring php8.0-curl php8.0-zip php8.0-bz2 php8.0-intl
Once the installation completes, run the mysql secure installation script:
sudo mysql_secure_installation

Step 3: Create a database for Roundcube

You’ve successfully installed the LAMP stack on your Linux Ubuntu Server. The next step is crwating a database for the Roundcube email client. To do this, run the following commands:
sudo mysql -u root -p
CREATE DATABASE roundcubedb;
GRANT ALL PRIVILEGES ON roundcubedb.*TO'roundcubeuser'@'localhost' IDENTIFIED BY 'verysecurepassword';
Once the installation is successfull, you can move on to the next step.

Step 4: Download and install the Roundcube application files.

Now that the MySQL database for Roundcube is created, the next step is downloading and installing Roundcube application files. Run the following command to create a directory in the Apache virtualhost root:

mkdir /var/www/vh_roundcube/

Run the following command to create the virtualhost configuration file for Roundcube:


Copy and paste the following configuration into the file:

< VirtualHost *:80>
DocumentRoot /var/www/vh_roundcube/public

ErrorLog ${APACHE_LOG_DIR}/roundcube-error.log
CustomLog ${APACHE_LOG_DIR}/roundcue-access.log combined

< Directory /var/www/vh_roundcube/public>
Options -Indexes
AllowOverride All
Order allow, deny
allow from all
< /Directory>
< /VirtualHost>

Press CTRL + O, press Enter then press CTRL + X to exit the file. Run the following commands to enable the Roundcube virtualhost and reload Apache:

a2ensite vh_roundcube.conf
systemctl reload apache2
Finally, run the following command to download Roundcube from the official github repository:
Once the download complete, execute the following command to extract the archive:
tar zxvf roundcubemail-1.6.1-complete.tar.gz
Scroll to Top