Joomla CLI Installation

From Joomla! Documentation

Other languages:
Deutsch • ‎English • ‎français


Starting with Joomla! 4.3, the Joomla CLI installation is available. It allows setting up the Content Management System (CMS) directly on the server console without the need of a web browser. This allows automated deployments, for example for autoinstallers for an ISP. By eliminating the HTML interface, the installation process is significantly accelerated.

Experienced users and developers can easily deploy multiple instances of Joomla this way.

The CLI installer is part of the standard Joomla package.

System Requirements[edit]

Joomla requires PHP, a database and a web server. For the latest information about the supported software and the minimum and recommended versions, please visit https://downloads.joomla.org/technical-requirements.

Processing Installation[edit]

Basically, the CLI installation can be performed via two methods:

  1. Manual installation
  2. Script-driven automatic installation

Manual installation[edit]

Manual installation offers the highest level of control possible during the installation process. Each step is visible in the terminal and can be aborted with Ctrl+C in case of an incorrect entry.

Steps to be done[edit]

  1. Uploading the installation package into the web server's (resp. virtual host's) document root
  2. Move to corresponding document root
  3. Uncompress zip file (or tarball)
  4. Run PHP command: php installation/joomla.php install. Gradually the most important parameters for installation and operation of the new website will be prompted (see next section).
    Note: Pay careful attention to your input. It is not possible to step back in the script. If the input is incorrect, the script must be aborted.
    Several parameters can be added to the command (see table below).
  5. Once the script is successfully completed, the new website can be accessed.
    Cli installer success.png
Requested Information on Install Joomla[edit]
  • Login Data:
    • Enter the name of your Joomla site.: Do enter here the hostname of the new website. If the new Joomla website is installed on a public server, it has to be a fully qualified domain name (FQDN).
    • Enter the real name of your Super User. : The prompt is quite obvious.
    • Set the username for your Super User account.: Be absolutely careful to avoid a name similar to admin here. It is potentially insecure as it can be easily guessed by a hacker.
    • Enter the email address of the website Super User.: The prompt is quite obvious.
  • Database Configuration:
    • Database type. Supported: mysql, mysqli, pgsql [mysqli]: Default is mysqli. Supported database types are MySQL (mysql) and PostgreSQL (pgsql) databases and compatible types (e.g. MariaDB). mysqli stands for the advanced variant on MySQL.
    • Database host [localhost]: Default is localhost. An IP address or a host name should be entered here only if the responsible database server is installed on another host. However, the terminal user has to have write permissions on the selected host. You will get get this information from your internet provider (ISP).
    • Database username: The login name of the database user, it is usually different from the name of the SuperUsers. You will get get this information from your ISP.
    • Database password: The password for the Joomla database. You will get get this information from your ISP.
    • Database name [joomla_db]: The value joomla_db is predefined, but another name is used regularly. You will get get this information from your ISP.
    • Prefix for the database tables [s61vo_]: The prefix for the Joomla database tables. This value is used to separate the Joomla tables from other tables contained in the database, if the database is used by other applications as well. The value is randomly generated every time you call the script and should be changed only in exceptional cases.
      Info non-talk.png

      Do not use an existing table prefix to write to an existing database - it may lead to unexpected results.

    • Encryption for the database connection. Values: 0=None, 1=One way, 2=Two way [0]: Select the type of database encryption here. You will get this information from your ISP.

Script-driven automatic installation[edit]

The complete Joomla installation is controlled by the joomla.php file, which is located in the /installation subfolder after unpacking the cli installation package.

Any programming language that allows calling and executing PHP files allows you to create a script that automates the necessary preparations and the actual installation using custom variables.

With this script, steps 1-3 from the manual installation (see above) should be completed before the joomla.php file is called up. The process of this file can be controlled exactly with the help of several parameters. It has to be started from the root directory of the new Joomla website. The call is done with:

php installation/joomla.php install [options]

In the terminal screen, the contents of the lower table may be retrieved with the following command: php installation/joomla.php help install

joomla.php Options[edit]
Options Description
--site-name=SITE_NAME Name of the website
--admin-user=ADMIN_USER Real name of the Super User account
--admin-username=ADMIN_USERNAME Username of your Super User account
--admin-password=ADMIN_PASSWORD Password of your Super User account
--admin-email=ADMIN_EMAIL Email address of the website's Super User account
--db-type=DB_TYPE Database type. Supported by Joomla: mysql (=MySQL (PDO)), mysqli (=MySQLi), pgsql (=PostgreSQL (PDO)) [default: "mysqli"]
--db-host=DB_HOST Database host [default: "localhost"]
--db-user=DB_USER Database username
--db-pass=DB_PASS Database password
--db-name=DB_NAME Database name [default: "joomla_db"]
--db-prefix=DB_PREFIX Prefix for the database tables [default: "vlqhe_"]. The default value is randomly generated every time you call the script.
--db-encryption=DB_ENCRYPTION Connection Encryption [default: "0"]
--db-sslkey[=DB_SSLKEY] SSL key for the database connection. Requires encryption to be set to 2
--db-sslcert[=DB_SSLCERT] Path to the SSL certificate for the database connection. Requires encryption to be set to 2
--db-sslverifyservercert[=DB_SSLVERIFYSERVERCERT] Verify SSL certificate for database connection. Values: 0=No, 1=Yes. Requires encryption to be set to 1 or 2 [default: "0"]
--db-sslca[=DB_SSLCA] Path to CA file to verify encryption against
--db-sslcipher[=DB_SSLCIPHER] Supported Cipher Suite (optional)
-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

Related Information[edit]