Replies: 11 comments 25 replies
-
Hi there!! first of all, thank you very much for you detailed explanation!. |
Beta Was this translation helpful? Give feedback.
-
Here is the compose file. I do not use any .env or config file apart from this. (Should I?) |
Beta Was this translation helpful? Give feedback.
-
Question: publicly available port 11000 That's not a problem, as you will not open this port on your internet router. You have got more open host ports. I.e. 9000 for Portainer, maybe 445, 139 for Samba etc. |
Beta Was this translation helpful? Give feedback.
-
Your completely right! After some (unseccessful) testing I found this not yet tested approach. One could bind the NC-Apache Container to host 127.0.0.1Accessing Host Services from Docker Containersdev.toAm 08.03.2024 um 11:16 schrieb 4lexRed ***@***.***>:
True - when using a DMZ (or alike) behind a router.
When using an exposed host (e.g. a rented vServer with public access) it is not true.
All my traffic to docker container has to pass the NPM.
I surely can block the port in the hosts firewall for external access, but why create a security risk in the first place, to patch it afterwards.
Should not be an issue for the NC-AIO team to use a keyword option to not (forcefully) publish the apache port on the host interface.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
YES! Otherwise I wouldn't put all the effort in my comment.
and so it's listening on interface
Yes! Recreating the master container will not recreate the apache container with the new settings. You have to really start from scratch as mentioned here 6. How to debug things?.
By the way: Your current setup exposes Port 11000 of the apache container to the public. If you would use network_mode host for NPM you would instead publish port 81 of NMP Here is my complete setup using traefik The two networks have to be created by
No need for fixed IP ranges or addresses. Of course "mydomain" has to be changed everywhere and the acme.json must have mode 600. Regards |
Beta Was this translation helpful? Give feedback.
-
One way could be to perhaps block port 11000 in the IPtables for all external traffic? Docker is quite good at punching holes in public facing VPS. Another could be to assign a non public facing interface to the VPS and exposing 11000 on that one? |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, official docs nor this guide really worked out for me. I had to pass It seems like this project's authors didn't verify those installation steps themselves as I see many people struggling with the simple task of running NextCloud behind reverse-proxy on VPS. That's depressing. |
Beta Was this translation helpful? Give feedback.
-
Hi SkydexI‘ll send you my setup this evening. You don’t need anything else as your current setup. No extra open ports etc. KlausVon meinem iPhone gesendetAm 05.06.2024 um 11:26 schrieb Skydrex ***@***.***>:
Hello, Klaus! Firs of all - thank you for your comments and sharing knowledge!
I have some difficulty with understanding how traefik and socat works
I will really appreciate if you can share step by step instruction on how to make it all work🙏🏼
I have docker host (ubuntu server 22, no gui) behind router with 443 and 80 ports NATted to docker host and want nextcloud to work correctly
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Fine! So you don’t need my setup anymore?KlausVon meinem iPhone gesendetAm 05.06.2024 um 13:13 schrieb Skydrex ***@***.***>:
I had to fetch Let's Encrypt SSL certificate and it worked
image.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
what is your config for the domain in npm in the "advanced" section? nextcloud is yelling at me that its insecure and all the android apps don't work, so i need to configure it but theres no online guides for that with NPM. just normal nginx but those configs don't seem to work right. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the detailed guide with explanations. I have not had any luck setting up nextcloud with a reverse proxy, and I have gone through loads of tutorials. I have used your guide, which made sense to me, however, still no luck. |
Beta Was this translation helpful? Give feedback.
-
Hey,
I just installed Nextcloud AIO behind a ngenix proxy manager on an exposed virtual server.
And I spent hours of searching why it would not start properly or why the nextcloud was not available under my domain name.
a simple alternative to the guide below
After fully writing this post and rethinking the issue I figured the following:
configure NPM to forward the dns-name nextcloud.yourhost.com to forward to port 11000 on 111.222.333.44 (your hosts public address) is the easiest and simplest solution to make NPM and Nextcloud AIO work together.
This works only for exposed hosts. [Behind a router this method fails. You need to follow the guide below]
Why this works:
As the Port 11000 is published on the hosts wan interface by the NC-AIO setup, the domain-checker-container (step 4) can be reached with this setting. Later, when the domain-checker-container is down and the nextcloud-aio-apache container is up, the later is reached via port 11000 (see screenshot for step 5 and 10 below fr an idea of running containers].
The longer, yet detailed guide
Here is my experience of the setup and a small guide to follow for the setup procedure with Nginx Proxy Manager.
It also gives a little bit of insight and understanding of what happens during the setup, as you can see the containers in portainer.
Note: pictures for the steps are at the end of this post
Download the compose file here.
It is well commented and does the whole setup of the npm, portainer, the Nextcloud AIO container and the network.
Please adjust the "path settings" for the data folders (I did not use docker volumes in the compose).
setup NPM and portainer (if not already happened)
Details on NPM settings below
once you have the nextcloud AIO container running, access the NC-AIO setup website by opening https://your.docker_hosts.public_ip.address:8080
Do not enter the the subdomain you want to use for your nextcloud (e.g. nextcloud.myhost.com).
The website will not open if you try to access via the subdomain (guaranteed).
Save the password in the first screen (I forgot to do it and had to reset the instance)
Login to the AIO admin site (using the password from step 2).
enter the dns-address (e.g. nextcloud.myhost.com) to the AIO setup interface.
Once you click submit, the check of the dns-address will fail. (This is were I was stuck for many hours)
open portainer and figure out which internal IP address the container "nextcloud-aio-domaincheck" has.
(alternatively to portainer: use the command 'docker list' or alike)
configure NPM to forward the subdomain (e.g. nextcloud.myhost.com) to port 11000 to the internal ip-address from step 5.
go back to the AIO admin site and click submit (just as you did in step 4) .
Now the address-check should work fine and the "domaincheck"-container will be stopped.
run the installation of the AIO containers with your preferred settings.
the installation procedure will eventually create a container called "nextcloud-aio-apache"
once the apache container is up, find its internal ip address (via portainer or docker list)
in NPM reconfigure your subdomain to forward to the hostname nextcloud-aio-apache
Hint: its actually better to use the hostname instead of the ip, but you can also use the internal ip address.
Be aware, the when tearing down and rebuilding the docker environment,
the "nextcloud-aio-apache" might get a different internal ip address and you might need to adjust the setting in NPM.
now you should be able to access your nextcloud instance via the subdomain you have chosen.
(optional) reduce the amount of open ports to your containers by adjusting the compose file (see npm setup section)
NPM setup
My host & NPM setup is simple: one exposed (runs with a public ip address) virtual server running all docker containers [link to compose file is above].
The Nginx Proxy Manger [aka npm] is NOT set to
network_mode = host
, as recommended in the guide reverse-proxy.md - and I oppose to do so as I want all traffic to be routed by the NPM.To reduce the amount of open ports on the host, once you finished the setup:
set up the forwarding in NPM correctly forward the subdomains to the ports of each container
check if your forwarding and the subdomains do work correctly
then comment out the published ports in the compose file except for port 443 at the NPM container
tear down the compose [via:
docker compose down
] and build it again [via:docker compose up
].After finishing the whole setup works with port 443 being the only open port.
In general it is recommended to use the containers names instead of ip-addresses, as NPM (or more precise: the Docker network) will translate the container names into ip-addresses.
"Error" in the reverse-proxy.md
In reference to the reverse proxy guide I want to explain one thing:
If the network_mode of the NPM is not set to "host", the Nginx Proxy Manager does not forward to the actual ip of the docker host when the forwarded host field is set to "localhost" (see picture for step 6).
Instead it forwards the requests to its own docker internal IP address (e.g. 172.18.0.2) on port 11000.
Hence the "nextcloud-aio-domaincheck" can never be reached with this setting and the admin (or user) is stuck with the error message "domain could not be checked".
Why I write this post
Walking through the configuration in the reverse-proxy.md I simply missed a clear explanation of the steps above during the setup process.
These should be mentioned under step 4 of the instructions for setting up the NPM reverse proxy.
And please at least mention at some point of the documentation that AIO creates an extra container for the domaincheck.
Question: publicly available port 11000
Is it possible to stop publishing the port 11000 - maybe via an environmental setting (aka keyword) in the compose?
This is a question interesting for server with direct access to the internet. If you are behind a firewall or at home, this question is of no matter.
At the state of writing the guide (March 2024), it was not easily possible to make the port 11000 not public.
In the posts below are a few attempts of how it can be achieved still to have the apache container not listening on the public.
I prefer a cronjob that deletes the iptables rule every now and then - but that is just me.
Pictures for the steps above
Step 1 - open AIO setup site & save your password (important!)
Step 3 - login
Step 4 - enter the dns name of your nextcloud instance
Step 5 - get the internal ip of the "nextcloud-aio-domaincheck"
Step 6 - edit the setting in the NPM to forward to ip-address from step 6
Step 8 - run the installation of the AIO containers
Step 10 - find the ip-address of the apache container
Step 11 - edit the setting in the NPM to forward to ip-address from step 10
Beta Was this translation helpful? Give feedback.
All reactions