github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/docs/content/users/usage/commands.md (about)

     1  # Commands
     2  
     3  You can tell DDEV what to do by running its commands. This page details each of the available commands and their options, or flags.
     4  
     5  Run DDEV without any commands or flags to see this list in your terminal:
     6  
     7  ```
     8  →  ddev
     9  Create and maintain a local web development environment.
    10  Docs: https://ddev.readthedocs.io
    11  Support: https://ddev.readthedocs.io/en/stable/users/support
    12  
    13  Usage:
    14    ddev [command]
    15  
    16  Available Commands:
    17    auth             A collection of authentication commands
    18    blackfire        Enable or disable blackfire.io profiling (global shell web container command)
    19    clean            Removes items ddev has created
    20    composer         Executes a composer command within the web container
    21  ...
    22  ```
    23  
    24  Use [`ddev help`](#help) to learn more about a specific command, like this example for [`ddev describe`](#describe):
    25  
    26  ```
    27  →  ddev help describe
    28  Get a detailed description of a running ddev project. Describe provides basic
    29  information about a ddev project, including its name, location, url, and status.
    30  It also provides details for MySQL connections, and connection information for
    31  additional services like MailHog and phpMyAdmin. You can run 'ddev describe' from
    32  a project directory to describe that project, or you can specify a project to describe by
    33  running 'ddev describe <projectname>'.
    34  
    35  Usage:
    36    ddev describe [projectname] [flags]
    37  
    38  Aliases:
    39    describe, status, st, desc
    40  
    41  Examples:
    42  ddev describe
    43  ddev describe <projectname>
    44  ddev status
    45  ddev st
    46  
    47  Flags:
    48    -h, --help   help for describe
    49  
    50  Global Flags:
    51    -j, --json-output   If true, user-oriented output will be in JSON format.
    52  ```
    53  
    54  ## Global Flags
    55  
    56  Two flags are available for every command:
    57  
    58  * `--help` or `-h`: Outputs more information about a command rather than executing it.
    59  * `--json-output` or `-j`: Format user-oriented output in JSON.
    60  
    61  ---
    62  
    63  ## `auth`
    64  
    65  Authentication commands.
    66  
    67  ### `auth ssh`
    68  
    69  Add [SSH key authentication](../usage/cli.md#ssh-into-containers) to the `ddev-ssh-agent` container.
    70  
    71  Example:
    72  
    73  ```shell
    74  # Add your SSH keys to the SSH agent container
    75  ddev auth ssh
    76  ```
    77  
    78  Flags:
    79  
    80  * `--ssh-key-path`, `-d`: Full path to SSH key directory.
    81  
    82  ## `blackfire`
    83  
    84  Enable or disable [Blackfire profiling](../debugging-profiling/blackfire-profiling.md) (global shell web container command).
    85  
    86  ```shell
    87  # Display Blackfire profiling status
    88  ddev blackfire status
    89  
    90  # Start Blackfire profiling
    91  ddev blackfire on
    92  
    93  # Stop Blackfire profiling
    94  ddev blackfire off
    95  ```
    96  
    97  !!!tip
    98      There are synonyms for the `on` and `off` arguments that have the exact same effect:
    99  
   100      * `on`: `start`, `enable`, `true`
   101      * `off`: `stop`, `disable`, `false`
   102  
   103  ## `clean`
   104  
   105  Removes items DDEV has created. (See [Uninstalling DDEV](../usage/uninstall.md).)
   106  
   107  Flags:
   108  
   109  * `--all`, `-a`: Clean all DDEV projects.
   110  * `--dry-run`: Run the clean command without deleting.
   111  
   112  Example:
   113  
   114  ```shell
   115  # Preview cleaning all projects without actually removing anything
   116  ddev clean --dry-run --all
   117  
   118  # Clean all projects
   119  ddev clean --all
   120  
   121  # Clean my-project and my-other-project
   122  ddev clean my-project my-other-project
   123  ```
   124  
   125  ## `composer`
   126  
   127  Executes a [Composer command](../usage/developer-tools.md#ddev-and-composer) within the web container.
   128  
   129  Example:
   130  
   131  ```shell
   132  # Install Composer packages
   133  ddev composer install
   134  ```
   135  
   136  ## `config`
   137  
   138  Create or modify a DDEV project’s configuration in the current directory.
   139  
   140  !!!tip "You can also set these via YAML!"
   141      These settings, plus a few more, can be set by editing stored [Config Options](../configuration/config.md).
   142  
   143  Example:
   144  
   145  ```shell
   146  # Start interactive project configuration
   147  ddev config
   148  
   149  # Configure a Drupal 8 project with a `web` document root
   150  ddev config --docroot=web --project-type=drupal8
   151  
   152  # Switch the project’s default `nginx-fpm` to `apache-fpm`
   153  ddev config --webserver-type=apache-fpm
   154  ```
   155  
   156  Flags:
   157  
   158  * `--additional-fqdns`: Comma-delimited list of project FQDNs.
   159  * `--additional-hostnames`: Comma-delimited list of project hostnames.
   160  * `--auto`: Automatically run config without prompting. (default `true`)
   161  * `--bind-all-interfaces`: Bind host ports on all interfaces, not just on localhost network interface.
   162  * `--composer-root`: Overrides the default Composer root directory for the web service.
   163  * `--composer-root-default`: Unsets a web service Composer root directory override.
   164  * `--composer-version`: Specify override for Composer version in the web container. This may be `""`, `"1"`, `"2"`, `"2.2"`, `"stable"`, `"preview"`, `"snapshot"`, or a specific version.
   165  * `--create-docroot`: Create the docroot if it doesn’t exist.
   166  * `--database`: Specify the database type:version to use. Defaults to `mariadb:10.4`.
   167  * `--db-image`: Sets the db container image.
   168  * `--db-image-default`: Sets the default db container image for this DDEV version.
   169  * `--db-working-dir`: Overrides the default working directory for the db service.
   170  * `--db-working-dir-default`: Unsets a db service working directory override.
   171  * `--dba-image`: Sets the dba container image.
   172  * `--dba-image-default`: Sets the default dba container image for this DDEV version.
   173  * `--dba-working-dir`: Overrides the default working directory for the dba service.
   174  * `--dba-working-dir-default`: Unsets a dba service working directory override.
   175  * `--dbimage-extra-packages`: A comma-delimited list of Debian packages that should be added to db container when the project is started.
   176  * `--default-container-timeout`: Default time in seconds that DDEV waits for all containers to become ready on start. (default `120`)
   177  * `--disable-settings-management`: Prevent DDEV from creating or updating CMS settings files.
   178  * `--docroot`: Provide the relative docroot of the project, like `docroot` or `htdocs` or `web`. (defaults to empty, the current directory)
   179  * `--fail-on-hook-fail`: Decide whether `ddev start` should be interrupted by a failing hook.
   180  * `--host-db-port`: The db container’s localhost-bound port.
   181  * `--host-dba-port`: The dba (phpMyAdmin) container’s localhost-bound port, if exposed via bind-all-interfaces.
   182  * `--host-https-port`: The web container’s localhost-bound HTTPS port.
   183  * `--host-webserver-port`: The web container’s localhost-bound port.
   184  * `--http-port`: The router HTTP port for this project.
   185  * `--https-port`: The router HTTPS port for this project.
   186  * `--image-defaults`: Sets the default web, db, and dba container images.
   187  * `--mailhog-https-port`: Router port to be used for MailHog HTTPS access.
   188  * `--mailhog-port`: Router port to be used for MailHog HTTP access.
   189  * `--mutagen-enabled`: Enable Mutagen asynchronous update of project in web container.
   190  * `--nfs-mount-enabled`: Enable NFS mounting of project in container.
   191  * `--ngrok-args`: Provide extra args to ngrok in `ddev share`.
   192  * `--no-project-mount`: Whether or not to skip mounting project code into the web container.
   193  * `--nodejs-version`: Specify the Node.js version to use if you don’t want the default Node.js 16.
   194  * `--omit-containers`: Comma-delimited list of container types that should not be started when the project is started.
   195  * `--php-version`: PHP version that will be enabled in the web container.
   196  * `--phpmyadmin-https-port`: Router port to be used for phpMyAdmin (dba) HTTPS container access.
   197  * `--phpmyadmin-port`: Router port to be used forphpMyAdmin (dba) HTTP container access.
   198  * `--project-name`: Provide the project name of project to configure. (normally the same as the last part of directory name)
   199  * `--project-tld`: Set the top-level domain to be used for projects. (default `"ddev.site"`)
   200  * `--project-type`: Provide the project type: `backdrop`, `drupal10`, `drupal6`, `drupal7`, `drupal8`, `drupal9`, `laravel`, `magento`, `magento2`, `php`, `shopware6`, `typo3`, `wordpress`. This is autodetected and this flag is necessary only to override the detection.
   201  * `--show-config-location`: Output the location of the `config.yaml` file if it exists, or error that it doesn’t exist.
   202  * `--timezone`: Specify timezone for containers and PHP, like `Europe/London` or `America/Denver` or `GMT` or `UTC`.
   203  * `--upload-dir`: Sets the project’s upload directory, the destination directory of the import-files command.
   204  * `--use-dns-when-possible`: Use DNS for hostname resolution instead of `/etc/hosts` when possible. (default `true`)
   205  * `--web-environment`: Set the environment variables in the web container: `--web-environment="TYPO3_CONTEXT=Development,SOMEENV=someval"`
   206  * `--web-environment-add`: Append environment variables to the web container: `--web-environment="TYPO3_CONTEXT=Development,SOMEENV=someval"`
   207  * `--web-image`: Sets the web container image.
   208  * `--web-image-default`: Sets the default web container image for this DDEV version.
   209  * `--web-working-dir`: Overrides the default working directory for the web service.
   210  * `--web-working-dir-default`: Unsets a web service working directory override.
   211  * `--webimage-extra-packages`: A comma-delimited list of Debian packages that should be added to web container when the project is started.
   212  * `--webserver-type`: Sets the project’s desired webserver type: `nginx-fpm` or `apache-fpm`.
   213  * `--working-dir-defaults`: Unsets all service working directory overrides.
   214  * `--xdebug-enabled`: Whether or not Xdebug is enabled in the web container.
   215  
   216  ### `config global`
   217  
   218  Change global configuration.
   219  
   220  ```shell
   221  # Opt out of sharing anonymized usage information
   222  ddev config global --instrumentation-opt-in=false
   223  
   224  # Skip phpMyAdmin and the SSH agent for all projects
   225  ddev config global --omit-containers=dba,ddev-ssh-agent
   226  ```
   227  
   228  * `--auto-restart-containers`: If `true`, automatically restart containers after a reboot or Docker restart.
   229  * `--disable-http2`: Optionally disable http2 in `ddev-router`; `ddev config global --disable-http2` or `ddev config global --disable-http2=false`.
   230  * `--fail-on-hook-fail`: If true, `ddev start` will fail when a hook fails.
   231  * `--instrumentation-opt-in`: `instrumentation-opt-in=true`.
   232  * `--internet-detection-timeout-ms`: Increase timeout when checking internet timeout, in milliseconds. (default `3000`)
   233  * `--letsencrypt-email`: Email associated with Let’s Encrypt; `ddev global --letsencrypt-email=me@example.com`.
   234  * `--mutagen-enabled`: If `true`, web container will use Mutagen caching/asynchronous updates.
   235  * `--nfs-mount-enabled`: Enable NFS mounting on all projects globally.
   236  * `--no-bind-mounts`: If `true`, don’t use bind-mounts. Useful for environments like remote Docker where bind-mounts are impossible. (default `true`)
   237  * `--omit-containers`: For example, `--omit-containers=dba,ddev-ssh-agent`.
   238  * `--required-docker-compose-version`: Override default docker-compose version.
   239  * `--router-bind-all-interfaces`: `router-bind-all-interfaces=true`.
   240  * `--simple-formatting`: If `true`, use simple formatting and no color for tables.
   241  * `--table-style`: Table style for list and describe, see `~/.ddev/global_config.yaml` for values.
   242  * `--use-docker-compose-from-path`: If `true`, use docker-compose from path instead of private `~/.ddev/bin/docker-compose`. (default `true`)
   243  * `--use-hardened-images`: If `true`, use more secure 'hardened' images for an actual internet deployment.
   244  * `--use-letsencrypt`: Enables experimental Let’s Encrypt integration; `ddev global --use-letsencrypt` or `ddev global --use-letsencrypt=false`.
   245  * `--web-environment`: Set the environment variables in the web container: `--web-environment="TYPO3_CONTEXT=Development,SOMEENV=someval"`
   246  * `--web-environment-add`: Append environment variables to the web container: `--web-environment="TYPO3_CONTEXT=Development,SOMEENV=someval"`
   247  
   248  ## `craft`
   249  
   250  Run a [Craft CMS command](https://craftcms.com/docs/4.x/console-commands.html) inside the web container (global shell web container command).
   251  
   252  Example:
   253  
   254  ```shell
   255  # Run pending Craft migrations and apply pending project config changes
   256  ddev craft up
   257  ```
   258  
   259  ## `debug`
   260  
   261  *Aliases: `d`, `dbg`.*
   262  
   263  A collection of debugging commands, often useful for [troubleshooting](troubleshooting.md).
   264  
   265  ### `debug capabilities`
   266  
   267  Show capabilities of this version of DDEV.
   268  
   269  Example:
   270  
   271  ```shell
   272  # List capabilities of the current project
   273  ddev debug capabilities
   274  
   275  # List capabilities of `my-project`
   276  ddev debug capabilities my-project
   277  ```
   278  
   279  ### `debug check-db-match`
   280  
   281  Verify that the database in the db server matches the configured [type and version](../extend/database-types.md).
   282  
   283  Example:
   284  
   285  ```shell
   286  # Check whether project’s running database matches configuration
   287  ddev debug check-db-match
   288  ```
   289  
   290  ### `debug compose-config`
   291  
   292  Prints the current project’s docker-compose configuration.
   293  
   294  Example:
   295  
   296  ```shell
   297  # Print docker-compose config for the current project
   298  ddev debug compose-config
   299  
   300  # Print docker-compose config for `my-project`
   301  ddev debug compose-config my-project
   302  ```
   303  
   304  ### `debug configyaml`
   305  
   306  Prints the project [`config.*.yaml`](../configuration/config.md) usage.
   307  
   308  Example:
   309  
   310  ```shell
   311  # Print config for the current project
   312  ddev debug configyaml
   313  
   314  # Print config specifically for `my-project`
   315  ddev debug configyaml my-project
   316  ```
   317  
   318  ### `debug dockercheck`
   319  
   320  Diagnose DDEV Docker/Colima setup.
   321  
   322  Example:
   323  
   324  ```shell
   325  # Output contextual details for the Docker provider
   326  ddev debug dockercheck
   327  ```
   328  
   329  ### `debug download-images`
   330  
   331  Download all images required by DDEV.
   332  
   333  Example:
   334  
   335  ```shell
   336  # Download DDEV’s Docker images
   337  ddev debug download-images
   338  ```
   339  
   340  ### `debug fix-commands`
   341  
   342  Refreshes [custom command](../extend/custom-commands.md) definitions without running [`ddev start`](#start).
   343  
   344  Example:
   345  
   346  ```shell
   347  # Refresh the current project’s custom commands
   348  ddev debug fix-commands
   349  ```
   350  
   351  ### `debug get-volume-db-version`
   352  
   353  Get the database type and version found in the `ddev-dbserver` database volume, which may not be the same as the configured database [type and version](../extend/database-types.md).
   354  
   355  Example:
   356  
   357  ```shell
   358  # Print the database volume’s engine and version
   359  ddev debug get-volume-db-version
   360  ```
   361  
   362  ### `debug migrate-database`
   363  
   364  Migrate a MySQL or MariaDB database to a different `dbtype:dbversion`. Works only with MySQL and MariaDB, not with PostgreSQL.
   365  
   366  Example:
   367  
   368  ```shell
   369  # Migrate the current project’s database to MariaDB 10.7
   370  ddev debug migrate-database mariadb:10.7
   371  ```
   372  
   373  ### `debug mutagen`
   374  
   375  Allows access to any [Mutagen command](https://mutagen.io/documentation/introduction).
   376  
   377  Example:
   378  
   379  ```shell
   380  # Run Mutagen’s `sync list` command
   381  ddev debug mutagen sync list
   382  ```
   383  
   384  ### `debug nfsmount`
   385  
   386  Checks to see if [NFS mounting](../install/performance.md#nfs) works for current project.
   387  
   388  Example:
   389  
   390  ```shell
   391  # See if NFS is working as expected for the current project
   392  ddev debug nfsmount
   393  ```
   394  
   395  ### `debug refresh`
   396  
   397  Refreshes the project’s Docker cache.
   398  
   399  Example:
   400  
   401  ```shell
   402  # Refresh the current project’s Docker cache
   403  ddev debug refresh
   404  ```
   405  
   406  ### `debug router-nginx-config`
   407  
   408  Prints the router’s [nginx config](../extend/customization-extendibility.md#custom-nginx-configuration).
   409  
   410  Example:
   411  
   412  ```shell
   413  # Output router nginx configuration
   414  ddev debug router-nginx-config
   415  ```
   416  
   417  ### `debug test`
   418  
   419  Run diagnostics using the embedded [test script](https://github.com/drud/ddev/blob/master/cmd/ddev/cmd/scripts/test_ddev.sh).
   420  
   421  Example:
   422  
   423  ```shell
   424  # Run DDEV’s diagnostic suite
   425  ddev debug test
   426  ```
   427  
   428  ## `delete`
   429  
   430  Remove all information, including the database, for an existing project.
   431  
   432  Flags:
   433  
   434  * `--all`, `-a`: Delete all projects.
   435  * `--clean-containers`: Clean up all DDEV docker containers not required by this version of DDEV. (default true)
   436  * `--omit-snapshot`, `-O`: Omit/skip database snapshot.
   437  * `--yes`, `-y`: Skip confirmation prompt.
   438  
   439  Example:
   440  
   441  ```shell
   442  # Delete my-project and my-other-project
   443  ddev delete my-project my-other-project
   444  
   445  # Delete the current project without taking a snapshot or confirming
   446  ddev delete --omit-snapshot --yes
   447  ```
   448  
   449  ### `delete images`
   450  
   451  With `--all`, it deletes all `drud/ddev-*` Docker images.
   452  
   453  Flags:
   454  
   455  * `--all`, `-a`: If set, deletes all Docker images created by DDEV.
   456  * `--yes`, `-y`: Skip confirmation prompt.
   457  
   458  Example:
   459  
   460  ```shell
   461  # Delete images
   462  ddev delete images
   463  
   464  # Delete images and skip confirmation
   465  ddev delete images -y
   466  
   467  # Delete all DDEV-created images
   468  ddev delete images --all
   469  ```
   470  
   471  ## `describe`
   472  
   473  *Aliases: `status`, `st`, `desc`.*
   474  
   475  Get a detailed description of a running DDEV project.
   476  
   477  Example:
   478  
   479  ```shell
   480  # Display details for the current project
   481  ddev describe
   482  
   483  # Display details for my-project
   484  ddev describe my-project
   485  ```
   486  
   487  ## `exec`
   488  
   489  *Alias: `.`.*
   490  
   491  [Execute a shell command in the container](../usage/cli.md#executing-commands-in-containers) for a service. Uses the web service by default.
   492  
   493  To run your command in a different service container, run `ddev exec --service <service> <cmd>`. Use the `--raw` flag if you’d like to run a raw, uninterpreted command in a container.
   494  
   495  Flags:
   496  
   497  * `--dir`, `-d`: Defines the execution directory within the container.
   498  * `--raw`: Use raw exec (do not interpret with Bash inside container). (default `true`)
   499  * `--service`, `-s`: Defines the service to connect to. (e.g. `web`, `db`) (default `"web"`)
   500  
   501  Example:
   502  
   503  ```shell
   504  # List the web container’s docroot contents
   505  ddev exec ls /var/www/html
   506  
   507  # List the web container’s vendor directory contents
   508  ddev exec --dir /var/www/html/vendor ls
   509  
   510  # Output a long, recursive list of the files in the web container
   511  ddev exec --raw -- ls -lR
   512  
   513  # Say “hi” from the phpMyAdmin container
   514  ddev exec --service dba echo hi
   515  ```
   516  
   517  ## `export-db`
   518  
   519  Dump a database to a file or to stdout.
   520  
   521  Flags:
   522  
   523  * `--bzip2`: Use bzip2 compression.
   524  * `--file`, `-f`: Provide the path to output the dump.
   525  * `--gzip`, `-z`: Use gzip compression. (default `true`)
   526  * `--target-db`, `-d`: If provided, target-db is alternate database to export. (default `"db"`)
   527  * `--xz`: Use xz compression.
   528  
   529  Example:
   530  
   531  ```shell
   532  # Dump and compress the current project’s database to `/tmp/db.sql.gz`
   533  ddev export-db --file=/tmp/db.sql.gz
   534  
   535  # Dump the current project’s database, without compressing it, to `/tmp/db.sql`
   536  ddev export-db --gzip=false --file /tmp/db.sql
   537  
   538  # Dump and compress the current project’s `foo` database instead of `db`
   539  ddev export-db --target-db=foo --file=/tmp/db.sql.gz
   540  
   541  # Output the current project’s database and use `>` to write to `/tmp/db.sql.gz`
   542  ddev export-db > /tmp/db.sql.gz
   543  
   544  # Dump my-project’s database, without compressing it, to `/tmp/my-project.sql`
   545  ddev export-db my-project --gzip=false --file=/tmp/my-project.sql
   546  ```
   547  
   548  ## `get`
   549  
   550  Download an [add-on](../extend/additional-services.md) (service, provider, etc.).
   551  
   552  Flags:
   553  
   554  * `--all`: List unofficial *and* official add-ons. (default `true`)
   555  * `--list`: List official add-ons. (default `true`)
   556  * `--verbose`, `-v`: Output verbose error information with Bash `set -x` (default `false`)
   557  
   558  Example:
   559  
   560  ```shell
   561  # List official add-ons
   562  ddev get --list
   563  
   564  # List official and third-party add-ons
   565  ddev get --list --all
   566  
   567  # Download the official Redis add-on
   568  ddev get drud/ddev-redis
   569  
   570  # Get debug info about `ddev get` failure
   571  ddev get drud/ddev-redis --verbose
   572  
   573  # Download the Drupal 9 Solr add-on from its v0.0.5 release tarball
   574  ddev get https://github.com/drud/ddev-drupal9-solr/archive/refs/tags/v0.0.5.tar.gz
   575  
   576  # Copy an add-on available in another directory
   577  ddev get /path/to/package
   578  
   579  # Copy an add-on from a tarball in another directory
   580  ddev get /path/to/tarball.tar.gz
   581  ```
   582  
   583  ## `heidisql`
   584  
   585  Open [HeidiSQL](https://www.heidisql.com/) with the current project’s database (global shell host container command). This command is only available if `TablePlus.app` is installed as `C:\Program Files\HeidiSQL\Heidisql.exe`.
   586  
   587  Example:
   588  
   589  ```shell
   590  # Open the current project’s database in HeidiSQL
   591  ddev heidisql
   592  ```
   593  
   594  ## `help`
   595  
   596  Help about any command.
   597  
   598  Example:
   599  
   600  ```shell
   601  # Illuminate the virtues of the `describe` command
   602  ddev help describe
   603  ```
   604  
   605  ## `hostname`
   606  
   607  Manage your hostfile entries.
   608  
   609  Flags:
   610  
   611  * `--remove`, `-r`: Remove the provided host name - ip correlation.
   612  * `--remove-inactive`, `-R`: Remove host names of inactive projects.
   613  
   614  Example:
   615  
   616  ```shell
   617  ddev hostname somesite.ddev.local 127.0.0.1
   618  ```
   619  
   620  ## `import-db`
   621  
   622  [Import a SQL file](database-management.md) into the project.
   623  
   624  Flags:
   625  
   626  * `--extract-path`: If provided asset is an archive, provide the path to extract within the archive.
   627  * `--no-drop`: Set if you do NOT want to drop the db before importing.
   628  * `--progress`, `-p`: Display a progress bar during import. (default `true`)
   629  * `--src`, `-f`: Provide the path to a SQL dump in `.sql`, `.tar`, `.tar.gz`, `.tgz`, `.bz2`, `.xx`, or `.zip` format.
   630  * `--target-db`, `-d`: If provided, target-db is alternate database to import into. (default `"db"`)
   631  
   632  Example:
   633  
   634  ```shell
   635  # Start the interactive import utility
   636  ddev import-db
   637  
   638  # Import the `.tarballs/db.sql` dump to the project database
   639  ddev import-db --src=.tarballs/db.sql
   640  
   641  # Import the compressed `.tarballs/db.sql.gz` dump to the project database
   642  ddev import-db --src=.tarballs/db.sql.gz
   643  
   644  # Import the compressed `.tarballs/db.sql.gz` dump to a `newdb` database
   645  ddev import-db --target-db=newdb --src=.tarballs/db.sql.gz
   646  
   647  # Import the `db.sql` dump to the project database
   648  ddev import-db <db.sql
   649  
   650  # Import the `db.sql` dump to a `newdb` database
   651  ddev import-db newdb <db.sql
   652  
   653  # Uncompress `db.sql.gz` and pipe the result to the `import-db` command
   654  gzip -dc db.sql.gz | ddev import-db
   655  ```
   656  
   657  ## `import-files`
   658  
   659  Pull the uploaded files directory of an existing project to the default [public upload directory](../usage/cli.md#ddev-import-files) of your project.
   660  
   661  Flags:
   662  
   663  * `--extract-path`: If provided asset is an archive, optionally provide the path to extract within the archive.
   664  * `--src`: Provide the path to the source directory or archive to import. (Archive can be `.tar`, `.tar.gz`, `.tar.xz`, `.tar.bz2`, `.tgz`, or `.zip`.)
   665  
   666  Example:
   667  
   668  ```shell
   669  # Extract+import `/path/to/files.tar.gz` to the project’s upload directory
   670  ddev import-files --src=/path/to/files.tar.gz
   671  
   672  # Import `/path/to/dir` contents to the project’s upload directory
   673  ddev import-files --src=/path/to/dir
   674  ```
   675  
   676  ## `launch`
   677  
   678  Launch a browser with the current site (global shell host container command).
   679  
   680  Flags:
   681  
   682  * `--phpmyadmin`, `-p`: Open phpMyAdmin.
   683  * `--mailhog`, `-m`: Open MailHog.
   684  
   685  Example:
   686  
   687  ```shell
   688  # Open your project’s base URL in the default browser
   689  ddev launch
   690  
   691  # Open MailHog in the default browser
   692  ddev launch --mailhog
   693  
   694  # Open your project’s base URL appended with `temp/phpinfo.php`
   695  ddev launch temp/phpinfo.php
   696  ```
   697  
   698  ## `list`
   699  
   700  *Aliases: `l`, `ls`.*
   701  
   702  List projects.
   703  
   704  Flags:
   705  
   706  * `--active-only`, `-A`: If set, only currently active projects will be displayed.
   707  * `--continuous`: If set, project information will be emitted until the command is stopped.
   708  * `--continuous-sleep-interval`, `-I`: Time in seconds between `ddev list --continuous` output lists. (default `1`)
   709  * `--wrap-table`, `-W`: Display table with wrapped text if required.
   710  
   711  Example:
   712  
   713  ```shell
   714  # List all projects
   715  ddev list
   716  
   717  # List all running projects
   718  ddev list --active-only
   719  ```
   720  
   721  ## `logs`
   722  
   723  Get the logs from your running services.
   724  
   725  Flags:
   726  
   727  * `--follow`, `-f`: Follow the logs in real time.
   728  * `--service`, `-s`: Defines the service to retrieve logs from (e.g. `web`, `db`). (default `"web"`)
   729  * `--tail`: How many lines to show.
   730  * `--time`, `-t`: Add timestamps to logs.
   731  
   732  Example:
   733  
   734  ```shell
   735  # Display recent logs from the current project’s web server
   736  ddev logs
   737  
   738  # Stream logs from the current project’s web server in real time
   739  ddev logs -f
   740  
   741  # Display recent logs from the current project’s database server
   742  ddev logs -s db
   743  
   744  # Display recent logs from my-project’s database server
   745  ddev logs -s db my-project
   746  ```
   747  
   748  ## `mutagen`
   749  
   750  Commands for [Mutagen](../install/performance.md#mutagen) status and sync, etc.
   751  
   752  ### `mutagen logs`
   753  
   754  Show Mutagen logs for debugging.
   755  
   756  Flags:
   757  
   758  * `--verbose`: Show full Mutagen logs.
   759  
   760  Example:
   761  
   762  ```shell
   763  # Stream Mutagen’s logs in real time
   764  ddev mutagen logs
   765  
   766  # Stream Mutagen’s more detailed logs in real time
   767  ddev mutagen logs --verbose
   768  ```
   769  
   770  ### `mutagen monitor`
   771  
   772  Monitor Mutagen status.
   773  
   774  Example:
   775  
   776  ```shell
   777  # Start Mutagen’s sync process and monitor its status in real time
   778  ddev mutagen sync && ddev mutagen monitor
   779  ```
   780  
   781  ### `mutagen reset`
   782  
   783  Stops a project and removes the Mutagen Docker volume.
   784  
   785  ```shell
   786  # Reset Mutagen data for the current project
   787  ddev mutagen reset
   788  
   789  # Reset Mutagen data for my-project
   790  ddev mutagen reset my-project
   791  ```
   792  
   793  ### `mutagen status`
   794  
   795  Shows Mutagen sync status.
   796  
   797  Flags:
   798  
   799  * `--verbose`, `-l`: Extended/verbose output for Mutagen status.
   800  
   801  Example:
   802  
   803  ```shell
   804  # Display Mutagen sync status for the current project
   805  ddev mutagen status
   806  
   807  # Display Mutagen sync status for my-project
   808  ddev mutagen status my-project
   809  ```
   810  
   811  ### `mutagen sync`
   812  
   813  Explicit sync for Mutagen.
   814  
   815  Flags:
   816  
   817  * `--verbose`: Extended/verbose output for Mutagen status.
   818  
   819  Example:
   820  
   821  ```shell
   822  # Initiate Mutagen sync for the current project
   823  ddev mutagen sync
   824  
   825  # Initiate Mutagen sync for my-project
   826  ddev mutagen sync my-project
   827  ```
   828  
   829  ## `mysql`
   830  
   831  Run MySQL client in the database container (global shell db container command).
   832  
   833  Example:
   834  
   835  ```shell
   836  # Run the database container’s MySQL client
   837  ddev mysql
   838  
   839  # Run the database container’s MySQL client as root user
   840  ddev mysql -uroot -proot
   841  
   842  # Pipe the `SHOW TABLES;` command to the MySQL client to see a list of tables
   843  echo 'SHOW TABLES;' | ddev mysql
   844  ```
   845  
   846  ## `npm`
   847  
   848  Run [`npm`](https://docs.npmjs.com/cli/v9/commands/npm) inside the web container (global shell web container command).
   849  
   850  Example:
   851  
   852  ```shell
   853  # Install JavaScript packages using `npm`
   854  ddev npm install
   855  
   856  # Update JavaScript packages using `npm`
   857  ddev npm update
   858  ```
   859  
   860  ## `nvm`
   861  
   862  Run [`nvm`](https://github.com/nvm-sh/nvm#usage) inside the web container (global shell web container command).
   863  
   864  Example:
   865  
   866  ```shell
   867  # Use `nvm` to switch to Node.js v18
   868  ddev nvm install 18
   869  ```
   870  
   871  ## `pause`
   872  
   873  *Aliases: `sc`, `stop-containers`.*
   874  
   875  Uses `docker stop` to pause/stop the containers belonging to a project.
   876  
   877  !!!tip
   878      This leaves the containers instantiated instead of removing them like [`ddev stop`](#stop) does.
   879  
   880  Flags:
   881  
   882  * `--all`, `-a`: Pause all running projects.
   883  
   884  Example:
   885  
   886  ```shell
   887  # Pause the current project’s containers
   888  ddev pause
   889  
   890  # Pause my-project’s containers
   891  ddev pause my-project
   892  
   893  # Pause all projects
   894  ddev pause --all
   895  ```
   896  
   897  ## `php`
   898  
   899  Run `php` inside the web container (global shell web container command).
   900  
   901  Example:
   902  
   903  ```shell
   904  # Output the web container’s PHP version
   905  ddev php --version
   906  ```
   907  
   908  ## `poweroff`
   909  
   910  *Alias: `powerdown`.*
   911  
   912  Completely stop all projects and containers.
   913  
   914  !!!tip
   915      This is the equivalent of running `ddev stop -a --stop-ssh-agent`.
   916  
   917  Example:
   918  
   919  ```shell
   920  # Stop all projects and containers
   921  ddev poweroff
   922  ```
   923  
   924  ## `pull`
   925  
   926  Pull files and database using a configured [provider plugin](./../providers/index.md).
   927  
   928  Flags:
   929  
   930  * `--skip-confirmation`, `-y`: Skip confirmation step.
   931  * `--skip-db`: Skip pulling database archive.
   932  * `--skip-files`: Skip pulling file archive.
   933  * `--skip-import`: Download archive(s) without importing than.
   934  
   935  Example:
   936  
   937  ```shell
   938  # Pull a backup from the configured Pantheon project to use locally
   939  ddev pull pantheon
   940  
   941  # Pull a backup from the configured Platform.sh project to use locally
   942  ddev pull platform
   943  
   944  # Pull a backup from the configured Pantheon project without confirming
   945  ddev pull pantheon -y
   946  
   947  # Pull the Platform.sh database archive *only* without confirming
   948  ddev pull platform --skip-files -y
   949  
   950  # Pull the localfile integration’s files *only* without confirming
   951  ddev pull localfile --skip-db -y
   952  ```
   953  
   954  ## `push`
   955  
   956  Push files and database using a configured [provider plugin](./../providers/index.md).
   957  
   958  Example:
   959  
   960  ```shell
   961  # Push local files and database to the configured Pantheon project
   962  ddev push pantheon
   963  
   964  # Push local files and database to the configured Platform.sh project
   965  ddev push platform
   966  
   967  # Push files and database to Pantheon without confirming
   968  ddev push pantheon -y
   969  
   970  # Push database only to Platform.sh without confirming
   971  ddev push platform --skip-files -y
   972  
   973  # Push files only to Acquia without confirming
   974  ddev push acquia --skip-db -y
   975  ```
   976  
   977  ## `querious`
   978  
   979  Open [Querious](https://www.araelium.com/querious) with the current project’s MariaDB or MySQL database (global shell host container command). This is only available if `Querious.app` is installed as `/Applications/Querious.app`, and only for projects with `mysql` or `mariadb` databases.
   980  
   981  Example:
   982  
   983  ```shell
   984  # Open the current project’s database in Querious
   985  ddev querious
   986  ```
   987  
   988  ## `restart`
   989  
   990  Restart one or several projects.
   991  
   992  Flags:
   993  
   994  * `--all`, `-a`: Restart all projects.
   995  
   996  Example:
   997  
   998  ```shell
   999  # Restart the current project
  1000  ddev restart
  1001  
  1002  # Restart my-project and my-other-project
  1003  ddev restart my-project my-other-project
  1004  
  1005  # Restart all projects
  1006  ddev restart --all
  1007  ```
  1008  
  1009  ## `self-upgrade`
  1010  
  1011  Output instructions for updating or upgrading DDEV. The command doesn’t perform the upgrade, but tries to provide instructions relevant to your installation. Must be executed from the project context.
  1012  
  1013  Example:
  1014  
  1015  ```
  1016  →  ddev self-upgrade
  1017  
  1018  DDEV appears to have been installed with install_ddev.sh, you can run that script again to update.
  1019  curl -fsSL https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash
  1020  ```
  1021  
  1022  ## `sequelace`
  1023  
  1024  Open [SequelAce](https://sequel-ace.com/) with the current project’s database (global shell host container command). This command is only available if `Sequel Ace.app` is installed as `/Applications/Sequel ace.app`, and only for projects with `mysql` or `mariadb` databases.
  1025  
  1026  Example:
  1027  
  1028  ```shell
  1029  # Open the current project’s database in SequelAce
  1030  ddev sequelace
  1031  ```
  1032  
  1033  ## `sequelpro`
  1034  
  1035  Open [SequelPro](https://www.sequelpro.com/) with the current project’s database (global shell host container command). This command is only available if `Sequel Pro.app` is installed as `/Applications/Sequel pro.app`, and only for projects with `mysql` or `mariadb` databases.  *Note that Sequel Pro is considered abandoned, does not work with `mysql:8.0`; other solutions like Sequel Ace, Querious, Tableplus are preferred.
  1036  
  1037  Example:
  1038  
  1039  ```shell
  1040  # Open the current project’s database in SequelPro
  1041  ddev sequelpro
  1042  ```
  1043  
  1044  ## `service`
  1045  
  1046  Add or remove, enable or disable [extra services](../extend/additional-services.md).
  1047  
  1048  ### `service disable`
  1049  
  1050  Disable a service.
  1051  
  1052  Example:
  1053  
  1054  ```shell
  1055  # Disable the Solr service
  1056  ddev service disable solr
  1057  ```
  1058  
  1059  ### `service enable`
  1060  
  1061  Enable a service.
  1062  
  1063  Example:
  1064  
  1065  ```shell
  1066  # Enable the Solr service
  1067  ddev service enable solr
  1068  ```
  1069  
  1070  ## `share`
  1071  
  1072  [Share the current project](../topics/sharing.md) on the internet via [ngrok](https://ngrok.com).
  1073  
  1074  !!!tip
  1075      Some ngrok arguments are supported via CLI, but *any* ngrok flag can be specified in the [`ngrok_args` config setting](../configuration/config.md#ngrok_args).
  1076  
  1077  Flags:
  1078  
  1079  * `--subdomain`: Subdomain to use with paid ngrok account.
  1080  
  1081  Example:
  1082  
  1083  ```shell
  1084  # Share the current project with ngrok
  1085  ddev share
  1086  
  1087  # Share the current project with ngrok, using subdomain `foo.*`
  1088  ddev share --subdomain foo
  1089  
  1090  # Share the current project using ngrok’s basic-auth argument
  1091  ddev share --basic-auth username:pass1234
  1092  
  1093  # Share my-project with ngrok
  1094  ddev share my-project
  1095  ```
  1096  
  1097  ## `snapshot`
  1098  
  1099  Create a database snapshot for one or more projects.
  1100  
  1101  This uses `xtrabackup` or `mariabackup` to create a database snapshot in the `.ddev/db_snapshots` directory. These are compatible with server backups using the same tools and can be restored with the [`snapshot restore`](#snapshot-restore) command.
  1102  
  1103  See [Snapshotting and Restoring a Database](../usage/cli.md#snapshotting-and-restoring-a-database) for more detail, or [Database Management](../usage/database-management.md) for more on working with databases in general.
  1104  
  1105  Flags:
  1106  
  1107  * `--all`, `-a`: Snapshot all projects. (Will start stopped or paused projects.)
  1108  * `--cleanup`, `-C`: Cleanup snapshots.
  1109  * `--list`, `-l`: List snapshots.
  1110  * `--name`, `-n`: Provide a name for the snapshot.
  1111  * `--yes`, `-y`: Skip confirmation prompt.
  1112  
  1113  Example:
  1114  
  1115  ```shell
  1116  # Take a database snapshot for the current project
  1117  ddev snapshot
  1118  
  1119  # Take a database snapshot for the current project, named `my_snapshot_name`
  1120  ddev snapshot --name my_snapshot_name
  1121  
  1122  # Take a snapshot for the current project, cleaning up existing snapshots
  1123  ddev snapshot --cleanup
  1124  
  1125  # Take a snapshot for the current project, cleaning existing snapshots and skipping prompt
  1126  ddev snapshot --cleanup -y
  1127  
  1128  # List the current project’s snapshots
  1129  ddev snapshot --list
  1130  
  1131  # Take a snapshot for each project
  1132  ddev snapshot --all
  1133  ```
  1134  
  1135  ### `snapshot restore`
  1136  
  1137  Restores a database snapshot from the `.ddev/db_snapshots` directory.
  1138  
  1139  Flags:
  1140  
  1141  * `--latest`: Use the latest snapshot.
  1142  
  1143  Example:
  1144  
  1145  ```shell
  1146  # Restore the most recent snapshot
  1147  ddev snapshot restore --latest
  1148  
  1149  # Restore the previously-taken `my_snapshot_name` snapshot
  1150  ddev snapshot restore my_snapshot_name
  1151  ```
  1152  
  1153  ## `ssh`
  1154  
  1155  Starts a shell session in a service container. Uses the web service by default.
  1156  
  1157  Flags:
  1158  
  1159  * `--dir`, `-d`: Defines the destination directory within the container.
  1160  * `--service`, `-s`: Defines the service to connect to. (default `"web"`)
  1161  
  1162  Example:
  1163  
  1164  ```shell
  1165  # SSH into the current project’s web container
  1166  ddev ssh
  1167  
  1168  # SSH into the current project’s database container
  1169  ddev ssh -s db
  1170  
  1171  # SSH into the web container for my-project
  1172  ddev ssh my-project
  1173  
  1174  # SSH into the docroot of the current project’s web container
  1175  ddev ssh -d /var/www/html
  1176  ```
  1177  
  1178  ## `start`
  1179  
  1180  Start a DDEV project.
  1181  
  1182  Flags:
  1183  
  1184  * `--all`, `-a`: Start all projects.
  1185  * `--select`, `-s`: Interactively select a project to start.
  1186  * `--skip-confirmation`, `-y`: Skip any confirmation steps.
  1187  
  1188  Example:
  1189  
  1190  ```shell
  1191  # Start the current project
  1192  ddev start
  1193  
  1194  # Start my-project and my-other-project
  1195  ddev start my-project my-other-project
  1196  
  1197  # Start all projects
  1198  ddev start --all
  1199  ```
  1200  
  1201  ## `stop`
  1202  
  1203  *Aliases: `rm`, `remove`.*
  1204  
  1205  Stop and remove the containers of a project. Does not lose or harm anything unless you add `--remove-data`.
  1206  
  1207  Flags:
  1208  
  1209  * `--all`, `-a`: Stop and remove all running or container-stopped projects and remove from global projects list.
  1210  * `--omit-snapshot`, `-O`: Omit/skip database snapshot.
  1211  * `--remove-data`, `-R`: Remove stored project data (MySQL, logs, etc.).
  1212  * `--select`, `-s`: Interactively select a project to stop.
  1213  * `--snapshot`, `-S`: Create database snapshot.
  1214  * `--stop-ssh-agent`: Stop the `ddev-ssh-agent` container.
  1215  * `--unlist`, `-U`: Remove the project from global project list, so it won’t appear in [`ddev list`](#list) until started again.
  1216  
  1217  Example:
  1218  
  1219  ```shell
  1220  # Stop the current project
  1221  ddev stop
  1222  
  1223  # Stop my-project, my-other-project, and my-third-project
  1224  ddev stop my-project my-other-project my-third-project
  1225  
  1226  # Stop all projects
  1227  ddev stop --all
  1228  
  1229  # Stop all projects and the `ddev-ssh-agent` container
  1230  ddev stop --all --stop-ssh-agent
  1231  
  1232  # Stop all projects and remove their data
  1233  ddev stop --remove-data
  1234  ```
  1235  
  1236  ## `tableplus`
  1237  
  1238  Open [TablePlus](https://tableplus.com) with the current project’s database (global shell host container command). This command is only available if `TablePlus.app` is installed as `/Applications/TablePlus.app`.
  1239  
  1240  Example:
  1241  
  1242  ```shell
  1243  # Open the current project’s database in TablePlus
  1244  ddev tableplus
  1245  ```
  1246  
  1247  ## `version`
  1248  
  1249  Print DDEV and component versions.
  1250  
  1251  Example:
  1252  
  1253  ```shell
  1254  # Print DDEV and platform version details
  1255  ddev version
  1256  ```
  1257  
  1258  ## `xdebug`
  1259  
  1260  Enable or disable [Xdebug](../debugging-profiling/step-debugging.md) (global shell web container command).
  1261  
  1262  * The `on` argument is equivalent to `enable` and `true`.
  1263  * The `off` argument is equivalent to `disable` and `false`.
  1264  
  1265  ```shell
  1266  # Display whether Xdebug is running
  1267  ddev xdebug status
  1268  
  1269  # Turn Xdebug on
  1270  ddev xdebug
  1271  
  1272  # Turn Xdebug on
  1273  ddev xdebug on
  1274  
  1275  # Turn Xdebug off
  1276  ddev xdebug off
  1277  ```
  1278  
  1279  ## `xhprof`
  1280  
  1281  Enable or disable [Xhprof](../debugging-profiling/xhprof-profiling.md) (global shell web container command).
  1282  
  1283  * The `on` argument is equivalent to `enable` and `true`.
  1284  * The `off` argument is equivalent to `disable` and `false`.
  1285  
  1286  ```shell
  1287  # Display whether Xhprof is running
  1288  ddev xhprof status
  1289  
  1290  # Turn Xhprof on
  1291  ddev xhprof
  1292  
  1293  # Turn Xhprof on
  1294  ddev xhprof on
  1295  
  1296  # Turn Xhprof off
  1297  ddev xhprof off
  1298  ```
  1299  
  1300  ## `yarn`
  1301  
  1302  Run [`yarn` commands](https://yarnpkg.com/getting-started/migration#cli-commands) inside the web container in the root of the project (global shell host container command).
  1303  
  1304  !!!tip
  1305      Use `--cwd` for another directory.
  1306  
  1307  Example:
  1308  
  1309  ```shell
  1310  # Use Yarn to install JavaScript packages
  1311  ddev yarn install
  1312  
  1313  # Use Yarn to add the Lerna package
  1314  ddev yarn add lerna
  1315  
  1316  # Use Yarn to add the Lerna package from the `web/core` directory
  1317  ddev yarn --cwd web/core add lerna
  1318  ```