Server administration Setting Up a Mail Server from Scratch – Part 7: Installing Roundcube

  • Thread starter D•Jass
  • Start date
  • Tags
    server
D•Jass

D•Jass

Staff member
Verified
  • #1

Installing Roundcube​

Roundcube is a popular web interface for accessing mail over IMAP.

7.1. Downloading and Extracting Roundcube​

Download the latest stable version and place it in the root directory of your mail site (e.g., [INLINE]mail.example.com[/INLINE]).
cd /tmp

Get the latest version number from GitHub API
VER="$(curl -s https://api.github.com/repos/roundcube/roundcubemail/releases/latest | grep tag_name | cut -d '"' -f 4)"
echo "Downloading Roundcube version: $VER"

Download the archive
wget -O roundcubemail-$VER.tar.gz "https://github.com/roundcube/roundcubemail/releases/download/$VER/roundcubemail-$VER-complete.tar.gz"

Extract
tar -xzf roundcubemail-$VER.tar.gz

Move to your web server directory (should match the root path in your Nginx config)
mkdir -p /var/www/html/ # Create base directory if needed
mv roundcubemail-$VER /var/www/html/roundcube

Set permissions for Nginx/PHP-FPM
chown -R www-data:www-data /var/www/html/roundcube

Clean up temporary archive
rm roundcubemail-$VER.tar.gz

7.2. Initializing the Roundcube Database​

Import the initial table structure into the previously created database.

[INFO]Make sure to enter the correct password for user [INLINE]roundcube_admin[/INLINE]![/INFO]
mysql -u roundcube_admin -p roundcube < /var/www/html/roundcube/SQL/mysql.initial.sql

7.3. Running the Roundcube Web Installer​

Open the installer in your browser:
Please, Login or Register to view URLs content!


Then follow the instructions in the web installer:
Check environment: Ensure all requirements are met (PHP extensions, write access to [INLINE]temp[/INLINE] and [INLINE]logs[/INLINE] directories). Fix any issues if needed.

Create config
Database setup:
Database type: [INLINE]MySQL[/INLINE]​
Database server: [INLINE]localhost[/INLINE]​
Database name: [INLINE]roundcube[/INLINE]​
Database user: [INLINE]roundcube_admin[/INLINE]​
Database password: The one you set earlier (e.g., [INLINE]StrongRoundcubePass[/INLINE])​
IMAP Settings:
default_host: [INLINE]ssl://localhost[/INLINE] or [INLINE]ssl://mail.example.com[/INLINE]​
default_port: [INLINE]993[/INLINE]​
auth_type: [INLINE]LOGIN[/INLINE] (or leave blank for auto-detection)​
SMTP Settings:
smtp_server: [INLINE]tls://localhost[/INLINE] or [INLINE]tls://mail.example.com[/INLINE]​
smtp_port: [INLINE]587[/INLINE]​
Use the current IMAP username and password for SMTP authentication​
Plugins:
Choose the ones you need (e.g., [INLINE]archive[/INLINE], [INLINE]zipdownload[/INLINE], [INLINE]managesieve[/INLINE] — if using Sieve filters)​
Click "Create Config" to generate the [INLINE]config/config.inc.php[/INLINE] file.​
On the final screen, test SMTP sending and IMAP login.​

7.4. Completing the Installation​

[WARNING]It is critical to delete the [INLINE]installer[/INLINE] directory after installation![/WARNING]
rm -rf /var/www/html/roundcube/installer
 
Top