- Nextcloud Server version (e.g., 29.x.x):
- latest
- Operating system and version (e.g., Ubuntu 24.04):
- Alpine Linux 3.21.3
- Web server and version (e.g, Apache 2.4.25):
- maybe Appache2 (default install and last version on docker)
- Is this the first time you’ve seen this error? (Yes / No):
- yes
- When did this problem seem to first start?
- after install
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
- docker
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
- no
Summary of the issue you are facing:
I installed Nextcloud on docker yesterday and I forgot to save it in my KeePass.
I saw that on the documentation you had to use this command:
sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
But in the container, there is no sudo, and it is not possible to install it.
sudo -u
corresponds to su
, but su
is not allowed.
In addition, the path in my container seems different. I have this location :
/var/www/html/
I also tried this command (my container name is “nextcloud”) :
docker exec nextcloud sudo -u www-data php /var/www/nextcloud/occ user:reset password admin
But return :
OCI runtime exec failed: exec failed: unable to start container process: exec: "sudo": executable file not found in $PATH: unknown
In addition, in my container, if I exec /var/www/html# ./occ user:resetpassword admin
, bash say I need to run sudo -u
or docker exec