How to uninstall Nextcloud 24.0.1 properly?

I have installed on a Linux server with php, apache and mariadb Nextcloud 24.0.1, but I wanted to install from beginning 24.0.2.

I have deleted everything from /var/www/nextcloud but then now, when I try php occ maintenance:install ... I get:

Username is invalid because files already exist for this user

I want to cleanup this user, but not sure where I need to do it. Any hint?

Hello @John5 ,

welcome to the community of Nextcloud.

This are the files/folders of your installation.
What about the database? Did you removed it as well? Or using a new one?

Good question… I was checking nextcloud’s code and saw this error does not check db, but it was because of garbage on data-dir folder. Not that I removed it, the error changed to:

“The username is already being used”

Then I had to cleanup nextcloudb and errors disappeared.