How to Set Up Webmail (Roundcube) for Your Mail Server

Roundcube provides a polished, browser-based email interface for your self-hosted mail server — letting users check email without configuring a desktop/mobile mail client.

Prerequisites

  • A working mail server (see How to Set Up a Complete Mail Server (Postfix + Dovecot + SPF/DKIM/DMARC))
  • Nginx or Apache, PHP, MySQL/MariaDB

Step 1 — Install Dependencies

sudo apt install php php-fpm php-mysql php-imap php-mbstring php-xml php-intl mariadb-server -y

Step 2 — Create the Roundcube Database

sudo mysql
CREATE DATABASE roundcube;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'CHANGE_ME_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON roundcube.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;

Step 3 — Download Roundcube

cd /var/www
sudo wget https://github.com/roundcube/roundcubemail/releases/latest/download/roundcubemail-VERSION-complete.tar.gz
sudo tar xzf roundcubemail-*-complete.tar.gz
sudo mv roundcubemail-* roundcube

Step 4 — Set Permissions

sudo chown -R www-data:www-data /var/www/roundcube

Step 5 — Run the Installer

http://YOUR_SERVER_IP/roundcube/installer

Walk through the web-based installer: configure database connection, IMAP server (typically localhost if Dovecot runs on the same server), and SMTP server settings.

Step 6 — Delete the Installer (Important Security Step)

sudo rm -rf /var/www/roundcube/installer

Leaving the installer accessible after setup is a real security risk — always remove it once configuration is complete.

Step 7 — Configure Nginx

server {
    listen 443 ssl;
    server_name webmail.yourdomain.com;
    root /var/www/roundcube/public_html;
    index index.php;

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

Step 8 — Add HTTPS

sudo certbot --nginx -d webmail.yourdomain.com

Step 9 — Log In

Users log in with their existing mail server credentials (the same account/password used for IMAP) — no separate Roundcube-specific account needed.

Setting Up Automatic Database Updates

cd /var/www/roundcube
sudo -u www-data bin/updatedb.sh --dir=SQL --package=roundcube

Run after upgrading Roundcube versions to apply any necessary database schema changes.

Enabling Useful Plugins

sudo nano /var/www/roundcube/config/config.inc.php
$config['plugins'] = ['archive', 'zipdownload', 'managesieve'];

managesieve is particularly useful, letting users configure their own email filtering rules directly through the web interface.

Common Errors

"IMAP Error: Login failed" — verify Roundcube's configured IMAP host/port matches your Dovecot setup, and that the mail server itself is reachable from where Roundcube runs.

Continue Reading

Browse more articles in Email Hosting & Deliverability.

  • roundcube webmail, self hosted webmail, roundcube installation, webmail client setup
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

How to Set Up a VPS for Email Marketing (Complete Guide)

Running your own email marketing infrastructure on a VPS gives you full control over...

How to Configure SPF, DKIM, and DMARC (Complete Guide)

SPF, DKIM, and DMARC are the three DNS-based email authentication standards that Gmail, Outlook,...

How to Set Up Reverse DNS (PTR/rDNS) for Email Deliverability

Reverse DNS (PTR record) maps your server's IP address back to a hostname — the opposite of...

IP Warm-Up: A Safe 30-Day Schedule for New Sending IPs

Mailbox providers like Gmail and Outlook monitor sending behavior closely and treat sudden...

Best Email Marketing Software for a VPS (MailWizz, Mautic, Listmonk & More)

Choosing the right self-hosted email marketing platform affects deliverability, ease of...