-[](https://travis-ci.org/roundcube/roundcubemail-docker)
+[](https://github.com/roundcube/roundcubemail-docker/actions/workflows/test.yml)
[](https://hub.docker.com/r/roundcube/roundcubemail/)
# Running Roundcube in a Docker Container
The simplest method is to run the official image:
-```
+```sh
docker run -e ROUNDCUBEMAIL_DEFAULT_HOST=mail -e ROUNDCUBEMAIL_SMTP_SERVER=mail -p 8000:80 -d roundcube/roundcubemail
```
The following env variables can be set to configure your Roundcube Docker instance:
-`ROUNDCUBEMAIL_DEFAULT_HOST` - Hostname of the IMAP server to connect to. For encypted connections, prefix the host with `tls://` (STARTTLS) or `ssl://` (SSL/TLS).
+`ROUNDCUBEMAIL_DEFAULT_HOST` - Hostname of the IMAP server to connect to. For encrypted connections, prefix the host with `tls://` (STARTTLS) or `ssl://` (SSL/TLS).
`ROUNDCUBEMAIL_DEFAULT_PORT` - IMAP port number; defaults to `143`
-`ROUNDCUBEMAIL_SMTP_SERVER` - Hostname of the SMTP server to send mails. For encypted connections, prefix the host with `tls://` (STARTTLS) or `ssl://` (SSL/TLS).
+`ROUNDCUBEMAIL_SMTP_SERVER` - Hostname of the SMTP server to send mails. For encrypted connections, prefix the host with `tls://` (STARTTLS) or `ssl://` (SSL/TLS).
`ROUNDCUBEMAIL_SMTP_PORT` - SMTP port number; defaults to `587`
`ROUNDCUBEMAIL_SPELLCHECK_URI` - Fully qualified URL to a Google XML spell check API like [google-spell-pspell](https://github.com/roundcube/google-spell-pspell)
-`ROUNDCUBEMAIL_ASPELL_DICTS` - List of aspell dictionaries to install for spell checking (comma-separated, e.g. `de,fr,pl`).
+`ROUNDCUBEMAIL_ASPELL_DICTS` - List of aspell dictionaries to install for spell checking (comma-separated, e.g. `de,fr,pl`).
By default, the image will use a local SQLite database for storing user account metadata.
It'll be created inside the container directory `/var/roundcube/db`. In order to persist the database, a volume
Run it with a link to the MySQL host and the username/password variables:
-```
+```sh
docker run --link=mysql:mysql -d roundcube/roundcubemail
```
This is the document root of Roundcube. Plugins and additional skins are stored here amongst the Roundcube sources.
Share this directory when using the FPM variant and let a webserver container serve the static files from here.
-* `/var/roundcube/config`: Location for additonal config files
+* `/var/roundcube/config`: Location for additional config files
See the [Advanced configuration](#advanced-configuration) section for details.
* `/var/roundcube/db`: storage location of the SQLite database
## Docker Secrets
When running the Roundcube container in a Docker Swarm, you can use [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/)
-to share credentials accross all instances. The following secrets are currently supported by Roundcube:
+to share credentials across all instances. The following secrets are currently supported by Roundcube:
* `roundcube_des_key`: Unique and random key for encryption purposes
* `roundcube_db_user`: Database connection username (mappend to `ROUNDCUBEMAIL_DB_USER`)
where additional config files (`*.php`) are searched and included. Mount a local directory with your config
files - check for valid PHP syntax - when starting the Docker container:
-```
+```sh
docker run -v ./config/:/var/roundcube/config/ -d roundcube/roundcubemail
```
which is used to install plugins. You can add and activate plugins by executing `composer require <package-name>`
inside a running Roundcube container:
-```
-$ docker exec -it roundcubemail composer require johndoh/contextmenu --update-no-dev
+```sh
+docker exec -it roundcubemail composer require johndoh/contextmenu --update-no-dev
```
If you have mounted the container's volume `/var/www/html` the plugins installed persist on your host system.
Build it from one of the variants directories with
-```
+```sh
docker build -t roundcubemail .
```