Deploying Roundcube
Introduction
Roundcube is a free, open-source webmail client with a desktop-like user interface. It provides a full-featured email experience in your browser, connecting to standard IMAP servers while offering a clean, intuitive interface that rivals commercial webmail services.
Key highlights of Roundcube:
- Modern Interface: Desktop-like UI with drag-and-drop functionality
- IMAP/SMTP Support: Works with any standard email server
- Rich Text Editor: Full HTML email composition
- Address Book: Integrated contacts with import/export
- Search: Full-text search across messages
- Folder Management: Create, rename, and organize folders
- Multiple Identities: Support for multiple sender identities
- Plugins: Extensive plugin architecture for customization
- Skins: Multiple themes and customizable appearance
- Mobile Responsive: Works on tablets and phones
- Multi-Language: Available in 80+ languages
- Open Source: GPL-3.0 licensed with active development
This guide walks through deploying Roundcube on Klutch.sh using Docker and connecting it to your mail server.
Why Deploy Roundcube on Klutch.sh
Deploying Roundcube on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically builds and deploys Roundcube without complex web server configuration.
Persistent Storage: Attach persistent volumes for user preferences and temporary files that survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL for secure email access.
Always-On Availability: Your webmail remains accessible 24/7 from anywhere.
Environment Variable Management: Securely store configuration through Klutch.sh.
Prerequisites
Before deploying Roundcube on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Roundcube configuration
- An IMAP email server to connect to
- An SMTP server for sending email
- (Optional) An external database for multi-user deployments
- Basic familiarity with Docker
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for Roundcube deployment.
Repository Structure
roundcube-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM roundcube/roundcubemail:latest
# Set environment variablesENV ROUNDCUBEMAIL_DEFAULT_HOST=${IMAP_HOST}ENV ROUNDCUBEMAIL_DEFAULT_PORT=${IMAP_PORT:-993}ENV ROUNDCUBEMAIL_SMTP_SERVER=${SMTP_HOST}ENV ROUNDCUBEMAIL_SMTP_PORT=${SMTP_PORT:-587}ENV ROUNDCUBEMAIL_DB_TYPE=${DB_TYPE:-sqlite}ENV ROUNDCUBEMAIL_DB_HOST=${DB_HOST}ENV ROUNDCUBEMAIL_DB_NAME=${DB_NAME:-roundcube}ENV ROUNDCUBEMAIL_DB_USER=${DB_USER}ENV ROUNDCUBEMAIL_DB_PASSWORD=${DB_PASSWORD}
# Expose the web interface portEXPOSE 80
# The base image includes the default entrypointEnvironment Variables Reference
| Variable | Required | Description |
|---|---|---|
IMAP_HOST | Yes | IMAP server hostname (e.g., ssl://mail.example.com) |
IMAP_PORT | No | IMAP port (default: 993 for SSL) |
SMTP_HOST | Yes | SMTP server hostname (e.g., tls://mail.example.com) |
SMTP_PORT | No | SMTP port (default: 587) |
DB_TYPE | No | Database type: sqlite, mysql, or pgsql (default: sqlite) |
DB_HOST | No | Database host (for MySQL/PostgreSQL) |
DB_NAME | No | Database name (default: roundcube) |
DB_USER | No | Database username |
DB_PASSWORD | No | Database password |
Deploying Roundcube on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
Push Your Repository to GitHub
Commit and push your Dockerfile to GitHub.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “roundcube” or “webmail”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select the repository containing your Roundcube Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
IMAP_HOST | ssl://mail.example.com |
SMTP_HOST | tls://mail.example.com |
For external database (recommended for production):
| Variable | Value |
|---|---|
DB_TYPE | mysql or pgsql |
DB_HOST | Your database host |
DB_USER | Your database user |
DB_PASSWORD | Your database password |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/html/db | 1 GB | SQLite database (if using sqlite) |
/var/www/html/temp | 1 GB | Temporary files and attachments |
/var/www/html/logs | 1 GB | Application logs |
Deploy Your Application
Click Deploy to start the build process.
Access Roundcube
Once deployment completes, access Roundcube at your app URL and log in with your email credentials.
Configuration
Connecting to Your Mail Server
Roundcube connects to your existing IMAP/SMTP server:
- Users log in with their email credentials
- Roundcube authenticates against the IMAP server
- Emails are accessed directly from the mail server
Configuring Plugins
- Edit the Dockerfile to enable plugins:
ENV ROUNDCUBEMAIL_PLUGINS=archive,zipdownload,managesieve
- Common plugins:
archive: Archive messageszipdownload: Download multiple messages as ZIPmanagesieve: Manage server-side mail filters
Customizing Appearance
- Set the default skin:
ENV ROUNDCUBEMAIL_SKIN=elastic
- Available skins: elastic (default), larry, classic
Security Considerations
- Always use SSL/TLS for IMAP and SMTP connections
- Configure proper session timeouts
- Use a proper database instead of SQLite for production
- Regularly update Roundcube for security patches
Additional Resources
Conclusion
Deploying Roundcube on Klutch.sh gives you a modern, feature-rich webmail client with automatic builds, persistent storage, and secure HTTPS access. Whether for personal use or organization-wide email access, Roundcube on Klutch.sh provides a reliable webmail solution that works with any standard email server.