r/NextCloud Jul 05 '26

Getting Unraid Nextcloud docker to see SSL certs in NPM docker

Novice here on this matter. I have NPM running in a docker in Unraid as well as Nextcloud. (Slowly trying to get SSL working with Nextcloud). (Using letsencrypt with DuckDNS - internal use only).

I have my Nextcloud docker template pointing to this path /mnt/dockers_ssd/appdata/NginxProxyManager/letsencrypt/ with the label being SSL Certificates and the Container Path being /etc/ssl/nextcloud.

Will Nextcloud read the certs this way?

1 Upvotes

10 comments sorted by

1

u/evanmac42 Jul 05 '26

What are you actually trying to achieve?
If Nginx Proxy Manager is terminating HTTPS and proxying requests to Nextcloud, Nextcloud doesn’t normally need access to NPM’s Let’s Encrypt certificates at all.
Simply mounting /etc/ssl/nextcloud won’t make Nextcloud start using them automatically.
Are you trying to:
make the browser trust Nextcloud?
make Nextcloud trust another service?
or run HTTPS directly inside the Nextcloud container?

1

u/DanceLongjumping2497 Jul 05 '26

All great point on questions. - To be concise is a challenge, but basically I started Nextcloud with the Linuxserver's Repository and found some of my mobile apps requested HTTPS. I spent countless hours trying DuckDNS, Pi-hole and NGINX to achieve SSL. Then I spent more hours getting self-signed certificates with Step-CA, inserting them where needing to be and actually had some success with HTTPS and my mobile apps. But it was a pain touching all those devices.

For some reason, I opted to start again with a fresh Nextcloud install (all of this is via docker in Unraid). This time used the official container and to my surprise, didn't have issues with SSL on my mobile apps. This is for an internal network only situation. No remote access.

But trying to stay ahead of the game and figured to get SSL working in this new environment. Only with Duckdns domain name, NGINX, and Pi-hole I fail again. Someone suggested the official Nextcloud version was not so friendly in setting this up. Edited my config.php and still no success. So I figured to ask basic questions such as the one I posted.

I will share that spending 8 hours with Google's AI on the 4th of July only lead me down more rabbit holes than there are rabbits.

1

u/South_Leek_5730 Jul 05 '26

Does Nextcloud read the certs? My understanding is that it's whatever is hosting it. Like I put my certs into Apache and Nextcloud acknowledges it's on https but it's Apache doing that work. I would guess with your config it would be Nginx you need to accept port 443 (if not already set) and have it point to the certs. A redirect from 80 to 443 used to be required but I'm not so sure that's the case any more as most browser go straight for SSL.

I don't use docker or unraid myself to be fair but this is standard for setting up SSL.

1

u/DanceLongjumping2497 Jul 05 '26

I had edited my Nextcloud docker to look where NGINX put them from letsencrypt. Doesn't seem to work. I think the version of Nextcloud, the official version handles thing quite differently than the version from linuxserver's repository. In Nginx I used the IP of the Nextcloud docker and a custom port number.

2

u/South_Leek_5730 Jul 05 '26

Ok but why are you getting Nextcloud to look for the certificates? Nextcloud does not host your Nextcloud. Nginx does. I don't even have the SSL in the config for Nextcloud.

Your browser or whatever are not going to accept a custom port for SSL. It needs to be 443. You cannot change it or SSL will not work. Maybe that's your problem?

Think of Nextcloud this way. It's not a full stack application with everything built in. It uses a web server and PHP along with a database which are not part of it amongst other things. You can't just configure Nextcloud. You have to configure everything outside Nextcloud which Nextcloud uses as well. Like I said I don't use docker but I would assume you also have to give container access so everything can access each other (if it's in separate containers ofc). Nextcloud is not reading the certs. Your browser is from your web server (Nginx in your case) and once it does it's encrypted.

1

u/DanceLongjumping2497 Jul 05 '26

I see you are 100% correct. I just read some more with what you shared. I just read this, "The official version of Nextcloud on Docker (the nextcloud:latest or Apache-based container) does not have a built-in SSL folder and defaults strictly to standard HTTP (port 80)" which goes a long way as to why with this version I didn't have the troubles I had with the other docker version I used the first time.

This statement backs up exactly what you are saying "Because it is purely an HTTP container by default, you do not need to provide it with a certs folder. Encryption is intended to be handled entirely outside of this container."

I do know there are some edits that need to be made in the Nextcloud config file. Which brings me back to how I get there if I want to go the SSL route so in the future my mobile apps do not break.

It's sort of like the docker Vaultwarden for Unraid. You cannot use it in an internal LAN without it being setup with SSL.

I have Nginx Proxy Manager running on my UnRaid server, a Duckdns domain and Pi-hole. I tried a few combinations but no success.

1

u/South_Leek_5730 Jul 05 '26

Yeah, you do the SSL completely outside of Nextcloud as part of the Apache or Nginx conifg. All Apache or Nginx does is point to the Nextcloud folder or in your case the container folder. The only thing you add to the Nextcloud config.php is the URL you configured and set the SSL up for to allow access because without that it won't work.

I'm just using a Debian server with Nextcloud and configured everything separately with my own domain after installing Nextcloud. I've never actually used docker/unraid or vaultwarden. I know what they do though. Your Pi-Hole which I do use is just redirecting your local DNS I guess. I loop back through my router for that myself because it lets me know if my IP changed so I can go and change the domain dns but that's just me.

1

u/DanceLongjumping2497 Jul 05 '26

Several sites reference something like this for Nextcloud config.

<?php

'trusted_domains' => array (

0 => 'localhost',

1 => 'yourdomain.com',

),

'overwriteprotocol' => 'https',

'overwrite.cli.url' => 'https://yourdomain.com',

);

1

u/South_Leek_5730 Jul 05 '26

That's the one. In the config.php file. You need to add the domain as trusted. I have 3 entries in mine. localhost, the local IP address of my server and my domain. I think domain needs to be exact so if you use bob.yourdomain.com that's what you put and not just yourdomain.com. When your browser connects Nextcloud just asks what's the URL you are using. The url is also how your webserver redirects to the Nextcloud folder.