- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| .githooks | ||
| installer | ||
| src/Scripts | ||
| uninstaller | ||
| updater | ||
| .gitignore | ||
| Install.md | ||
| LICENSE | ||
| README.md | ||
| Uninstall.md | ||
| Update.md | ||
Bash scripts to support Joomla in DDEV
DDEV is a tool to create Docker-based PHP development environments. It gives you Container superpowers with zero required Docker skills: environments in minutes, multiple concurrent projects, and less time to deployment.
DDEV runs on macOS, Windows and Linux and on GitHub Codespaces.
This set of scripts was written to better support Joomla local development in DDEV.
These scripts also support the new ddev version 1.25.2 with joomla support, but they also work for older ddev versions.
Features
- Create a Joomla project and automatically download and install the latest Joomla version in it.
- Optionally place your website in a document root subfolder (
public,htdocs, etc.) inside the project folder. - Support for the /api endpoint when you run your Joomla project on Nginx.
- Create or import a MariaDB database dump from or to your Joomla project or dump all databases at once.
- Create a full website backup of a Joomla project or backup all projects at once.
- Delete a Joomla project.
- List all installed Joomla projects.
Requirements
You need to have a working DDEV setup on your machine. Read about how to install DDEV here: ddev.com/get-started.
Configuration
The installer asks for a few default values and stores them in ~/.config/ddevjoomla/config. All scripts read this file at startup.
| Variable | Purpose |
|---|---|
ROOTFOLDER |
The folder where all your projects are created. Every project gets its own subfolder: <Rootfolder>/<Projectname> |
DOCROOT |
Optional document root subfolder inside the project folder (for example htdocs, web, public, public_html, docroot). Leave empty to use the project folder itself as document root |
BACKUPFOLDER |
The folder where your backups are stored |
WEBSERVER |
The default webserver for new projects, nginx or apache |
When DOCROOT has a value, jaddsite creates that subfolder, installs the website in it and configures DDEV to use it as document root. The .ddev folder always stays in the project folder. jclone takes over the document root of the project you are cloning, so a clone always has the same layout as its source.
All other scripts do not use this setting at all: they read the document root from the project's own .ddev/config.yaml. Because of that you can run them from the project folder as well as from the document root subfolder, and a setup with a mix of projects with and without a document root subfolder keeps working. gosite takes you to the document root, where your Joomla files are, and you select a site by its project name.
Database dumps are stored in the document root, next to your Joomla files, so they are included in a document-root-only backup (jbackup -r). That applies to jdbdump (unless -b puts the dump in the backup folder) and to jdbdumptable, and jdbimp looks for dump files in the document root as well. All three work when started from the project folder or from the document root. jdbdumpall always writes to the backup folder.
You can change these values afterwards by editing ~/.config/ddevjoomla/config in a text editor. Existing projects are not affected by such a change; the new value is used for projects you create afterwards.
Utility Scripts
The following scripts will be installed which do the following:
| Script | Purpose |
|---|---|
jaddsite |
Create a new DDEV Joomla project (PHP version, webserver, optional docroot subfolder, optional Joomla install) |
jdelsite |
Permanently delete a DDEV Joomla project and its files |
jclone |
Clone an existing DDEV Joomla project (including the database) to a new project name |
jphpswitch |
Switch the PHP version of an existing DDEV Joomla project |
jlatest |
Download and extract the latest (or specified) Joomla release |
jdbdump |
Export the DDEV database (ddev export-db) |
jdbdumpall |
Export the DDEV database of all Joomla projects to SQL dump files |
jdbdumptable |
Export one table from the DDEV database to a SQL dump file |
jdbimp |
Import a database dump (ddev import-db) |
jbackup |
Full site backup: database dump + compressed archive (.tgz or .zip) of the whole project folder, or of the document root only with -r |
jbackupall |
Full backup of all DDEV Joomla projects (database dump + archive) |
jxdb |
Displays xdebug status and enables or disables xdebug |
jinfo |
Displays info about the Joomla project and shows DDEV description |
jsetconfig |
Set the essential DDEV values (database, log and tmp paths) in configuration.php |
gosite |
cd into the document root of a Joomla site by project name (gosite <site>), or interactively select one when no name is given (requires shell function wrapper in .zshrc/.bash_profile) |
jlistjoomlas |
List all Joomla sites found under the configured root folder |
setrights |
Set correct file permissions (644 files, 755 dirs) |
jddev |
Show all available scripts and their command-line parameters |
jddev-update |
Update all ddev-joomla scripts from the GitHub main branch |
jddev-checkupdate |
Internal helper: checks once a day, in the background, for available script updates |
Contributing
ShellCheck runs server-side on every push via the Forgejo Actions workflow .forgejo/workflows/shellcheck.yml — this always runs and is the authoritative check.
For fast feedback, you can also activate the local pre-commit ShellCheck hook after cloning:
git config core.hooksPath .githooks
This runs shellcheck on all scripts automatically before each commit.
Backup & Safety
The installer script automatically creates backups of all configuration files and existing scripts before making any changes.
Installation, Updates & Uninstallation
Follow these installation instructions to get everything up and running.
Regular updates are provided in this repository. Use the local jddev-update command to update your local jddev scripts.
If you want to remove the scripts again, follow these uninstall instructions.
Documentation
Documentation can be found in the Wiki pages.
Support the Project
If you like and use this tool, please consider making a donation to support further development. 🙌