Advice on resetting admin password in Nextcloud

NethServer Version: NethServer release 7.3.1611 (Final)
Module: Nextcloud 11.0.2

Hi Team,

I’m working on my test nethserver testing my ssl certificates. I’ve seem to have lost the ability to login as the local nextcloud admin. I do know the password but for some reason it won’t work. I’m hoping I can reset the admin Nextcloud password from the command line and I’m looking to see if anyone else has done this.

I’ve been searching google for an answer and found this from ownCloud:

$ sudo -u www-data php /var/www/owncloud/occ user:resetpassword admin
Enter a new password:
Confirm the new password:
Successfully reset password for admin

I know that Nethserver puts Nextcloud in /usr/share/nextcloud. I’ve tried submitting the above instruction pointing to my location of the occ but I’m getting errors on www-data not found.

Does anyone know if it’s possible and how I can update my local admin password for Nextcloud?


On CentOS, the user for the Apache web-server is apache instead of www-data.

sudo -u apache /opt/rh/rh-php56/root/usr/bin/php /usr/share/nextcloud/occ user:resetpassword admin

If there are multiple admin accounts (nextcloud’s one and also from AD/LDAP account provider) things can be confusing when trying to login.


As usual Excellent @dnutan!

Thanks very much for your help. Exactly what I was looking for.

1 Like