If you ever get locked out of your nextcloud account and have not way of resetting through the web interface you can use the command line option.
Basically connect via terminal or SSH, navigate to your the installation directory of Nextcloud and execute the following command.
1 |
sudo -u www-data php /var/www/html/nextcloud/occ user:resetpassword username |