Enable HTTPS on Nextcloud

Hello community.

I’m trying to expose Nextcloud via HTTPS to the internet so I can access it from my mobile and the Windows app in a secure manner. But so far, all I got was blood sweat and tears.

So far, I’ve tried this in Github and this in Nextcloud docs with Z E R O success.

Is there an easy way/wiki/tutorial on configuring HTTPS on Nextcloud?

Thanks in advance

I’ll ping @louneskmt on this - I’m not sure if there’s a way to do this right now since everything is routed over tor, but I personally haven’t tried it yet.

1 Like

Thanks @jonsyu.

Is it possible to connect both the Android and Windows apps through Tor? Or in a secure manner out of the box?

Or currently Nextcloud is only secure on the internet consuming the web app via Tor?

Ok, I got it.

Solution: Add two new environment variables to the “~/umbrel/apps/nextcloud/docker-compose.yml” file:

  • APACHE_DISABLE_REWRITE_IP=1
  • TRUSTED_PROXIES= umbrel ip address(in my case)

Details: https://github.com/docker-library/docs/blob/master/nextcloud/README.md#using-the-apache-image-behind-a-reverse-proxy-and-auto-configure-server-host-and-protocol

@kerumirembora I added both lines to “~/umbrel/apps/nextcloud/docker-compose.yml” file, with no luck.
Still no https on nextcloud.
That is the only thing I need to do? If the case is not, could you please explain how u got it working step by step (sorry am a noob).
Thanx!!

Are you able to access it locally on your own LAN over HTTPS? Do you already have SSL certs loaded?

No to both.

Could somebody write a step by step guide on how to enable HTTPS on Nextcloud please?
I tried following what this post says, but I can’t seem to get it working.

5 Likes

Hello! I’m also looking for a solution to this.
Does anyone have step by steps?

Another new user, looking for simple plain english steps.
Fresh install of Umbrel & Nextcloud, working fine.
Own domain, routed & working fine.
Only http.
Want https.
Any pointers? Looked in the rest of this forum, but unfortunately no one seems to provide a decent guide for newbies.
Thanks in advance.

3 Likes

I second these we please need a step by step guide yall. Is there any security risk apart from MAn in the middle attack with using HTTP?

how did you access “~/umbrel/apps/nextcloud/docker-compose.yml” file ? Like where is that in Umbrel?

Same here. using umbrel to manage my nextcloud is not any use if i cant enable https with my new server…

Maybe you can have a safe route using cloudflare tunnels

I resigned looking for https problem since almost 2 years ago. At last i gave a suggestion that you can use today. It wasnt my intention to use big techs but its better than nothing in my opinion. Cheers.

really bad that https does not work. therefore impossible to properly use btcpay and nextcloud.

1 Like

( This is ancient but I guess this might be helpful for someone :slight_smile: )

I was able to enable HTTP using Nginx Proxy Manager, this should work for Nextcloud or any other app.

This is what I did:

  1. Got a fixed IP address from my internet provider. (This cost like 1€/month for me).
  2. Go to my DNS provider and add A record so mydomain points to my home IP.
  3. Access to my home router and make external port 443 point towards internal ip 192.168.0.33 (my umbrel machine), port 40443 (Nginx Proxy Manager listens to 40480 and 40433).
  4. Login to my Umbrel and install Nginx Proxy Manager App.
  5. Open Nginx Proxy Manager, go to SSL Certificates and add a Let’s Encrypt certificate for mydomain. I personally use a DNS challenge, that required to get API access from my DNS provider.
  6. In Nginx Proxy Manager, add a Proxy Host. Choose your domain name mydomain, scheme: http, Forward Hostname / IP: umbrel.local, Forward Port: 8081. In SSL tab pick your certificate. (I also marked Force SSL and Block common exploits)
  7. Test. At this point you should be able to access to https://mydomain.com and Nextcloud should tell you “Access through untrusted domain”.
  8. Go to Umbrel advanced settings, open terminal for nextcloud app.
  9. Simply run ./occ, it will tell you If running with ‘docker exec’ try adding the option ‘-u XXX’, where that XXX is the user id.
  10. Close this terminal.
  11. Again open a terminal, but this time for Umbrel OS. Then:
$ sudo -i
(type your umbrel password)
# docker ps | grep next | grep apache
(copy container id)
# docker exec -it -u XXX CONTAINER_ID /bin/bash
(Where CONTAINER_ID just comes from the command before, and user id XXX comes from step 9)

(Now you should be inside the nextcloud container with the right user)
$ ./occ config:system:set trusted_domains $(./occ config:system:get trusted_domains | wc -l) --value="mydomain"

  1. Test, now it should work.

(Notice mydomain should be something like nextcloud.mydomain.com, but the forum doesn’t want me to post to many “links”)

Hope that was helpful.

Alternatively, you can use a Cloudflare Tunnel.
It seems to work fine with the advantage of not having any port open in your home router. On the other hand, I assume Cloudflare itself can see all your traffic. Also not sure about the limitations of the free Cloudflare plan.

Anyway, you’d need to:

  1. Add Cloudflare Tunnel app in Umbrel.
  2. Follow steps here: How to set up Cloudflare Tunnel on your Umbrel · Radiokot/umbrel-cloudflared Wiki · GitHub
  3. Follow steps 7 to 12 above. That bit is the same.
1 Like