📞 🇺🇸 +1 361 304 4309 📞 🇮🇳 +91 76769 02281 ✉️ [email protected]
Email Servers

How to Set Up Roundcube Webmail on Nginx

How to Set Up Roundcube Webmail on Nginx

Roundcube is the most popular open-source webmail client. It connects to any IMAP server and provides a Gmail-like interface in the browser.

Prerequisites

Step 1 — Install Dependencies

sudo apt install php7.4-{fpm,mysql,curl,gd,mbstring,xml,zip,intl} -y

Step 2 — Download Roundcube

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

Step 3 — Create Database

sudo mysql -u root -p
CREATE DATABASE roundcube CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL ON roundcube.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;

Step 4 — Configure Nginx

sudo nano /etc/nginx/sites-available/roundcube
server {
    listen 443 ssl;
    server_name webmail.yourdomain.com;
    root /var/www/roundcube;
    index index.php;

    ssl_certificate /etc/letsencrypt/live/webmail.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/webmail.yourdomain.com/privkey.pem;

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

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    # Security — block sensitive files
    location ~* /(config|temp|logs)/ { deny all; }
    location ~ /\. { deny all; }
}

Step 5 — Run Installer

https://webmail.yourdomain.com/installer

Complete the web installer — enter IMAP server, database credentials and SMTP settings.

Step 6 — Remove Installer

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

Conclusion

Roundcube provides a professional webmail interface for any IMAP server. Our team installs and configures complete mail server stacks including webmail.

#roundcube #webmail #nginx #php #imap
Share this guide:
🛠️ Need Expert Help?

Don't want to do this yourself?

Our certified engineers implement this for you — correctly, securely, and within hours. Available 24/7 with 15-minute emergency response.

  • ✅ 19+ years experience
  • ✅ 60+ certified engineers
  • ✅ 1,600+ servers managed
  • ✅ 40+ countries served
  • ✅ Plans from $49/mo

Get Expert Help — Free Consultation

We respond within 4 hours · No commitment required

Please enter your name and a valid email.

No spam. Privacy Policy

Comments