NextCloud Docker container connectivity

Hello, I am new with next cloud. I created nextcloud, mongo and my own container using docker-compose for mongodb backup. I am trying to communicate between my container and nextcloud to upload the backup.
It giving me an error for untrusted domain. I already checked the existed solutions and try to update the config.php file and put my domain. still I am getting the same error.
I have these three containers.

I am trying to communicate using this link to upload the backup on next cloud

curl -X PUT -u user:pass http://nextcloud:80/remote.php/dav/files/user/ -T

This is my compose file:

version: “3”
    container_name: “mongo”
    image: “mongo:latest”
    container_name: “nextcloud”
    image: “nextcloud:latest”
      - “8080:80”
      - ./data:/var/www/html/data
      - ./config:/var/www/html/config
    container_name: “backup”
    image: “5d65788541d8”

Can anyone tell me where I am doing wrong or what I have to do to communicate correctly. Thank you!

I edited your post to add codeblocks, indented your yaml and I even fixed your curl command that was to a link.

Please, format your posts according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Do you have an error message?


Sorry, I didn’t read your post carefully. You shared an error message.

I would search for an answer on the NextCloud forum:

1 Like

I don’t get the big picture. I thought NextCloud requires a SQL database, no MongoDB document store (doc).

Here you can find an example docker-compose.yml for NextCloud using Traefik as reverse proxy (link).

Hi, I solved that issue by accessing next cloud container by using http://nextcloud without any port. It works for me

But there was no port in your original curl command so what port do you mean?

Oh my bad I think I mis write it before. I update my question now before I was trying to access with nextcloud:80 and it was giving me error of untrusted domains.
So I update the config file of nextcloud and put nextcloud without port in my trusted domains. like this:

'trusted_domains' => 
  array (
    0 => 'localhost:8080',
    1 => 'nextcloud',

then I update my curl command like this:
curl -X PUT -u user:pass http://nextcloud/remote.php/dav/files/user/ -T
and it work.

Thank you for the clarification.