How to add trusted domain on Nextcloud install via docker windows 10?

Hoping someone can help guide me to add a trusted domain to my nextcloud.
I add nextcloud to a windows 10 machine using the Docker image.

I am unsure how to get to the config file? Or the correct terminal to run the commands from in the helps sections. Powershell?
Programing not my forte but obviously could follow directions enough to get this close…so close.

I would need instruction showing what to do from the windows desktop as a starting point . Thanks so much in advance

Easiest thing would be to add it via environment when you first start it. See here for details.

Barring that, your options are to use occ… See here for details. You’ll need to run it in the container and as the www-data (or equivalent) user.

Or, you can manually (and very carefully) edit your Nextcloud config.php.

1 Like

For option one…do I run this command from the windows powershell? I’ve seen the help comments on what to edit in the command line but not sure how to get to the terminal I am to use.

No… you need to run it in the container’s shell, as the www-data user. Normally you’d execute a shell with Docker’s exec command.

I’ve only used Docker on Linux so I can’t give specific Windows steps.

So I am really close I believe. I used the following command and it appears to be close…

docker exec -it container sh to get into interactive mode. Then I use
edit /var/www/nextcloud/confit/config.php.
I must be close as I get the error no write permission for the file.

Any ideas? again I don’t know programming so please treat me like an idiot.

First of all, which docker container is this?

I used the nextcloud container id. docker exec -it 88dc3aa4725808c4fd17a74cc5631b50ff883afaf3facbd8d9421dc4bed2c4a1 sh

No, what I meant was which image is used…

I used the apache Nextcloud docker

All right! Then easiest is probably this:

docker exec --user www-data -it 88dc3aa4725808c4fd17a74cc5631b50ff883afaf3facbd8d9421dc4bed2c4a1php occ config:system:set trusted_domains 10 --value=""

I entered above but it didn’t like the container so I removed the “php”.

I input this and got the error below.

PS C:\WINDOWS\system32> docker exec --user www-data -it 88dc3aa4725808c4fd17a74cc5631b50ff883afaf3facbd8d9421dc4bed2c4a1 occ config:system:set trusted_domains 10 --value=

OCI runtime exec failed: exec failed: unable to start container process: exec: “occ”: executable file not found in $PATH: unknown

Hello, please try:

docker exec --user www-data -it <container_name> php occ config:system:set trusted_domains 10 --value=""

You forgot to add php.

1 Like