Nextcloud install on Apache2 Webserver

Installing Nextcloud 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:

  1. Download the Nextcloud code and unpack the tarball in the appropriate directories. (See Manual Installation on Linux.)

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 Run occ As Your HTTP User:

3. Use the occ command to complete your installation. This takes the place of running the graphical Installation Wizard:

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.

Supported databases are:

See Command Line Installation for more information.

Finally, apply the correct strong permissions to your Nextcloud files and directories (see Setting Strong Directory Permissions). This is an extremely important step. It helps protect your Nextcloud installation, and ensures that it will run correctly.


If your Nextcloud installation fails and you see this in your Nextcloud log: