Using the Joomla Command-Line Interface (CLI)

Web apps are rarely the best tool for repetitive tasks that demand consistency. Command-line interfaces cut through the overhead, and Joomla's CLI — mature and capable as of Joomla 5 — lets you script, automate, and execute routine operations with precision. Whether you're managing a single site or maintaining a fleet of them, the CLI is one of the most underused tools available to Joomla administrators in 2026.

Connecting via SSH and setting a configuration option from the terminal might feel unusual at first, but it's no different in terms of security from using a file editor over the same connection. Once it clicks, you'll wonder how you managed without it.

TL:DR – Joomla's CLI is powerful, scriptable, and well-suited to modern DevOps workflows. A handful of commands covers everything from cache cleaning and user management to scheduled task automation and live updates. It works anywhere you can SSH in — macOS Terminal, Linux shell, or Windows via WSL2.

Connecting to your Joomla server from a terminal

On macOS or Linux, open Terminal. On Windows, Windows Subsystem for Linux (WSL2) gives you a full Linux environment and is the cleanest way to work with SSH-based workflows in 2026. Enable SSH access through your hosting control panel — most managed hosts and VPS providers expose this in their dashboard — then connect with:

ssh This email address is being protected from spambots. You need JavaScript enabled to view it.

The first connection will record the server's fingerprint locally, so SSH can detect if something unexpected changes on future connections. Once you're in, navigate to the Joomla CLI directory:

cd public_html/cli

If your Joomla installation lives in a subdirectory or at the domain root, adjust the path accordingly. From here, every command follows the same pattern: php joomla.php [command].

Run your first command

A good starting point is checking for core updates:

$ php joomla.php core:check-updates

Joomla! Updates
===============

 ! [NOTE] New Joomla Version 5.3.0 is available.

Immediately useful. From here you can update in place, manage configuration, or automate the whole sequence in a shell script.

What commands are available?

Running php joomla.php without any arguments outputs the full command list. Commands are grouped by category: cache, config, core, database, extension, finder, scheduler, session, site, update, and user. Third-party extensions can register their own CLI commands, though those won't appear in this default listing — check individual extension documentation for details.

$ php joomla.php
Joomla! (debug: No)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display the help information
  -q, --quiet           Flag indicating that all output should be silenced
  -V, --version         Displays the application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Flag to disable interacting with the user
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                            Show the help for a command
  list                            List the application's available commands
 cache
  cache:clean                     Clean expired cache entries
 config
  config:get                      Display the current value of a configuration option
  config:set                      Set a value for a configuration option
 core
  core:check-updates              Check for Joomla updates
  core:update                     Update Joomla
 database
  database:export                 Export the database
  database:import                 Import the database
 extension
  extension:discover              Discover extensions
  extension:discover:install      Install discovered extensions
  extension:discover:list         List discovered extensions
  extension:install               Install an extension from a URL or from a path
  extension:list                  List installed extensions
  extension:remove                Remove an extension
 finder
  finder:index                    Purges and rebuild the index
 scheduler
  scheduler:list                  List all scheduled tasks
  scheduler:run                   Run one or more scheduled tasks
  scheduler:state                 Enable, disable or trash a scheduled task
 session
  session:gc                      Perform session garbage collection
  session:metadata:gc             Perform session metadata garbage collection
 site
  site:down                       Put the site into offline mode
  site:up                         Put the site into online mode
 update
  update:extensions:check         Check for pending extension updates
  update:joomla:remove-old-files  Remove old system files
 user
  user:add                        Add a user
  user:addtogroup                 Add a user to a group
  user:delete                     Delete a user
  user:list                       List all users
  user:removefromgroup            Remove a user from a group
  user:reset-password             Change a user's password
$

Each command also accepts a --help flag for inline documentation. For example, php joomla.php user:add --help lists every available option and its expected format — useful when you're building scripts and want to get the arguments right without trial and error.

Joomla Cache CLI command examples

Clean expired cache entries from the command line

Run php joomla.php cache:clean to flush expired cache entries. This is a natural fit for a cron job on high-traffic sites where stale cache can linger longer than you'd like.

$ php joomla.php cache:clean

Cleaning System Cache
=====================

 [OK] Cache cleaned

$

Joomla Config CLI command examples

Display the current value of a configuration option

Retrieve all configuration values with php joomla.php config:get, or query a specific key by name:

$ php joomla.php config:get editor
 -------- ------------ 
  Option   Value       
 -------- --------- 
  editor   tinymce  
 -------- --------- 
$

Set a configuration option from the command line

Changing a configuration value is equally straightforward. Here, the default editor is switched from TinyMCE to CodeMirror — the kind of change that's easy to script across multiple environments:

$ php joomla.php config:set editor=codemirror

 [OK] Configuration set  
 
$ php joomla.php config:get editor
 -------- ------------
  Option   Value     
 -------- ------------ 
  editor   codemirror  
 -------- ------------ 
$

The config:set command is particularly valuable in deployment pipelines. Rather than logging into the administrator interface to toggle settings after a migration or environment change, you can encode the correct configuration state directly in your deployment script and apply it consistently every time.

Joomla Core CLI command examples

Update Joomla from the command line

With Joomla 5's improved update pipeline, running core updates from the CLI is reliable and clean. No browser timeout risks, no half-finished updates if your connection drops mid-process:

$ php joomla.php core:update
 8/8 -- Cleaning up ...   
                         
 [OK] Joomla core updated successfully!

Combine core:check-updates with core:update in a script, add a notification step, and you have a lightweight automated update workflow that requires no manual intervention for minor and patch releases.

Joomla Database CLI command examples

Export the database from the command line

Run the export from a directory where the output files won't be web-accessible — the export creates one file per table and the contents are sensitive. A dedicated backup directory outside the webroot is the right approach:

$ php joomla.php database:export
Exporting Database
==================

 Processing the xxxx_action_log_config table
 Exported data for xxxx_action_log_config in 0 seconds
 Processing the xxxx_action_logs table
 Exported data for xxxx_action_logs in 2 seconds
 ... (further output omitted, db prefix changed to xxxx)
 Processing the xxxx_workflows table
 Exported data for xxxx_workflows in 0 seconds
 
 [OK] Export completed in 9 seconds  
 
$

Paired with database:import, this makes CLI-driven site migrations and staging refreshes significantly more straightforward than manually exporting through phpMyAdmin or a browser-based tool.

Joomla Extension CLI command examples

Manage extensions from the command line

The extension commands cover the full lifecycle: list installed extensions with extension:list, install from a URL or local path with extension:install, discover unregistered extensions with extension:discover, and remove extensions with extension:remove. For teams managing multiple Joomla instances, scripting extension installs ensures every environment stays consistent.

$ php joomla.php extension:list 

Installed extensions.
=====================
 ----------------------------------- -------------- ----------- ----------- --------
 Name                                Extension ID   Version     Type        Active 
 ----------------------------------- -------------- ----------- ----------- --------
  com_wrapper                         1              5.0.0       component   Yes  
  com_admin                           2              5.0.0       component   Yes  
  com_banners         
  ... (further rows omitted) ...
 ----------------------------------- -------------- ----------- ----------- --------

$

Joomla Finder CLI command examples

Rebuild the Smart Search index from the command line

Rebuilding the Smart Search index via the browser can time out on larger sites. The CLI handles it without any such constraint:

$ php joomla.php finder:index  
Finder Indexer
==========================

 Starting Indexer
 Setting up Smart Search plugins
 Setup 179 items in 0.016 seconds.
  * Processed batch 1 in 1.12 seconds.
  * Processed batch 2 in 2.715 seconds.
  * Pausing processing for 1 seconds ...
  * Continuing processing of batch ...
  * Processed batch 3 in 2.742 seconds.
  * Pausing processing for 1 seconds ...
  * Continuing processing of batch ...
  * Processed batch 4 in 1.864 seconds.

Total Processing Time: 10.46 seconds.
Peak memory usage: 18,874,368 bytes

$

Joomla Scheduler CLI command examples

Run and manage scheduled tasks from the command line

The task scheduler, introduced in Joomla 4.1 and refined through the Joomla 5 series, is one of the most compelling reasons to invest time in the CLI. Rather than relying on web-based pseudo-cron triggers that depend on site traffic, you can drive scheduled tasks directly from a real system cron job using scheduler:run. This makes task execution genuinely reliable — independent of whether anyone is visiting the site at the right moment.

$ php joomla.php scheduler:list

List Scheduled Tasks
====================

 ---- ------- ------------------- --------- ---------- 
  id   title   type                state     next run  
 ---- ------- ------------------- --------- ---------- 
  1    Sleep   Demo Task - Sleep   Enabled   DUE!      
 ---- ------- ------------------- --------- ---------- 

$

Enable, disable, or trash a scheduled task from the command line

$ php joomla.php scheduler:state
Please specify the ID of the task:
 > 1
 
 Should the state be "enable" (1), "disable" (0) or "trash" (-2):
 > 0
 
 [OK] Task ID 1 disabled.
$

A practical cron entry to run due tasks every fifteen minutes looks like this:

*/15 * * * * /usr/bin/php /var/www/html/cli/joomla.php scheduler:run --all --no-interaction -q

The --no-interaction flag prevents the command from waiting for user input, and -q suppresses output so your cron logs stay clean. Adjust the PHP binary path to match your server's configuration.

Joomla Session CLI command examples

Session garbage collection from the command line

Session garbage collection is another good candidate for a scheduled cron task, particularly on sites with high user volumes where session tables can grow quickly:

$ php joomla.php session:gc 
Running Session Garbage Collection
==================================

 [OK] Garbage collection completed.
$

Joomla Site CLI command examples

Take the site offline or bring it back online

Taking a site offline before a maintenance operation and bringing it back up afterwards is cleaner from the CLI than toggling it in the administrator interface — especially when offline mode is part of a scripted deployment sequence:

$ php joomla.php site:down
                                                                                                                      
 [OK] Configuration set                                                                                                 
                                                                                                                      
 [OK] Website is now offline  

$ php joomla.php site:up
                                                                                                                     
 [OK] Configuration set                                                                                                 

 [OK] Website is now online 

$

Joomla Update CLI command examples

Check for pending extension updates

$ php joomla.php update:extensions:check

Fetching Extension Updates
==========================

 [OK] There are no available updates                               
 
$

Remove old system files after an update

After a core update, old files that are no longer part of the Joomla codebase can remain on disk. Running this command cleans them up — good hygiene and a minor security improvement:

$ php joomla.php update:joomla:remove-old-files

Removing Unneeded Files & Folders
=================================
 [OK] 5785 Files checked and 0 deleted 
 
 [OK] 1337 Folders checked and 0 deleted
$

Joomla User CLI command examples

User management from the command line

The user commands cover everything you'd expect: add a user with user:add, assign them to a group with user:addtogroup, remove group membership with user:removefromgroup, reset a password with user:reset-password, list all users with user:list, and delete a user with user:delete. For bulk onboarding or access management across multiple sites, scripting these commands saves significant time:

$ php joomla.php user:removefromgroup --username=xxxx --group=Registered

Remove user from group
======================

 [OK] Removed 'xxxx' from group 'Registered'! 

$ 

See also:
Joomla CLI Documentation — Joomla Docs
Joomla 4: A Powerful CLI Application — Joomla Community Magazine