2 3. Site Management
René Kreijveld edited this page 2026-05-31 08:43:28 +02:00

Site Management

jaddsite

Create a new DDEV Joomla project.

Usage

jaddsite -n <sitename> [-p <php_version>] [-w <webserver>] [-j] [-a] [-v] [-s] [-h]

Options

Option Description
-n <sitename> The website name (no spaces). Required.
-p <php_version> PHP version to use (default: 8.4)
-w <webserver> Webserver type: nginx or apache (default: from config)
-j Download and install the latest Joomla automatically
-a Add Adminer (MariaDB database management) to the project (optional)
-v Verbose - show all DDEV output
-s Silent - suppress all messages
-h Display help

What it does

  1. Creates a site directory under ROOTFOLDER/<sitename>
  2. Runs ddev config with the specified PHP version and webserver
  3. Creates .ddev/php/joomla.ini with display_errors = off and output_buffering = off
  4. Starts the DDEV project
  5. If Nginx is selected, depending on the ddev version it adds the Joomla API location block to nginx-site.conf:
    location /api/ {
        try_files $uri $uri/ /api/index.php?$args;
    }
    
    If you use ddev version 1.25.2 or higher, joomla support is builtin into ddev, and a modification of nginx-site.conf is not needed.
  6. If -a is specified, installs the Adminer add-on for database management and restarts DDEV
  7. If -j is specified, downloads and installs Joomla with the CLI installer

Joomla auto-install details (with -j)

When -j is used, Joomla is installed with these defaults:

Setting Value
Admin username admin
Admin password AdminAdmin1!
Admin email admin@example.com
Site name Joomla
Database host db
Database name db
Database user db
Database password db
Database prefix Random 5-character lowercase string
SEF rewrite Enabled
Session lifetime 120 minutes

For Apache, htaccess.txt is automatically copied to .htaccess.

Examples

Create an empty site with default settings:

jaddsite -n mysite

Create a site with Joomla installed, using PHP 8.3 and Apache:

jaddsite -n mysite -p 8.3 -w apache -j

Create a site silently (e.g. from a script) and download and install Joomla:

jaddsite -n mysite -j -s

jdelsite

Permanently delete a DDEV Joomla project and all its files.

Usage

jdelsite -n <name> [-v] [-s] [-h]

Options

Option Description
-n <name> The name of the website to delete. Required.
-v Verbose - show all DDEV and Docker output
-s Silent - suppress all messages
-h Display help

What it does

  1. Shows a warning and asks for confirmation before proceeding
  2. Stops the DDEV project (ddev stop)
  3. Deletes the DDEV project without creating a database snapshot (ddev delete -O -y)
  4. Prunes the Docker builder cache
  5. Removes the site folder from disk

Warning: This action is irreversible. All files and the database will be permanently deleted. Make a backup first if needed.

Example

jdelsite -n mysite

jclone

Clone an existing DDEV Joomla project (including the database) to a new project name. Run from inside the source project's root folder.

Usage

jclone -n <new_name> [-v] [-s] [-h]

Options

Option Description
-n <new_name> The name for the cloned project (no spaces). Required.
-v Verbose - show all DDEV output
-s Silent - suppress all messages
-h Display help

What it does

  1. Reads the PHP version and webserver type from the source project's .ddev/config.yaml
  2. Prompts for confirmation before proceeding
  3. Dumps the source database to a temporary file
  4. Copies all source files to ROOTFOLDER/<new_name> (excluding .ddev)
  5. Creates a fresh DDEV config for the clone using the same PHP version and webserver
  6. Starts the cloned DDEV project
  7. Imports the database dump into the clone
  8. Clears the Joomla cache and tmp folders

The new project is available at https://<new_name>.ddev.site.

Note: If the source site has its hostname hardcoded (in articles, custom modules, $live_site, etc.), those references will need to be updated manually.

Examples

Clone the current site to a new project named mysite-clone:

cd ~/Development/sites/mysite
jclone -n mysite-clone

Clone with verbose output:

jclone -n mysite-test -v

jphpswitch

Switch the PHP version of an existing DDEV Joomla project. Run from inside your site folder.

Usage

jphpswitch -p <php_version> [-v] [-s] [-h]

Options

Option Description
-p <php_version> The new PHP version (e.g. 8.2, 8.3, 8.4). Required.
-v Verbose - show all DDEV output
-s Silent - suppress all messages
-h Display help

What it does

  1. Reads the current PHP version from .ddev/config.yaml
  2. If the project is already on the requested version, exits without doing anything
  3. Prompts for confirmation before proceeding
  4. Updates the DDEV config with ddev config --php-version=<version>
  5. Restarts the DDEV project with ddev restart

Examples

Switch to PHP 8.3:

cd ~/Development/sites/mysite
jphpswitch -p 8.3

Switch to PHP 8.4 with verbose output:

jphpswitch -p 8.4 -v

jxdb

Displays xdebug status and enables or disables xdebug. Run from inside your site folder.

Usage

jxdb [on|off]

Options

Option Description
no parameter Shows current xdebug status
on Enables xdebug
off Disables xdebug

What it does

  • Shows the status of xdebug when run without a parameter.
  • Enables or disables xdebug

Example

jxdb on