Roundcube is a popular webmail program. You can read, write, and sort your emails in your browser, manage contacts, and create senders with your own signature. One important thing to know: Roundcube is not a mail server. It accesses an existing mailbox via IMAP and sends email through your provider's SMTP server. Your emails remain on the mail server; Roundcube only stores settings, contacts, and senders.
In this guide, we'll show you two ways to install Roundcube: the easy way as a One-Click App, which gets Roundcube running at its own address with HTTPS in just a few minutes, and a manual installation with Docker Compose and an nginx reverse proxy. After that, you'll learn how to set up senders, signatures, and contacts, and what Roundcube's limitations are.
Running your own Roundcube is worthwhile if:
- You already have a mailbox with IMAP access, for example through your domain or email provider, and want a better or custom web interface for it.
- Several people need to use their mailboxes from the same mail server in a browser, such as in a club or small team, at a shared address like
webmail.example.com. - You want to read email on other people's computers without setting up an email program there.
- You want to choose your own webmail interface, for example the attachment size limit or the address your webmail runs at.
Roundcube is less suitable if you don't have a mailbox yet. In that case, you first need a mail server. The easiest way to get one is with the ZAP Webspace + Mail app, which already includes Roundcube.
The app catalog offers Roundcube on its own and as part of ZAP Webspace + Mail. The two apps serve different purposes:
| Roundcube | ZAP Webspace + Mail | |
|---|---|---|
| What you get | Webmail only | Mail server, Roundcube webmail, and webspace |
| Mailboxes | Already exist with another provider | You create them yourself using your own domain |
| Emails are stored | On your provider's mail server | On your VPS |
| DNS records for email | Not needed | You add the MX, SPF, DKIM, and DMARC records yourself |
| Typical use | Your own webmail for an existing mailbox | Creating your own email addresses from scratch |
If you want your own email addresses and mail server, follow the guide Web Hosting: Set Up Email with Your Own Mail Server. Roundcube is already included, so you don't need to install the Roundcube app separately. The standalone Roundcube app is intended for existing mailboxes, for example with an external provider or on a mail server running on another server.
With your VPS's One-Click Apps, Roundcube will be available at its own address with HTTPS after just a few minutes. During installation, you only need to specify which mail server Roundcube should connect to.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See VPS: One-Click Apps for instructions.
- At least 512 MB RAM, 1 vCPU core, and 2 GB of storage for the app. 1 GB RAM and 2 vCPU cores are recommended. The emails themselves are stored on the mail server and don't take up space on the VPS.
- A mailbox with IMAP and SMTP access, along with your provider's server details: hostname, ports, and encryption. You can usually find these in your provider's help center under “IMAP settings” or “Set up an email program.”
Roundcube expects the hostname to be preceded by a prefix that specifies the encryption method:
| Prefix | Encryption | Default port in the app |
|---|---|---|
ssl:// | SSL/TLS from the start of the connection | IMAP 143, SMTP 587 |
tls:// | STARTTLS | IMAP 143, SMTP 587 |
The app always uses port 143 for IMAP and port 587 for SMTP, including when using ssl://. For the usual combinations, this means:
- IMAP with SSL/TLS on port 993 (most providers): Enter
ssl://mail.example.comand also add the variableROUNDCUBEMAIL_DEFAULT_PORTwith the value993(see below). - IMAP with STARTTLS on port 143: Enter
tls://mail.example.com; you don't need a port variable. - SMTP with STARTTLS on port 587: Enter
tls://mail.example.com. This works with almost all providers.
Without ssl:// or tls://, Roundcube connects without encryption and sends your password to the mail server in plain text. Many servers reject this, causing the login to fail.
For SMTP, we recommend using port 587 with tls://. On new VPSs, outgoing connections on ports 25 and 465 are blocked until you verify your phone number in your account. Port 587 is not affected.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search for “Roundcube” in the App catalog and click Install app next to Roundcube.
- Enter a name under App name and leave Use a custom subdomain or zap.cloud enabled. Choose the address where your webmail should be available, for example the
webmailprefix. - Under App configuration, enter the IMAP server in
ROUNDCUBEMAIL_DEFAULT_HOSTand the SMTP server inROUNDCUBEMAIL_SMTP_SERVER, as described above. Both fields are required. - If your provider uses IMAP on port
993: Under Custom environment variables, click the plus icon (Add variable) and addROUNDCUBEMAIL_DEFAULT_PORTwith the value993. - Click Queue installation.
After one or two minutes, the app will show as Online. Click the Access link on the app card to open the Roundcube login page.
Roundcube doesn't have its own admin account or password. You log in directly with your mailbox credentials: the username is usually your full email address, along with your mailbox password. The first time you log in, Roundcube automatically creates settings, contacts, and a sender for that mailbox.
After that, you'll see your folders on the left, the message list in the middle, and the open email on the right. Roundcube uses the language set in your browser. To change it, go to Settings > Preferences > User Interface.
If you can't log in, Roundcube displays a message in the bottom-right corner:
| Message | Meaning | Solution |
|---|---|---|
| Connection to storage server failed. | Roundcube can't reach the IMAP server. | Check the hostname, prefix, and port. For ssl://, you usually need to set ROUNDCUBEMAIL_DEFAULT_PORT = 993. |
| Login failed. | The server is reachable but rejected the username or password. | Check your login details. For Gmail, use an app password. |
Anyone with a mailbox and password on the configured mail server can log in. There is no server field on the login page: Roundcube only connects to the server specified in the app configuration, even if someone tries to provide a different server. This means outsiders can't misuse your webmail to access arbitrary mail servers. Roundcube only sends email using the credentials of the logged-in mailbox.
Because the login page is publicly accessible, automated login attempts can start quickly. After three incorrect passwords within one minute, Roundcube temporarily blocks login attempts for a mailbox it already knows about. The main protection is a strong password for every mailbox.
You can change servers, ports, and other options in the app settings (gear icon) under App environment. The two required fields are at the top. Add other variables under Custom environment variables using the plus icon. After you click Save, the app restarts and will be available again in about a minute.
Useful variables:
| Variable | Effect | Example |
|---|---|---|
ROUNDCUBEMAIL_DEFAULT_PORT | IMAP port; defaults to 143 if not specified | 993 |
ROUNDCUBEMAIL_SMTP_PORT | SMTP port; defaults to 587 if not specified | 465 |
ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE | Maximum size per attachment; defaults to 5M | 25M |
ROUNDCUBEMAIL_USERNAME_DOMAIN | Appends the domain to the username if someone enters only the part before the @ sign | example.com |
By default, Roundcube accepts attachments up to 5 MB. Set ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE = 25M to allow files up to 25 MB each. However, your email provider determines the maximum size of an entire email. Many providers allow 20 to 50 MB.
Roundcube associates settings, contacts, and senders with the mail server. If you later enter a different hostname, every mailbox in Roundcube will start with an empty contact list. Export your contacts as a vCard under Contacts first.
- Updates: Open the app settings (gear icon) > App update and click Check for updates. If a new version is available, install it using Apply update. The app uses the Roundcube 1.7 release series, and Roundcube updates the database itself when it starts.
- Backups: A VPS backup from the Backups tab also backs up the
roundcube-dbvolume (settings, contacts, senders) and theroundcube-datavolume (additional configuration files). Your email provider backs up your emails; they aren't stored on the VPS. - Uninstalling: Under App actions > Uninstall app, you can also delete the data volumes. This removes your Roundcube contacts and settings, but your emails remain on the mail server.
The rest of this guide covers the manual installation of Roundcube with Docker Compose, for example on a server without One-Click Apps. You'll run Roundcube with a MariaDB database, expose the port locally only, and make webmail accessible through nginx with a Let's Encrypt certificate.
| Minimum | Recommended | |
|---|---|---|
| CPU | 1 vCPU core | 2 vCPU cores |
| RAM | 512 MB | 1 GB |
| Storage | 2 GB | 5 GB |
You'll also need:
- Debian or Ubuntu with SSH access. See VPS: First Access via SSH.
- Docker with the Compose plugin. See Set Up Docker on a Linux Server – Run and Manage Containers on Your Infrastructure.
- A domain pointing to your server with an A record, for example
webmail.example.com. - The IMAP and SMTP details for your mail server, as described above under “Entering the server details correctly.”
Roundcube only needs the web ports to be accessible from the outside. Roundcube connects to the mail server itself, so you don't need to open any ports for those connections. Open SSH, HTTP, and HTTPS in ufw:
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Don't open Roundcube's port. Docker bypasses ufw rules for published ports, so bind the port to 127.0.0.1 in the Compose file. That way, only nginx on the same server can access it. For more information, see VPS: Open Ports and Manage the Firewall on Linux.
Create a directory and generate a .env file with a random database password:
sudo mkdir -p /opt/roundcube && cd /opt/roundcube
echo "DB_PASSWORD=$(openssl rand -hex 24)" | sudo tee .env
sudo chmod 600 .env
Then create the compose.yml file, for example with sudo nano compose.yml:
services:
db:
image: mariadb:11
restart: unless-stopped
environment:
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
MARIADB_DATABASE: roundcubemail
MARIADB_USER: roundcube
MARIADB_PASSWORD: ${DB_PASSWORD}
volumes:
- roundcube-db:/var/lib/mysql
roundcube:
image: roundcube/roundcubemail:1.7.x-apache
restart: unless-stopped
depends_on:
- db
environment:
ROUNDCUBEMAIL_DB_TYPE: mysql
ROUNDCUBEMAIL_DB_HOST: db
ROUNDCUBEMAIL_DB_USER: roundcube
ROUNDCUBEMAIL_DB_PASSWORD: ${DB_PASSWORD}
ROUNDCUBEMAIL_DB_NAME: roundcubemail
ROUNDCUBEMAIL_DEFAULT_HOST: ssl://mail.example.com
ROUNDCUBEMAIL_DEFAULT_PORT: "993"
ROUNDCUBEMAIL_SMTP_SERVER: tls://mail.example.com
ROUNDCUBEMAIL_SMTP_PORT: "587"
ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: 25M
ports:
- "127.0.0.1:8000:80"
volumes:
- roundcube-config:/var/roundcube/config
volumes:
roundcube-db:
roundcube-config:
The important lines:
imageuses the Roundcube 1.7 release series with Apache. The1.7.x-apachetag gets all bug fixes for this series, including security updates.MARIADB_USERandMARIADB_PASSWORDcreate a dedicated database user for Roundcube. The database root password is generated randomly and isn't needed.ROUNDCUBEMAIL_DEFAULT_HOSTandROUNDCUBEMAIL_SMTP_SERVERare your provider's servers. Replacemail.example.comwith your own values. The ports are specified separately inROUNDCUBEMAIL_DEFAULT_PORTandROUNDCUBEMAIL_SMTP_PORT.127.0.0.1:8000:80makes Roundcube accessible only from the server itself.- You can put your own configuration files (
*.php) in theroundcube-configvolume. Roundcube loads them every time it starts.
Start Roundcube:
sudo docker compose up -d
sudo docker compose logs -f roundcube
On the first start, Roundcube creates the tables in the database. Once Creating database schema... [OK] appears, followed by resuming normal operations, Roundcube is ready. Press Strg + C to exit the log view.
First, check locally whether Roundcube responds:
curl -sI http://127.0.0.1:8000/
The response starts with HTTP/1.1 200 OK. In the next step, you'll set up browser access through nginx with HTTPS. Then log in with your mailbox credentials, as described above under “First login.”
Install nginx and Certbot:
sudo apt install -y nginx certbot python3-certbot-nginx
Create the /etc/nginx/sites-available/roundcube file:
server {
listen 80;
server_name webmail.example.com;
client_max_body_size 30M;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
client_max_body_size must be slightly larger than the attachment limit set by ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE; otherwise, nginx will reject larger uploads. Enable the site and obtain the certificate:
sudo ln -s /etc/nginx/sites-available/roundcube /etc/nginx/sites-enabled/roundcube
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d webmail.example.com
Certbot adds the HTTPS block and redirects HTTP to HTTPS. For more on the basics, see VPS: Set Up an nginx Reverse Proxy on Linux and VPS: Create an SSL Certificate (Let's Encrypt) for Linux Servers.
Roundcube stores settings, contacts, and senders in the database. You can back up the database while it is running:
cd /opt/roundcube
sudo docker compose exec -T db sh -c 'mariadb-dump -u roundcube -p"$MARIADB_PASSWORD" roundcubemail' | sudo tee /root/roundcube-db-$(date +%F).sql > /dev/null
Also back up compose.yml, .env, and any custom files from the roundcube-config volume. Then copy the backup to another computer or storage location. A backup on the same server won't protect you if that server fails. Your email provider backs up the emails themselves.
The 1.7.x-apache tag receives new versions in the 1.7 series. Pull them regularly:
cd /opt/roundcube
sudo docker compose pull
sudo docker compose up -d
When it starts, Roundcube applies the update and adjusts the database itself. To switch to a new release series (for example, 1.8), change the tag in compose.yml. First, read the Roundcube release notes and back up the database.
After your first login, it's worth taking a quick look at the settings. You'll find the most important options under Settings in the left sidebar.
Under Settings > Identities, you'll find your sender. Click it and enter your name under Display Name so recipients see more than just your email address. Below that, add a signature under Signature and click Save. Use Create to add additional senders, for example for an alias of your mailbox. Your mail server determines whether you're allowed to send from another address.
You can import existing address books under Contacts. Roundcube reads vCard and CSV files exported from your previous email program or webmail. You can also export your contacts there as a vCard, for example before changing mail servers.
Under Settings > Folders, you can show or hide mailbox folders and create new ones. Under Settings > Preferences, you can configure the language, time zone, and message list display. Under Special Folders, you can select the folders for sent and deleted emails. Click Dark mode in the bottom-left corner to switch to the dark theme.
- Not a mail server: You can't log in without a mailbox from a provider or on your own mail server.
- One mail server per installation: All users log in to the same IMAP server. If you have mailboxes with different providers, you'll need multiple installations.
- No filter rules: The filters section is missing because the app only enables extensions for archiving and ZIP downloads. Set up sorting rules with your email provider.
- No calendar: Roundcube is webmail with an address book only.
- Gmail and Microsoft: For Gmail, log in with an app password from your Google account, not your regular password. Microsoft accounts (Outlook.com, Hotmail, Microsoft 365) no longer allow password-based IMAP login. Roundcube would need OAuth login for these accounts, which isn't included in the One-Click App.
With Roundcube, you now have your own webmail at your own address, letting you use your existing mailbox in the browser with senders, a signature, and contacts. Next, Set Up Radicale on a Linux Server shows you how to sync calendars and contacts on your own server.
If you have any other questions or need help, our support team is available every day! 🙂
