Docs / Email Servers / Setting Up Roundcube Webmail on Your Server

Setting Up Roundcube Webmail on Your Server

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 136 views · 1 min read

What Is Roundcube?

Roundcube is a free, open-source webmail client. It provides a clean, modern interface for reading and sending email through a web browser — similar to Gmail or Outlook web.

Prerequisites

  • A working mail server (Postfix + Dovecot)
  • Apache or Nginx with PHP
  • MariaDB or PostgreSQL

Installation

cd /var/www
wget https://github.com/roundcube/roundcubemail/releases/download/1.6.6/roundcubemail-1.6.6-complete.tar.gz
tar xzf roundcubemail-*.tar.gz
mv roundcubemail-* roundcube
chown -R www-data:www-data roundcube

Create Database

mysql -u root -p
CREATE DATABASE roundcubemail;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'SecureRCPass123';
GRANT ALL ON roundcubemail.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;

Run the Installer

Navigate to http://your-domain/roundcube/installer and follow the wizard. Key settings:

  • Database: MySQL, localhost, roundcubemail, roundcube, your-password
  • IMAP: localhost, port 143, STARTTLS
  • SMTP: localhost, port 587, STARTTLS

Nginx Configuration

server {
    listen 80;
    server_name mail.example.com;
    root /var/www/roundcube;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    }

    location ~ /\.(ht|git|svn) { deny all; }
}

Security

  • Remove the installer after setup: rm -rf /var/www/roundcube/installer
  • Enable SSL with Certbot
  • Restrict access to /config directory

Was this article helpful?