From ae1d3bc96f432338285a8a8781639e7030476382 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 2 Aug 2026 19:20:19 -0400 Subject: [PATCH 1/4] docs(installation): clarify command-line installation Updated introduction, clarified HTTP-user permissions, safer password guidance, corrected occ invocation, and syntax-highlighted console examples. Assisted-by: Copilot:5.6 Signed-off-by: Josh --- .../command_line_installation.rst | 84 ++++++++++++------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/admin_manual/installation/command_line_installation.rst b/admin_manual/installation/command_line_installation.rst index 0e31cf0edac..0105d941003 100644 --- a/admin_manual/installation/command_line_installation.rst +++ b/admin_manual/installation/command_line_installation.rst @@ -1,39 +1,67 @@ -============================ -Installing from command line -============================ +============================== +Install from the command line +============================== -It is now possible to install Nextcloud entirely from the command line. This is -convenient for scripted operations, headless servers, and sysadmins who prefer -the command line. There are three stages to installing Nextcloud via the command -line: +You can install Nextcloud without using the web-based Installation Wizard. This +is useful for automated deployments, headless servers, and administrators who +prefer the command line. -1. Download the Nextcloud code and unpack the tarball in the appropriate directories. (See :doc:`source_installation`.) +Before continuing, download and unpack the Nextcloud archive, configure the web +server and PHP, and create the database and database user when using MySQL, +MariaDB, PostgreSQL, or Oracle. -2. Change the ownership of your ``nextcloud`` directory to your HTTP user, like -this example for Debian/Ubuntu. You must run ``occ`` as your HTTP user; see -:ref:`http_user_label`:: +For the complete manual-installation prerequisites, see +:doc:`source_installation`. - $ sudo chown -R www-data:www-data /var/www/nextcloud/ +1. Ensure that the HTTP user has read and write access to all Nextcloud + directories. Changing ownership is the usual approach; for example, on + Debian/Ubuntu: -3. Use the ``occ`` command to complete your installation. This takes the place -of running the graphical Installation Wizard:: + .. code-block:: console - $ cd /var/www/nextcloud/ - $ sudo -E -u www-data php occ maintenance:install \ - --database 'mysql' --database-name 'nextcloud' \ - --database-user 'nextcloud' --database-pass 'password' \ - --admin-user 'admin' --admin-pass 'password' + $ sudo chown -R www-data:www-data /var/www/nextcloud/ -Note that you must change to the root Nextcloud directory, as in the example -above, to run ``occ maintenance:install``, or the installation will fail with -a PHP fatal error message. + Ownership is not strictly required. For example, where changing ownership is + not possible, add the HTTP user to the group that owns the directories and + ensure that they are group-writable. See :ref:`http_user_label`. -Supported databases are:: +2. Use the ``occ`` command to complete the installation. This takes the place + of the graphical Installation Wizard. Run ``occ`` as the HTTP user so that + ownership and permissions remain consistent with the web server: - - sqlite (SQLite3 - Nextcloud Community edition only) - - mysql (MySQL/MariaDB) - - pgsql (PostgreSQL) - - oci (Oracle currently only possible if you contact us at https://nextcloud.com/enterprise as part of a subscription) + .. code-block:: console -See :ref:`command_line_installation_label` for more information. + $ sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install \ + --database mysql --database-name nextcloud \ + --database-user nextcloud \ + --admin-user admin + + This command prompts for the database and administrator passwords. For + unattended installations, specify ``--database-pass`` and ``--admin-pass`` + using your deployment system's protected secret-handling mechanism. Avoid + exposing production passwords in shell history or process listings. + + You can invoke ``occ`` from any directory when using its absolute path, as + in the example above. Alternatively, change to the Nextcloud root directory + and run ``php occ maintenance:install``. + + Use ``--database-host`` and, if necessary, ``--database-port`` when the + database runs on another host. Use ``--data-dir`` to select a data directory + other than the default. To view all supported options, run: + + .. code-block:: console + $ sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install --help + +Supported databases are: + +- ``sqlite`` (SQLite) +- ``mysql`` (MySQL/MariaDB) +- ``pgsql`` (PostgreSQL) +- ``oci`` (Oracle; contact `Nextcloud GmbH + `_ for enterprise support) + +The selected database requires its corresponding PHP extension or driver to be +installed and enabled. + +See :ref:`command_line_installation_label` for more information. From aa5da6b26fdde4a32f3117f5928665976ba4cf3f Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 2 Aug 2026 19:37:55 -0400 Subject: [PATCH 2/4] docs(occ): update maintenance install reference Assisted-by: Copilot:GPT-5.6 Signed-off-by: Josh --- admin_manual/occ_system.rst | 76 +++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/admin_manual/occ_system.rst b/admin_manual/occ_system.rst index 1d2e2a6aa77..1c7c2ab86f4 100644 --- a/admin_manual/occ_system.rst +++ b/admin_manual/occ_system.rst @@ -885,45 +885,55 @@ These commands are only available before Nextcloud has been installed, after you have unpacked the archive and copied Nextcloud into the appropriate directories. -Display the available installation options:: - - sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install --help - Nextcloud is not installed - only a limited number of commands are available - - Usage: - maintenance:install [options] - - Options: - --database[=DATABASE] Supported database type [default: "sqlite"] - --database-name[=DATABASE-NAME] Name of the database - --database-host[=DATABASE-HOST] Hostname of the database [default: "localhost"] - --database-port[=DATABASE-PORT] Port of the database - --database-user[=DATABASE-USER] User name to connect to the database - --database-pass[=DATABASE-PASS] Password of the database user - --database-table-prefix[=...] Table prefix for every table in the database - --admin-user[=ADMIN-USER] User name of the admin account [default: "admin"] - --admin-pass[=ADMIN-PASS] Password of the admin account - --data-dir[=DATA-DIR] Path to data directory [default: "/var/www/nextcloud/data"] - -This example installs Nextcloud with a MySQL database:: - - sudo -E -u www-data php occ maintenance:install \ - --database mysql \ - --database-name nextcloud \ - --database-host 127.0.0.1 \ - --database-user nextcloud \ - --database-pass secret \ - --admin-user admin \ - --admin-pass password +Display the available installation options: + +.. code-block:: console + + $ sudo -u www-data php /var/www/nextcloud/occ maintenance:install --help + Nextcloud is not installed - only a limited number of commands are available + + Usage: + maintenance:install [options] + + Options: + --database[=DATABASE] Supported database type [default: "sqlite"] + --database-name[=DATABASE-NAME] Name of the database + --database-host[=DATABASE-HOST] Hostname of the database [default: "localhost"] + --database-port[=DATABASE-PORT] Port the database is listening on + --database-user[=DATABASE-USER] Login for database connection + --database-pass[=DATABASE-PASS] Password of the database login + --database-table-space[=DATABASE-TABLE-SPACE] + Table space of the database (``oci`` only) + --disable-admin-user Disable the creation of an administrator login + --admin-user[=ADMIN-USER] Login for initial administrator account [default: "admin"] + --admin-pass[=ADMIN-PASS] Password for initial administrator login + --admin-email[=ADMIN-EMAIL] E-Mail to associate with the initial administrator login + --data-dir[=DATA-DIR] Path to data directory + --password-salt[=PASSWORD-SALT] Password salt; generated if not provided (ADVANCED) + --server-secret[=SERVER-SECRET] Server secret; generated if not provided (ADVANCED) + +This example installs Nextcloud with a MySQL database. ``occ`` prompts for +the database and administrator passwords: + +.. code-block:: console + + $ sudo -u www-data php /var/www/nextcloud/occ maintenance:install \ + --database mysql \ + --database-name nextcloud \ + --database-host 127.0.0.1 \ + --database-user nextcloud \ + --admin-user admin + What is the password to access the database with user ? + What is the password you like to use for the admin account ? Nextcloud was successfully installed Supported databases: -* ``sqlite`` — SQLite (community edition only; not recommended for production) +* ``sqlite`` — SQLite (not recommended for production usage) * ``mysql`` — MySQL or MariaDB * ``pgsql`` — PostgreSQL -* ``oci`` — Oracle (Nextcloud Enterprise only) - +* ``oci`` — Oracle; contact `Nextcloud GmbH + `_ for enterprise support .. _command_line_upgrade_label: From 22df52f5df54609a0cfc11e231aef6297fb73c98 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 2 Aug 2026 19:46:58 -0400 Subject: [PATCH 3/4] chore: fix sudo syntax in maintenance:install section Signed-off-by: Josh --- admin_manual/occ_system.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin_manual/occ_system.rst b/admin_manual/occ_system.rst index 1c7c2ab86f4..685c022ced6 100644 --- a/admin_manual/occ_system.rst +++ b/admin_manual/occ_system.rst @@ -889,7 +889,7 @@ Display the available installation options: .. code-block:: console - $ sudo -u www-data php /var/www/nextcloud/occ maintenance:install --help + $ sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install --help Nextcloud is not installed - only a limited number of commands are available Usage: @@ -917,7 +917,7 @@ the database and administrator passwords: .. code-block:: console - $ sudo -u www-data php /var/www/nextcloud/occ maintenance:install \ + $ sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install \ --database mysql \ --database-name nextcloud \ --database-host 127.0.0.1 \ From f24c9475c2b107318864986f61e86512ac60058b Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Aug 2026 10:57:18 -0400 Subject: [PATCH 4/4] chore: make occ syntax checker happy about command_line_installation Signed-off-by: Josh --- admin_manual/installation/command_line_installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_manual/installation/command_line_installation.rst b/admin_manual/installation/command_line_installation.rst index 0105d941003..f6366634290 100644 --- a/admin_manual/installation/command_line_installation.rst +++ b/admin_manual/installation/command_line_installation.rst @@ -43,7 +43,7 @@ For the complete manual-installation prerequisites, see You can invoke ``occ`` from any directory when using its absolute path, as in the example above. Alternatively, change to the Nextcloud root directory - and run ``php occ maintenance:install``. + and run ``sudo -E -u www-data php occ maintenance:install``. Use ``--database-host`` and, if necessary, ``--database-port`` when the database runs on another host. Use ``--data-dir`` to select a data directory