Unable to get into maintenance mode for Nextcloud Docker container

So I am trying to backup my nextcloud container and for that I am following this documentation.

I entered in the docker container with docker exe and ran this command:
sudo -u www-data php occ maintenance:mode --on but it says www-data user is not there.

Then I started exploring where the nextcloud is installed with this thread. But my nextcloud is not installed in /var/www/html/ folder but I was able to find the config.php file inside /config/www/nextcloud/config/config.php folder.

Now I have no idea how to run the maintenance mode command. How should I proceed further?

My docker compose file:

---
version: "2"
services:
  nextcloud:
    image: linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - /disk1hdd/portainer/Files/AppData/Config/Nextcloud/Config:/config
      - /disk1hdd/portainer/Files/AppData/Config/Nextcloud/Data:/data
    ports:
      - 443:443
    restart: unless-stopped
    depends_on:
      - nextcloud_db
  nextcloud_db:
    image: linuxserver/mariadb:latest
    container_name: nextcloud_db
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - MYSQL_ROOT_PASSWORD=Jnhs_1315
      - TZ=${TZ}
      - MYSQL_DATABASE=fakepassword
      - MYSQL_USER=fakeuser
      - MYSQL_PASSWORD=fakepassword
    volumes:
      - /disk1hdd/portainer/Files/AppData/Config/Nextcloud/DB:/config
    ports:
      - 3306:3306
    restart: unless-stopped

this is correct, that user does not exist.
try docker exec -it nextcloud occ maintenance:mode --on