Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Mail Services»How to Install Roundcube Webmail on CentOS 8

    How to Install Roundcube Webmail on CentOS 8

    By RahulJune 14, 20215 Mins Read

    Roundcube is a popular Webmail interface written on PHP programming language. You can access Mailbox created on your Linux server through POP/IMAP on the Roundcube web interface. This tutorial will help you to install Roundcube Webmail on CentOS 8

    Advertisement

    Prerequisites

    • 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 in PHP programming language. It uses MySQL as the database server. So we required to set up 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 the database server.

    sudo mysql_secure_installation
    

    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, log in to your MySQL server via the 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.

    wget https://github.com/roundcube/roundcubemail/releases/download/1.4.4/roundcubemail-1.4.4-complete.tar.gz
    

    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 a subdirectory URL (like: https://example.com/webmail), or you can deploy directly on a domain or subdomain.

    For this tutorial, we will deploy it directly to a subdomain like https://mail.tecadmin.net. Let’s configure Apache server to host the Roundcubemail application. Create an Apache virtual host configuration file and add the following values.

    vim /etc/httpd/conf.d/roundcubemail.conf
    

    1
    2
    3
    4
    5
    6
    7
    8
    <VirtualHost *:80>
      ServerAdmin admin@example.org
      ServerName mail.tecadmin.net
      DocumentRoot /var/www/html/roundcubemail
      <Directory /var/www/html/roundcubemail>
          Allowoverride all
      </Directory>
    </VirtualHost>

    Save your file and restart the Apache service.

    sudo systemctl restart httpd
    

    Step 5 – Run Roundcube Web Installer

    The Roundcube webmail is configured with Apache. You can access the application in your web browser. Here you need to complete the web installer wizard, Which you can access as follows:

    Open the below URL in browser. Change domain with your domain name:

    https://mail.tecadmin.net/installer/
    

    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.

    Rouncube web install step 1

    Once you verify that all the required extensions 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 an identification of your webmail. Generally, You will see this in page titles.

    Rouncube web install step 2

    Slide down to the “Database Setup” section. Update the details as per created database and user in the above steps.

    Rouncube web install step 3

    Again slide down to the bottom of the page and click on “CREATE CONFIG” button. You will see a message like the below screenshot.

    Once the configuration file created successfully, click on “Continue” button.

    Rouncube web install step 4

    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 the previous step are correct.

    Rouncube web install step 5

    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 the installer directory. You need to remove it manually. Do it with the 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:

    Rouncube webmail login page

    If you see any error, make sure the user is able to access the mailbox with IMAP protocol on the 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 your account here.

    Rouncube Dashboard

    If you are not seeing any emails here, you need to check the Dovecot configuration. Most probably the Mailbox location configured on the email server (Postfix or Sendmail) is not matching the location on the Dovecot server.

    Conclusion

    In this tutorial, you learn about the installation and configuration of the Roundcube webmail interface on a CentOS 8 Linux system. Let’s use webmail for the emailing.

    Email IMAP POP3 Roundcube Webmail
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Validate Email Addresses in Python (Using Regular Expressions)

    Configuring Sendmail through the External SMTP relay

    Postfix: Relay Email from SMTP based on From Address

    Postfix: Relay Outgoing Emails Based On Sender Address

    View 4 Comments

    4 Comments

    1. Comp Labs on November 10, 2021 11:24 am

      When I complete, it shows this:

      Forbidden
      You don’t have permission to access this resource.Server unable to read htaccess file, denying access to be safe

      Reply
      • Comp Labs on November 10, 2021 1:24 pm

        Now ok, I applied this solution from CentOS Console:

        If you want to allow httpd to read user content
        You must tell SELinux about this by enabling the ‘httpd_read_user_content’ boolean.
        More Details:
        setsebool -P httpd_read_user_content 1

        Reply
    2. Warron French on June 12, 2021 7:03 pm

      Rahul, thanks for sharing these instructions but I am getting stuck at the first step, specifically because I am not finding php-imap as your instructions state

      “All the packages are available in default repositories, to install them type:”

      Can you help? Also, do you know where I can find a web-front-end to email that comes in a package that has dependencies easily satisfied?

      Reply
      • Comp Labs on November 10, 2021 11:24 am

        I have installed dovecot, postfix, and roundcube for my mails. I have removed php-imap from the command and it works well.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting and Getting the Default Timezone in Python
    • What is Media Access Control (MAC) Address?
    • What is Cross-Site Scripting (XSS)?
    • What is Content Security Policy (CSP)?
    • A User’s Guide to Understanding Redirection Operators in Bash
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.