|
| 1 | + |
| 2 | +--- |
| 3 | +title: "Customizing or expanding bundled DDEV tools" |
| 4 | +pubDate: 2025-06-12 |
| 5 | +summary: How to upgrade/downgrade a utility provided by DDEV, or add a custom one for a given project |
| 6 | +author: Bill Seremetis |
| 7 | +featureImage: |
| 8 | + src: /img/blog/2025/06/ddev-tool-install.png |
| 9 | + alt: "Installing custom software packages in the containerized environment" |
| 10 | + shadow: true |
| 11 | +categories: |
| 12 | + - Guides |
| 13 | + - DevOps |
| 14 | +--- |
| 15 | + |
| 16 | +_This guest post is by DDEV community member and [Drupal](https://drupal.org) |
| 17 | +contributor [Bill Seremetis](/blog/author/bill-seremetis/) and sponsored by |
| 18 | +[Annertech](https://www.annertech.com)._ |
| 19 | + |
| 20 | +DDEV comes bundled with a predefined set of tools, like `composer` for managing |
| 21 | +your PHP projects, `terminus`, `platform` and `acli` for specific hosting environments |
| 22 | +and of course tools specific to projects, such as `wp-cli`. |
| 23 | + |
| 24 | +Most of the time, these tools work as expected, and you have nothing to worry about. |
| 25 | + |
| 26 | +## Manually managing versions of bundled tools |
| 27 | + |
| 28 | +Sometimes though you might need a very specific version of a tool. Maybe you |
| 29 | +[are running an older PHP version](https://github.com/pantheon-systems/terminus/releases/tag/4.0.0) |
| 30 | +or the bundled version [has a bug that ruins things for you](https://github.com/platformsh/cli/discussions/166). |
| 31 | +Newer DDEV versions won't fix your need to run an older version, and |
| 32 | +sometimes it makes no sense to wait if you need a newer version. |
| 33 | + |
| 34 | +We can specify which version to use on a given project by overriding the one |
| 35 | +provided by DDEV easily by using a custom Dockerfile: |
| 36 | + |
| 37 | +```dockerfile |
| 38 | +# .ddev/web-build/Dockerfile.terminus |
| 39 | +# Terminus 4 drops support for PHP 8.1 which we still need |
| 40 | +ARG TERMINUS_VERSION="3.6.2" |
| 41 | +RUN curl -L --fail -o /usr/local/bin/terminus https://github.com/pantheon-systems/terminus/releases/download/${TERMINUS_VERSION}/terminus.phar && chmod +x /usr/local/bin/terminus |
| 42 | +``` |
| 43 | + |
| 44 | +## Installing custom tools |
| 45 | + |
| 46 | +You can obviously use the same trick to install custom tools: |
| 47 | + |
| 48 | +```dockerfile |
| 49 | +# .ddev/web-build/Dockerfile.fzf |
| 50 | +# fooscript relies on fzf |
| 51 | +ARG FZF_VERSION="0.62.0" |
| 52 | +RUN curl -s -L https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_amd64.tar.gz | tar xvz -C /usr/local/bin/ && chmod +x /usr/local/bin/fzf |
| 53 | +``` |
0 commit comments