Nextcloud w/Ubuntu Server 24.04 - Command "maintenance:install" is not defined

Hi, I’m a new nextcloud user with basic knowledge in linux.
I’ve followed this guide to install nextcloud on Ubuntu server 24.04 and once I tried to perform the following line:

sudo -u www-data php occ maintenance:install --database "mysql" --database-name "ncloud" --databa
se-user "ncloud" --database-pass 'Sh@do5!d' --admin-user "admin" --admin-pass "password"

I got the following error msg:

 Command "maintenance:install" is not defined.

  Did you mean one of these?
      app:install
      maintenance:data-fingerprint
      maintenance:mimetype:update-db
      maintenance:mimetype:update-js
      maintenance:mode
      maintenance:repair
      maintenance:repair-share-owner
      maintenance:theme:update
      maintenance:update:htaccess

Can you please assist me to progress to the next installation stage?

Is the empty file “CAN_INSTALL” present in the config directory:

config/CAN_INSTALL

Without that file, installation is blocked:


Much and good luck,
ernolf

1 Like

Thanks for the reply @ernolf.
the /var/www/html/nextcloud/config includes only 2 files:

config.sample.php
config.php

How can I resolve this issue?

what is the content of that config.php?

Does it contain a line

  'installed' => true,

… if yes, remove that line or change it into

  'installed' => false,

and the empty file “CAN_INSTALL” is not present. Simply create it:

touch /var/www/html/nextcloud/config/CAN_INSTALL

And of course all this should be owned by the user www-data :

chown -R www-data:www-data /var/www

Much and good luck,
ernolf

Does the command occ config:list system work?

It sounds like you already ran the installer previously.

Post the output of the above command (which would normally be a censored version of your active config).

Hi All,
Combination of both of the replies assisted and passed successfully.
Now I have a working nextcloud on my Ubuntu server. Thanks a lot!

1 Like