Skip to content

Change container versions

Change container versions

Devilbox lets you switch service images by editing .env. The active version for most services is controlled by a *_SERVER variable, and Docker uses that value the next time the affected service is recreated.

Safe workflow

Use this workflow for any service version change:

  1. Stop Devilbox.
  2. Back up data for stateful services.
  3. Edit the relevant variable in .env.
  4. Recreate the affected containers.
  5. Verify the service version inside the running container.
Terminal window
dvl down
vi .env
dvl up

For one service, you can also restart that service after editing, but a clean dvl down and dvl up is easier to reason about when images, ports, or data volumes change.

Current version variables

These are the primary image selectors from env-example:

VariableDefaultService
PHP_SERVER8.1Default php service.
HTTPD_FLAVOURalpineHTTPD image flavor.
HTTPD_SERVERnginx-stableWeb server image.
MYSQL_SERVERmariadb-10.4MySQL-compatible database service.
PGSQL_SERVER14-alpinePostgreSQL service.
REDIS_SERVER6.2-alpineRedis service.
MEMCD_SERVER1.6-alpineMemcached service.
MONGO_SERVER5.0MongoDB service.
VARNISH_SERVER6Varnish override service.
MAILHOG_SERVERlatestMailHog override service.
OPENSEARCH_SERVER1.2-0OpenSearch override service.
NGROK_SERVERlatestNgrok override service.
MAILPIT_SERVERlatestMailpit override service.
BUGGREGATOR_SERVERlatestBuggregator override service.
AEM_SERVER6.5.11.0-jdk11AEM override service.

PHP versions

The default PHP service uses PHP_SERVER. The current selectable values are:

ValueStatus in env-example
7.4available
8.0available
8.1default
8.2available
8.3available
8.4available

Example: switch the default PHP service to 8.4.

Terminal window
dvl down

Edit .env so only one PHP_SERVER assignment is active:

Terminal window
#PHP_SERVER=7.4
#PHP_SERVER=8.0
#PHP_SERVER=8.1
#PHP_SERVER=8.2
#PHP_SERVER=8.3
PHP_SERVER=8.4

Start again:

Terminal window
dvl up
dvl exec "php -v"

HTTPD versions

HTTPD selection uses two variables:

Terminal window
HTTPD_FLAVOUR=alpine
HTTPD_SERVER=nginx-stable

Current values shown in env-example:

VariableValues
HTTPD_FLAVOURdebian, alpine
HTTPD_SERVERapache-2.2, apache-2.4, nginx-stable, nginx-mainline

Example: switch to Apache 2.4 with the Alpine flavor.

Terminal window
dvl down

Edit .env:

Terminal window
HTTPD_FLAVOUR=alpine
#HTTPD_SERVER=apache-2.2
HTTPD_SERVER=apache-2.4
#HTTPD_SERVER=nginx-stable
#HTTPD_SERVER=nginx-mainline

Start again:

Terminal window
dvl up

MySQL, MariaDB, and Percona versions

The MySQL-compatible service uses MYSQL_SERVER. Current values from env-example are:

FamilyValues
MySQLmysql-5.5, mysql-5.6, mysql-5.7, mysql-8.0
Perconapercona-5.5, percona-5.6, percona-5.7, percona-8.0
MariaDBmariadb-5.5, mariadb-10.0, mariadb-10.1, mariadb-10.2, mariadb-10.3, mariadb-10.4, mariadb-10.5, mariadb-10.6, mariadb-10.7, mariadb-10.8, mariadb-10.9, mariadb-10.10, mariadb-11.4

Default:

Terminal window
MYSQL_SERVER=mariadb-10.4

Example: switch to MySQL 8.0.

Terminal window
dvl down

Edit .env:

Terminal window
#MYSQL_SERVER=mysql-5.7
MYSQL_SERVER=mysql-8.0
#MYSQL_SERVER=mariadb-10.4

Start again and verify:

Terminal window
dvl up
dvl exec "mysql --version"

PostgreSQL versions

The PostgreSQL service uses PGSQL_SERVER. Current values from env-example are:

CategoryValues
Older non-arm64 entries9.1, 9.2-alpine
Standard entries9.2, 9.3, 9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15, latest
Alpine entries9.3-alpine, 9.4-alpine, 9.5-alpine, 9.6-alpine, 10-alpine, 11-alpine, 12-alpine, 13-alpine, 14-alpine, 15-alpine, alpine

Default:

Terminal window
PGSQL_SERVER=14-alpine

Example: switch to PostgreSQL 15 Alpine.

Terminal window
dvl down

Edit .env:

Terminal window
#PGSQL_SERVER=14-alpine
PGSQL_SERVER=15-alpine

Start again:

Terminal window
dvl up

PostgreSQL data uses version-specific volumes such as devilbox-pgsql-14-alpine.

Redis versions

The Redis service uses REDIS_SERVER. Current values from env-example are:

CategoryValues
Older non-arm64 entries2.8, 3.0, 3.0-alpine
Standard entries3.2, 4.0, 5.0, 6.0, 6.2, 7.0, latest
Alpine entries3.2-alpine, 4.0-alpine, 5.0-alpine, 6.0-alpine, 6.2-alpine, 7.0-alpine, alpine

Default:

Terminal window
REDIS_SERVER=6.2-alpine

Example: switch to Redis 7.0 Alpine.

Terminal window
dvl down

Edit .env:

Terminal window
#REDIS_SERVER=6.2-alpine
REDIS_SERVER=7.0-alpine

Start again:

Terminal window
dvl up

MongoDB versions

The MongoDB service uses MONGO_SERVER. Current values from env-example are:

CategoryValues
Older non-arm64 entries2.8, 3.0, 3.2
Standard entries3.4, 3.6, 4.0, 4.2, 4.4, 5.0, latest

Default:

Terminal window
MONGO_SERVER=5.0

Example: switch to MongoDB 4.4.

Terminal window
dvl down

Edit .env:

Terminal window
#MONGO_SERVER=4.4
MONGO_SERVER=5.0

Start again:

Terminal window
dvl up

MongoDB data uses version-specific volumes such as devilbox-mongo-5.0.

Memcached versions

The Memcached service uses MEMCD_SERVER. Current values from env-example are:

CategoryValues
Older non-arm64 entries1.4, 1.4-alpine
Standard entries1.5, 1.6, latest
Alpine entries1.5-alpine, 1.6-alpine, alpine

Default:

Terminal window
MEMCD_SERVER=1.6-alpine

Optional service versions

Optional compose layers have their own selectors:

VariableDefaultOther values shown in env-example
VARNISH_SERVER64, 5, 7
MAILHOG_SERVERlatest1.3-linux-arm64, 1.2-linux-arm64, 1-linux-arm64
OPENSEARCH_SERVER1.2-02.12-0, 2.5-0, 2.5-1
NGROK_SERVERlatest0.7, 0.3
MAILPIT_SERVERlatest1.24, 1.2, edge
BUGGREGATOR_SERVERlatest1.13, 1.12
AEM_SERVER6.5.11.0-jdk116.5.11.0-jdk11-arm, 6.5.3.0-bundle, 6.5.3.0-bundle-forms, 6.5.8.0-bundle-forms-jdk11

These values only matter when the matching service is enabled through the base stack or an override layer.

Configuration file implications

Several services have version-specific configuration directories. When you switch versions, review the matching path:

ServiceConfiguration path pattern
PHP inicfg/php-ini-<PHP_SERVER>/
PHP-FPMcfg/php-fpm-<PHP_SERVER>/
PHP startupcfg/php-startup-<PHP_SERVER>/
HTTPDcfg/<HTTPD_SERVER>/
MySQL-compatiblecfg/<MYSQL_SERVER>/
Vhost templatescfg/vhost-gen/

If you customized only one version’s directory, those settings may not apply after switching.

Duplicate assignments in .env

Shell-style .env parsing uses the last active assignment when the same variable appears more than once. Avoid leaving duplicates.

Bad example:

Terminal window
PHP_SERVER=8.1
PHP_SERVER=8.4

The effective value is 8.4, but the file is confusing. Prefer one active assignment and comments for alternatives:

Terminal window
#PHP_SERVER=8.1
PHP_SERVER=8.4

Verification commands

After changing versions, verify from inside the container where possible:

Terminal window
dvl exec "php -v"
dvl exec "mysql --version"
dvl exec "redis-cli --version"

For services without a PHP-container client, inspect Compose output:

Terminal window
cd "$DEVILBOX_PATH"
docker compose ps
docker compose config

Checklist

  • You copied version values exactly from env-example.
  • You changed only one active assignment per variable.
  • You backed up stateful service data before switching database versions.
  • You ran dvl down before editing .env.
  • You ran dvl up after editing .env.
  • You verified the running version after startup.
  • You reviewed version-specific configuration directories.
  • You understand that database volume names can change with version selectors.