Roundcube is an popular Webmail interface written on PHP programming language. You can access Mailbox created on your Linux server through POP/IMAP on roundcube we interface. This tutorial will help you to install Roundcube Webmail on CentOS 8
- Launched a CentOS 8 instance on DigitalOcean.
- Setup a sudo privileged account and apply initial security by following initial server setup
- Login to instance via SSH as root account
Step 1 – Install LAMP Server
Roundcube webmail application is written on PHP programming languege. It uses MySQL as the database server. So we required to setup a LAMP server on your server.
All the packages are available in default repositories, to install them type:
sudo dnf install httpd \ mysql mysql-server \ php php-common php-curl php-json php-xml php-mbstring php-imap php-mysqlnd php-cli php-gd
Once the installation finished. enable and start the Apache and MySQL database service.
systemctl enable httpd.service systemctl start httpd.service systemctl enable mysqld.service systemctl start mysqld.service
Next, you need to set MySQL root account password and apply security. Run the post installation script to secure database server.
First set a strong password for the root account and complete the wizard steps. Your CentOS system is ready for the Roundcube installation.
Step 2 – Create Roundcube Database
We are using MySQL as the database server for Roundcube webmail. So first, login to your MySQL server via command line.
mysql -u root -p
Then create database and a user for authentication:
CREATE DATABASE roundcubemail; CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'DFksfkksd89k32&ks'; GRANT ALL ON roundcubemail.* to 'roundcube'@'localhost'; FLUSH PRIVILEGES;
Step 3 – Download Roundcube
Roundcube webmail official releases can be downloaded from its github repository. At the time of writing this tutorial, Roundcubemail 1.4.4 is the latest available version for the installation. You can download it using the below command.
After downloading the archive file, extract it. Then move the directory to the proper location to configure as webroot.
tar -zxvf roundcubemail-1.4.4-complete.tar.gz mv roundcubemail-1.4.4 /var/www/html/roundcubemail
And set the proper username and permissions to run on web server. The default Apache server runs with user and group named “apache”. The Nginx users can use “www-data” as username and group.
chown -R apache:apache /var/www/html/roundcubemail chmod -R 755 /var/www/html/roundcubemail
Step 4 – Configure Apache Web Server
You can deploy Roundcube either as subdirectory url (like: https://example.com/webmail), or you can deploy directoy on domain or subdomain.
For this tutoiral, we will deploy it directly to subdomain like https://mail.tecadmin.net. Let’s configure Apache server to host Roundcubemail application. Create an Apache virtualhost configuration file and add the following values.
Save your file and restart Apache service.
sudo systemctl restart httpd
Step 5 – Run Roundcube Web Installer
The Roundcube webmail is configured with Apache. You can access application in your web browser. Here you need to complete the web installer wizard, Which you can access as following:
Open the below URL in browser. Change domain with your domain name:
On the first page, you will see the server environment. Make sure there is no error message showing. All the required PHP extensions are properly installed.
Once you verify that all the required extension’s are installed. Slide down to bottom of page and click “Next” to continue wizard.
Enter the product name as per your requirements. This will be identification of your webamil. Generally, You will see this in page titles.
Slide down to the “Database Setup” section. Update the details as per created database and user in above steps.
Again slide down to the bottom of the page and click on “CREATE CONFIG” button. You will see the message like below screenshot.
Once the configuration file created successfully, click on “Continue” button.
In the final page of wizard, click on “Initialize database” button. If you don’t see any button, make your the database details you entered in previous step are correct.
The installation wizard has been completed now.
Step 6 – Access Roundcube Webmail
As the installation has been completed. The wizard will show you a message to remove installer directory. You need to remove it manually. Do it with below command
sudo rm -rf /var/www/html/roundcubemail/installer/
All done. Access the webmail interface in another tab with the domain you configured. You will see the login page. Enter the login details here:
If you see any error, make sure user is able to access mailbox with imap protocol on terminal. To verify connection connect imap using mutt.
mutt -f imap://[email protected]
After successful login to the Roubcube webmail, you will see the dashboard like the screenshot below. This will also show you the email from you account here.
If you are not seeing any emails here, you need to check Dovecot configuration. The most probably the Mailbox location configured on email server (Postfix or Sendmail) is not matching the location on Dovecot server.
In this tutorial, you learn about installation and configuration of Roundcube webmail interface on a CentOS 8 linux system. Let’s use the webmail for the emailing.