Setting up nextcloud in docker

  • Hi everyone,


    I've recently tried to follow the guide to set up nextcloud with docker: [How-To] Nextcloud with swag (Letsencrypt) using OMV and docker-compose


    After going through it all I could not access nextcloud on home or external network. I think I've followed all the steps thoroughly. The only thing I've found that could be wrong is in the swag logs:


    "Unable to register an account with ACME server. The ACME server believes {myemail}@gmail.com, is an invalid email address. Please ensure it is a valid email and attempt registration again.

    Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

    ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container"


    I assume that this is the problem but I'm not even sure what it means or how to remedy it, the email is of course a real one and correctly spelt.


    Any advice would be great as this has been a pain in the neck after DBTechs guide didn't work properly either (only on my local network!)


    Thanks a lot,


    Rowan



    SIDE NOTE: I have set all of the folders on the docker-compose.yml to be on the drive which I store my media on, not by OS drive, is this acceptable?

  • KM0201

    Approved the thread.
  • Well, it would seem your port forwarding is incorrect given the error. How did you set that up

  • Well, it would seem your port forwarding is incorrect given the error. How did you set that up

    The guide says to "

    • port extern 443 to port 444 intern (IP of your NAS)
    • port extern 80 to port 81 intern (IP of your NAS)

    This is what I've done:



    FYI the left port column is external


    Thanks!

  • need to see your docker-compose for swag

    Hi, is this what you mean? I just copied and pasted from the guide. I also attached my swag config file I think


    ALSO: Since doing this I've not been able to access by SMB shares on my main PC. It's all a mess!

  • Rowr21

    Added the Label OMV 5.x
  • Hi, is this what you mean? I just copied and pasted from the guide. I also attached my swag config file I think


    ALSO: Since doing this I've not been able to access by SMB shares on my main PC. It's all a mess!

    Well, a couple of things come to mind.


    I don't use subfolder, so I can't really comment on swag's configuration.


    Not saying either of these are your problem, but I've set up nextcloud tons of times w/ duckdns.


    Regarding your nextcloud folders however... I would not put your /config and /data folders, in the same folders. Just a general observation, nextcloud typically locks down the permissions on the /data folder pretty hard, so it might be effecting the config folder.


    I would separate nextcloud and swag, and work on them separately. Get nextcloud working locally, then get swag working, then reverse proxy nextcloud through swag. I've always had an issue trying to get nextcloud going right out through swag and just find it easier to set up locally first, then set up the reverse proxy.


    Again I don't use subfolders, but subdomains... but maybe this will help.


  • Great thank you! I think I'll reset everything and try the guide you just sent over!

  • Do you have recommendations for a better way of doing it? I don't have to use duckdns i have other domains such as one from freedns, I'm not picky I just want it to work haha. Also now my server SMB shares don't show up anywhere anymore, even though I can connect through sftp. Every time I try add the location it crashes file explorer.

  • Do you have recommendations for a better way of doing it? I don't have to use duckdns i have other domains such as one from freedns, I'm not picky I just want it to work haha. Also now my server SMB shares don't show up anywhere anymore, even though I can connect through sftp. Every time I try add the location it crashes file explorer.

    Not really sure on SMB (I don't do windows)...


    As for setting it up.. if you follow what I posted in that thread exactly, it will work.

  • Not really sure on SMB (I don't do windows)...


    As for setting it up.. if you follow what I posted in that thread exactly, it will work.

    I'm very new to this so when the guide says "create your directories" does it matter what the directories are or where? I wouldn't know where to put them really

  • I'm very new to this so when the guide says "create your directories" does it matter what the directories are or where? I wouldn't know where to put them really

    You don't really have to create them, you can let the stack/docker-compose file do it.


    If you choose to create them before deploying the stack, then you just need to put them whereever you indicated in the stack (ie, the left side of the colon in your volumes).

  • You don't really have to create them, you can let the stack/docker-compose file do it.


    If you choose to create them before deploying the stack, then you just need to put them whereever you indicated in the stack (ie, the left side of the colon in your volumes).

    Ohhhh so I just have to choose names? something like

    /srv/dev-disk-by-uuid-6a71ed28-64ee-4445-bb6b-582e700f08a5/nextclour/config

  • Correct

    Hi again, sorry to pester you!


    I got a lot further this time and the guide is great. I set up swag:


    But I dont see any "swag park page"


    Also I completed the rest of the steps exactly but when I try head to the page it says the site can't be reached :/


    I get this error in nexcloud logs

  • I'm driving to work, but I just checked your domain and got the swag park page as expected. Try checking with a browser in incognito.


    I'll look at this further in a bit.

    Thanks, still no luck on incognito btw.


    Are there any settings I should have on in OMV? such as SSL etc


    I checked my ports in ssh with sudo lsof -i -P -n | grep LISTEN and it shows listening on 444,81 and 450 (2 processes each)


    Lots of nginx stuff listening on port 80 and looks like nothing for port 443


    Also it might be worth noting that the paths for the files I had to edit weren't identical to those in the guide but led me to the same files, for example i had nginx/swag not swag/nginx. I think this is because I called the folder before :/config /swag

  • Yeah unfortunately I can't predict how people set up their paths. I'll probably be busy for a bit, but I'll try to look at this in a bit.

  • I wonder if you're dealing with that loopback issue I've read about.


    Take a device that is not on your home network (ie, a phone, tablet, etc. that has internet and is not connected to your wifi).. and navigate to your domain


    https://www.your-subdomain.duckdns.org


    and see if you see the park page. I'm still seeing your park page and it looks like everything set up normal.


    I believe it was Zoki who mentioned a while ago some users having a "loopback" issue, where you can't access a domain from the network the domain is hosted on.

  • Yes, the dns resolves to you external IP even in the local network (if you do not have a seperat internal DNS server which gives it a different IP).

    Some routers do not apply the port forwarding and then you end up on a different port. And you are accessing the router with an internal IP.



    Hi, is this what you mean? I just copied and pasted from the guide. I also attached my swag config file I think


    ALSO: Since doing this I've not been able to access by SMB shares on my main PC. It's all a mess!


    I was away and did not follow what is going on, but did you notive the error message abaout an invaild email address and to mee it looks the error mesage is corret.. it has a comma after the gmail.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Yes, the dns resolves to you external IP even in the local network (if you do not have a seperat internal DNS server which gives it a different IP).

    Some routers do not apply the port forwarding and then you end up on a different port. And you are accessing the router with an internal IP.

    Unfortunately the nextcloud problem was secondary as he can't get to his swag park page from his home network (even though I got to it no problem)... so in turn he won't be able to get to Nextcloud via domain. He can still set it all up and use it remotely.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!