Docs / Email Servers / Setting Up Roundcube Webmail on VPS

Setting Up Roundcube Webmail on VPS

By Admin · Apr 2, 2026 · Updated Apr 23, 2026 · 7 views · 3 min read

Managing roundcube effectively is a crucial skill for any system administrator. This tutorial provides step-by-step instructions for webmail configuration, along with best practices for production environments.

Prerequisites

  • Valid PTR (reverse DNS) record configured
  • Basic familiarity with the Linux command line
  • Root or sudo access to the server
  • A clean IP address not on any blacklists

Server Installation

Security should be a primary consideration when configuring roundcube. Always use strong passwords, keep software updated, and restrict network access to only the necessary ports and IP addresses.


# Install Postfix and Dovecot
sudo apt update
sudo apt install -y postfix dovecot-core dovecot-imapd dovecot-lmtpd

# Configure Postfix main.cf
sudo postconf -e 'myhostname = mail.example.com'
sudo postconf -e 'mydomain = example.com'
sudo postconf -e 'smtpd_tls_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem'
sudo postconf -e 'smtpd_tls_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem'

These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.

  • Start with the minimum required resources
  • Implement caching at every appropriate layer
  • Profile before optimizing - measure first
  • Use connection pooling for database connections
  • Scale vertically before scaling horizontally

Authentication Setup (SPF/DKIM)

Security should be a primary consideration when configuring roundcube. Always use strong passwords, keep software updated, and restrict network access to only the necessary ports and IP addresses.


# Generate DKIM key
sudo apt install -y opendkim opendkim-tools
sudo mkdir -p /etc/opendkim/keys/example.com
sudo opendkim-genkey -b 2048 -d example.com -D /etc/opendkim/keys/example.com -s default -v

# Add the DNS TXT record from:
cat /etc/opendkim/keys/example.com/default.txt

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

Common Issues and Solutions

  • Slow performance: Check for disk I/O bottlenecks with iostat -x 1 and network issues with mtr. Review application logs for slow queries or requests.
  • High memory usage: Review the configuration for memory-related settings. Reduce worker counts or buffer sizes if running on a low-RAM VPS.
  • Service won't start: Check the logs with journalctl -xe -u roundcube. Common causes include port conflicts, missing configuration files, or insufficient permissions.

Summary

You've successfully configured roundcube on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.

Was this article helpful?