github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/docs/content/users/usage/faq.md (about) 1 # FAQ 2 3 Frequently-asked questions organized into high-level functionality, investigating issues, daily usage, and connecting with our community. 4 5 ## Features & Requirements 6 7 ### What operating systems will DDEV work with? 8 9 DDEV works nearly anywhere Docker will run, including macOS, Windows 10/11 Pro/Enterprise and Home, and every Linux variant we’ve ever tried. It also runs in many Linux-like environments, like ChromeOS (in Linux machine) and Windows 10/11’s WSL2. DDEV works the same on each of these platforms since the important work is done inside identical Docker containers. 10 11 ### Why do you recommend Colima over Docker Desktop on macOS? 12 13 [Colima](https://github.com/abiosoft/colima) (with its bundled [Lima](https://github.com/lima-vm/lima)) is similar to what Docker Desktop provides, with a great DDEV experience on Intel and Apple Silicon machines. We specifically recommend Colima because of some important differences: 14 15 * It’s open source software with an MIT license, unlike Docker Desktop which is proprietary software. No license fee to Docker, Inc. and no paid Docker plan required for larger organizations. 16 * It’s CLI-focused, unlike Docker Desktop’s GUI. 17 * It’s focused directly on running containers. 18 * It’s fast and stable. 19 20 ### Do I need to install PHP, Composer, nginx, or Node.js/npm on my workstation? 21 22 No. These tools live inside DDEV’s Docker containers, so you only need to [install Docker](../install/docker-installation.md) and [install DDEV](../install/ddev-installation.md). This is especially handy for Windows users where there’s more friction getting these things installed. 23 24 ### Do I lose data when I run `ddev poweroff`, `ddev stop`, or `ddev restart`? 25 26 No. Your code continues to live on your workstation, and your database is safely stored on a Docker volume—both unaffected by these commands. 27 28 ### How can I connect to my database? 29 30 The answer depends on where you’re connecting _from_. 31 32 The [`ddev describe`](../usage/commands.md#describe) command includes database connection details in a row like this: 33 34 ``` 35 │ db │ OK │ InDocker: ddev-mysite-db:3306 │ mariadb:10.3 │ 36 │ │ │ Host: localhost:63161 │ User/Pass: 'db/db' │ 37 │ │ │ │ or 'root/root' │ 38 ``` 39 40 Inside your project container, where the app itself is running, the database hostname is `db` 41 (**not** `127.0.0.1`) and the port is the default for your database engine—`3306` for MySQL/MariaDB, `5432` for PostgreSQL. 42 43 Outside your project’s web container, for example a database GUI on your workstation, the hostname is `localhost` and the port is unique to that project. In the example above, it’s `63161`. 44 45 The username, password, and database are each `db` regardless of how you connect. 46 47 ### Can I use additional databases with DDEV? 48 49 Yes, you can create additional databases and manually do whatever you need on them. They’re created automatically if you use `ddev import-db` with the `--target-db` option. In this example, `extradb.sql.gz` is extracted and imported to a newly-created database named `extradb`: 50 51 ``` 52 ddev import-db --target-db=extradb --src=.tarballs/extradb.sql.gz 53 ``` 54 55 You can use [`ddev mysql`](../usage/commands.md#mysql) or `ddev psql` to execute queries, or use the MySQL/PostgreSQL clients within `ddev ssh` or `ddev ssh -s db`. See the [Database Management](database-management.md) page. 56 57 ### Can different projects communicate with each other? 58 59 Yes, this is commonly required for situations like Drupal migrations. For the `web` container to access the `db` container of another project, use `ddev-<projectname>-db` as the hostname of the other project. 60 61 Let’s say we have two projects, for example: project A, and project B. In project A, use `mysql -h ddev-projectb-db` to access the database server of project B. For HTTP/S communication you can 1) access the web container of project B directly with the hostname `ddev-<projectb>-web` and port 80 or 443: `curl https://ddev-projectb-web` or 2) Add a `.ddev/docker-compose.communicate.yaml` for accessing the other project via the official FQDN. 62 63 ```yaml 64 services: 65 web: 66 external_links: 67 - "ddev-router:projectb.ddev.site" 68 ``` 69 70 ### Can I run DDEV with other development environments at the same time? 71 72 Yes, as long as they’re configured with different ports. It doesn’t matter whether your other environments use Docker or not, it should only be a matter of avoiding port conflicts. 73 74 It’s probably easiest, however, to shut down one before using the other. 75 76 For example, if you use Lando for one project, do a `lando poweroff` before using DDEV, and then run [`ddev poweroff`](../usage/commands.md#poweroff) before using Lando again. If you run nginx or Apache locally, stop them before using DDEV. The [troubleshooting](troubleshooting.md) section goes into more detail about identifying and resolving port conflicts. 77 78 ## Performance & Troubleshooting 79 80 ### How can I get the best performance? 81 82 Docker’s normal mounting can be slow, especially on macOS. See the [Performance](../install/performance.md) section for speed-up options including Mutagen and NFS mounting. 83 84 ### How can I troubleshoot what’s going wrong? 85 86 See the [troubleshooting](troubleshooting.md), [Docker troubleshooting](../install/docker-installation.md#testing-and-troubleshooting##-your-docker-installation) and [Xdebug troubleshooting](../debugging-profiling/step-debugging.md#troubleshooting-xdebug) sections. 87 88 ### How can I check that Docker is working? 89 90 See the [troubleshooting section](../install/docker-installation.md#troubleshooting) on the Docker Installation page. 91 92 ### Why do I get a 403 or 404 on my project after `ddev launch`? 93 94 Most likely because the docroot is misconfigured, or there’s no `index.php` or `index.html` in it. Open your `.ddev/config.yaml` file and check the [`docroot`](../configuration/config.md#docroot) value, which should be a relative path to the directory containing your project’s `index.php`. 95 96 ### Why do I see nginx headers when I’ve set `webserver_type: apache-fpm`? 97 98 Apache runs in the web container, but when you use the `https://*.ddev.site` URL, it goes through `ddev-router`, which is an nginx reverse proxy. That’s why you see nginx headers even though your web container’s using Apache. Read more in [this Stack Overflow answer](https://stackoverflow.com/a/52780601/215713). 99 100 ### Why does `ddev start` fail with “error while mounting volume, Permission denied”? 101 102 This almost always means NFS is enabled in your project, but NFS isn’t working on your machine. 103 104 Start by completely turning NFS off for your projects with `ddev config --nfs-mount-enabled=false && ddev config global --nfs-mount-enabled=false`. Then later, [get NFS working](../install/performance.md#using-nfs-to-mount-the-project-into-the-web-container). NFS can be a big performance help on macOS and traditional Windows, and not needed on Linux or Windows WSL2. Most people on macOS and Windows use Mutagen instead of NFS because of its vastly improved performance, so instead of trying to fix this you can disable NFS and enable Mutagen by running `ddev config --nfs-mount-enabled=false --mutagen-enabled`. 105 106 ### Why are my Apache HTTP → HTTPS redirects stuck in an infinite loop? 107 108 It’s common to set up HTTP-to-TLS redirects in an `.htaccess` file, which leads to issues with the DDEV proxy setup. The TLS endpoint of a DDEV project is always the `ddev-router` container and requests are forwarded through plain HTTP to the project’s web server. This results in endless redirects, so you need to change the root `.htaccess` file for Apache correctly handles these requests for your local development environment with DDEV. The following snippet should work for most scenarios—not just DDEV—and could replace an existing redirect: 109 110 ```apache 111 # http:// -> https:// plain or behind proxy for Apache 2.2 and 2.4 112 # behind proxy 113 RewriteCond %{HTTP:X-FORWARDED-PROTO} ^http$ 114 RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] 115 116 # plain 117 RewriteCond %{HTTP:X-FORWARDED-PROTO} ^$ 118 RewriteCond %{REQUEST_SCHEME} ^http$ [NC,OR] 119 RewriteCond %{HTTPS} off 120 RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] 121 ``` 122 123 ## Workflow 124 125 ### How can I update/upgrade DDEV? 126 127 You’ll want to update DDEV using the same method you chose to install it. Since upgrading is basically the same as installing, you can follow [DDEV Installation](../install/ddev-installation.md) to upgrade. 128 129 You can use the [`self-upgrade`](../usage/commands.md#self-upgrade) command for getting instructions tailored to your installation. 130 131 * On macOS you likely installed via Homebrew; run `brew update && brew upgrade ddev`. 132 <!-- markdownlint-disable-next-line --> 133 * On Linux + WSL2 using Debian/Ubuntu’s `apt install` technique, run `sudo apt update && sudo apt upgrade ddev` like any other package on your system. 134 <!-- markdownlint-disable-next-line --> 135 * On Linux + WSL2 with a Homebrew install, run `brew update && brew upgrade ddev`. 136 * On macOS or Linux (including WSL2) if you installed using the [install_ddev.sh script](https://github.com/drud/ddev/blob/master/scripts/install_ddev.sh) you just run it again: 137 <!-- markdownlint-disable --> 138 ``` 139 curl -fsSL https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash 140 ``` 141 <!-- markdownlint-restore --> 142 * On traditional Windows, you likely installed with Chocolatey or by downloading the installer package. You can upgrade with `choco upgrade ddev` or by visiting the [releases](https://github.com/drud/ddev/releases) page and downloading the installer. Both techniques will work. 143 * On Arch-Linux based systems, use the standard upgrade techniques, e.g. `yay -Syu`. 144 145 ### How can I install a specific version of DDEV? 146 147 If you’re using Homebrew, first run `brew unlink ddev` to get rid of the version you have there. Then use one of these options: 148 149 1. Download the version you want from the [releases page](https://github.com/drud/ddev/releases) and place it in your `$PATH`. 150 2. Use the [install_ddev.sh](https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh) script with the version number argument. For example, if you want v1.18.3-alpha1, run `curl -fsSL https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash -s v1.18.3-alpha1`. 151 3. On Debian/Ubuntu/WSL2 with DDEV installed via apt, you can run `sudo apt update && sudo apt install ddev=<version>`, for example `sudo apt install ddev=1.21.1`. 152 4. If you want the very latest, unreleased version of DDEV, run `brew unlink ddev && brew install drud/ddev/ddev --HEAD`. 153 154 ### How can I back up or restore all project databases? 155 156 You can back up all projects that show in `ddev list` with `ddev snapshot -a`. This _only_ snapshots projects displayed in `ddev list`; any projects not shown there will need to be started so they’re be registered in `ddev list`. 157 158 ### How can I share my local project with someone? 159 160 See [Sharing Your Project](../topics/sharing.md). 161 162 ### How do I make DDEV match my production environment? 163 164 You can change the major PHP version and choose between nginx+fpm (default) and Apache+fpm and choose the MariaDB/MySQL/PostgreSQL version add [extra services like Solr and Memcached](../extend/additional-services.md). You won’t be able to make every detail match your production server, but with database server type and version, PHP version and web server type you’ll be close. 165 166 ### How do I completely destroy a project? 167 168 Use [`ddev delete <project>`](../usage/commands.md#delete) to destroy a project. By default, a [`ddev snapshot`](../usage/commands.md#snapshot) of your database is taken, but you can skip this using `ddev delete --omit-snapshot` or `ddev delete --omit-snapshot -y`. See `ddev delete -h` for options. It’s up to you to then delete the code directory. 169 170 ### What if I don’t like the settings files or gitignores DDEV creates? 171 172 You have several options: 173 174 * Use the [`disable_settings_management: true`](../configuration/config.md#disable_settings_management) option in the project’s `.ddev/config.yaml` file. This disables DDEV from updating CMS-related settings files. 175 * Use the more generic “php” project type rather than a CMS-specific one; it basically means “don’t try to create settings files for me”. The “php” type works great for experienced developers. 176 * Take over the settings file or `.gitignore` by deleting the line `#ddev-generated` in it, then check in the file. If that line is removed, DDEV will not try to replace or change the file. 177 178 ### How can I change a project’s name? 179 180 Delete it and migrate it to a new project with your preferred name: 181 182 1. Export the project’s database: `ddev export-db --file=/path/to/db.sql.gz`. 183 2. Delete the project: `ddev delete <project>`. (This takes a snapshot by default for safety.) 184 3. Rename the project: `ddev config --project-name=<new_name>`. 185 4. Start thew new project with `ddev start`. 186 5. Import the database dump from step one: `ddev import-db --src=/path/to/db.sql.gz`. 187 188 ### How can I move a project to another directory? 189 190 Run [`ddev stop --unlist`](../usage/commands.md#stop), then move the directory, then run [`ddev start`](../usage/commands.md#start) in the new directory. 191 192 ### How can I move a project to another workstation? 193 194 Take a snapshot, move the project files, and restore the snapshot in a new project on the target workstation: 195 196 1. `ddev start && ddev snapshot`. 197 2. `ddev stop --unlist`. 198 3. Move the project directory to another computer any way you want. 199 4. On the new computer, run `ddev start && ddev snapshot restore --latest`. 200 5. Optionally, on the old computer, run `ddev delete --omit-snapshot` to remove its copy of the database. 201 202 ### How can I move a project from traditional Windows to WSL2? 203 204 This is exactly the same as moving a project from one computer to another described above. Make sure you move the project into a native filesystem in WSL2, most likely `/home`. 205 206 ### Why does DDEV want to edit `/etc/hosts`? 207 208 If you see “The hostname <hostname> is not currently resolvable” and you _can_ `ping <hostname>`, it may be that DNS resolution is slow. 209 210 DDEV doesn’t have control over your computer’s name resolution, so it doesn’t have any way to influence how your browser gets an IP address from a hostname. It knows you have to be connected to the internet to do that, and uses a test DNS lookup of `<somethingrandom>.ddev.site` as a way to guess whether you’re connected to the internet. If it’s unable to do a name lookup, or if the hostname associated with your project is not `*.ddev.site`, it will try to create entries in `/etc/hosts`, since it’s assuming you can’t look up your project’s hostname(s) via DNS. If your internet (and name resolution) is actually working, but DNS is slow, run `ddev config global --internet-detection-timeout-ms=3000` to set the timeout to 3 seconds (or higher). See [this GitHub issue](https://github.com/drud/ddev/issues/2409#issuecomment-662448025) for more. (If DNS rebinding is disallowed on your network/router, this won’t be solvable without network/router changes. Help [here](https://github.com/drud/ddev/issues/2409#issuecomment-675083658) and [here](https://github.com/drud/ddev/issues/2409#issuecomment-686718237).) For more detailed troubleshooting information, please see the [troubleshooting section](troubleshooting.md#ddev-starts-fine-but-my-browser-cant-access-the-url-url-server-ip-address-could-not-be-found-or-we-cant-connect-to-the-server-at-url). 211 212 ### How can I configure a project with the defaults without hitting <kbd>RETURN</kbd> a bunch of times? 213 214 Use `ddev config --auto` to set the docroot and project type based on the discovered code. 215 If anything in `.ddev/config.yaml` is wrong, you can edit that directly or use [`ddev config`](../usage/commands.md#config) commands to update settings. 216 217 ## Getting Involved 218 219 ### How do I get support? 220 221 See the [support options](../support.md), including [Discord](https://discord.gg/kDvSFBSZfs), [Stack Overflow](https://stackoverflow.com/questions/tagged/ddev) and the [issue queue](https://github.com/drud/ddev/issues). 222 223 ### How can I contribute to DDEV? 224 225 We love and welcome contributions of knowledge, support, docs, and code: 226 227 * Submit an issue or pull request to the [main repo](https://github.com/drud/ddev). 228 * Add your external resource to [awesome-ddev](https://github.com/drud/awesome-ddev). 229 * Add your recipe or HOWTO to [ddev-contrib](https://github.com/drud/ddev-contrib). 230 * Help others in [Discord](https://discord.gg/kDvSFBSZfs) and on [Stack Overflow](https://stackoverflow.com/tags/ddev). 231 * Contribute financially via [GitHub Sponsors](https://github.com/sponsors/rfay). 232 * Get involved with DDEV governance and the [Advisory Group](https://github.com/drud/ddev/discussions/categories/ddev-advisory-group). 233 234 ### How do financial contributions support DDEV? 235 236 Thanks for asking! Contributions made via [GitHub Sponsors](https://github.com/sponsors/rfay) go to the [Localdev Foundation](https://localdev.foundation) and are used for infrastructure and supporting development.