docker, nextcloud, nextcloudpi

NextCloudPi dockers for x86 and ARM

I would like to introduce a new set of NextCloudPi dockers.

Finally, it seems that the upstream docker containers both for x86 and ARM are caching up in terms of reduced size. That is great news because it relieves the burden of creating and maintaining the minidebian and miniraspbian base images.

This means that we can finally rebuild the NextCloudPi container easily on top of Debian Stretch. The result of this is a set of containers for different architectures that can be generated from the NextCloudPi codebase.

We now have

  • Nextcloud docker container for ARM: ownyourbits/nextcloud-armhf
  • Nextcloud docker container for x86: ownyourbits/nextcloud-x86
  • NextCloudPi docker container for ARM: ownyourbits/nextcloudpi-armhf
  • NextCloudPi docker container for x86: ownyourbits/nextcloudpi-x86

You can find them in dockerhub

We will also have arm64 containers, as soon as I set up my new odroid HC1 to create the images.

Nextcloud containers

These contain only Nextcloud, Postfix and so on but no other software or management interface. You still have to do your certificates and networking yourself.

This used to be known as the nextcloudpi container before.

NextCloudPi containers

The difference between nextcloud and nextcloudpi is that the latter contains also ncp-web, letsencrypt, DDNS, package autogrades and many other NextCloudPi features.

The first goal of creating this container was to facilitate an easy x86 development environment for NextCloudPi. We have this today.

The second goal, looking into the future, is to provide a docker image that benefits from the NextCloudPi web panel and package of related services, such as Let’s Encrypt, DDNS, unattended upgrades or backups. Nextcloud needs a bunch of networking, system configuration and management, and our goal is to simplify this.

At this moment, the extra NextCloudPi layer contains a subset of the options available in the SD image. Some options, such as wifi management don’t make sense at all inside a container, and others still need some work to be adapted.

As usual, help, issue reports and sugestions are welcome.

Installation

See this other post in order to setup docker on your Raspberry Pi if you haven’t done it yet.

Docker is the only requisite, but it is also nice to install docker compose for easier management.

For instance, in Arch

Or in Debian

Usage

The usage has not changed. If we are not in localhost, we need to provide the IP address or domain in order to be included in the trusted domain list.

The first time it will take some seconds to do the initial configuration, wait until you see ‘Init done’ in

Then, you can log into Nextcloud

, or the web panel

If you want to have your persistent volume in a particular folder, you can pass an empty folder as an argument

With docker-compose (optional)

First, clone the repo to get the compose files

Then, run one of them with compose up. Examples:

Notes

For nc-forward-ports to work, you need to run with –net=”host”, or setting up the docker0 bridge address to that of your local network, or use the macvlan driver. All of those are advanced or reduce isolation, so I would recommend to do the port forwarding manually at this point.

Author: nachoparker

Humbly sharing things that I find useful [ github dockerhub ]

16 Comments on “NextCloudPi dockers for x86 and ARM

  1. Hi

    I’m not Completely awere what is a docker container. What is the advantage in relation to the traditional nextcloudpi? This means that I can install the cloud having no Noobs for example? Don’t understand. This docker concept is strange to me

  2. Hello,

    thats all sounds good, but I could not get the docker image working. Maybe I use the wrong image.
    I want to use a docker image for NCP (with Db etc) on a ROCK64 board.

    Which Image ist the correct one?

    Thank you

    Regards
    Thorsten

  3. Hi there,
    is there a (video) tutorial on how to set up NextCloudPi in Openmediavault using dockers (RasPi 3B+)?
    As I am quite new to all of this I have troubles choosing the right settings after downloading the ARM docker image.
    Any tips are very welcome 🙂 Thank you!

    1. There sure is! …well, kind of! I’m relatively new to Docker too and was having trouble sorting it out, and was getting frustrating because I could just tell that it must be something easy/obvious that I was missing!

      The videos that I happened upon which helped me to understand it all and made it all “click” were from a YouTube channel called “Techno Dad Life”. There isn’t a video specific to NextCloudPi – although there is one for the ‘regular’ NextCloud, which is a more involved process – but starting towards the beginning of his catalog and working my way forward helped me to understand it all, and I found some cool new Docker ideas too!

      https://www.youtube.com/channel/UCX2Vhc0LIzSS9aMzhGFZ7PA/videos

      1. Hey Justin,

        thanks for your reply!

        Actually I came across the same channel a few days ago 😉
        I followed the steps in the video (just with arm versions of Mariadb and NCP). But in the end I can’t open the IP adresses to get to the NCP or NC interface.
        Did you manage to run NCP? Were you adjusting other settings than the ones in the video? What ports did you choose?

        1. Yup. I sure did get it going, and you can too! Perhaps the key thing to realize is that the NextCloud image TechnoDadLife is talking about is the regular NextCloud, and not our beloved NextCloudPi and all of it’s pre-packaged glory!

          In case you’re as new to this Docker thing as I recently was, you can run these Docker commands via the command line, with flags for each of the desired settings. Alternatively, you can do it via the Docker addon within OpenMediaVault (for example). Both accomplish the same thing, but the OMV addon just is a nice, graphical interface for it.

          Moving to it, then….. To do NextCloudPi instead, you can see the full directions here: https://ownyourbits.com/nextcloudpi/ You’ll note that many of the instructions for NCP are much simpler than the TechnoDadLife video would indicate, since NachoParker has done so much good work for us already! Instead, you mostly only need to specify the ports and the domain you’d like.

          For our purposes here, I’m assuming that the device we’re using has an IP of “192.168.1.100” and some port numbers which I discuss below – modify them as necessary for your setup. My summary version is below.

          1) ‘pull’ the ARM-based image of NCP, called “ownyourbits/nextcloudpi-armhf”, instead of the “linuxserver/nextcloud” in the TechnoDadLife video. More info available here: https://hub.docker.com/r/ownyourbits/nextcloudpi-armhf/ Other versions are available, too, not just the ARM-based version.

          2) Choose the ports you want to assign for your Container. Understand that there are two different elements within each pair of ports: the internal port which operates inside the container, and is already set, and separately, the port you choose outside of the container which Docker auto-magically passes through to the container within. As I understand it, your chosen port can be anything you’d like as long as it isn’t already chosen on that device (e.g., Raspberry Pi, PC, etc). In the provided Docker Hub link, this is the portion of the run command which begins with “-p” (for port). For the purpose of this little walkthrough, let’s use port 79 associated with 80, 442 associated with 443, and 4442 associated with 4443.

          Also, this is nice, since it allows you to have multiple separate Image/Containers running which would otherwise conflict for ports 80/443, which are the default web-related ports (for un-secured and secured URLs, respectively). For example, these ports clash with your existing instance of OpenMediaVault. More on this below.

          3) As most Docker images do, the NextCloudPi image allows you to mount a folder(s) outside of the container (e.g., your user’s profile data). This isn’t strictly required, but it makes it such that your generated data isn’t wiped away by the removal any a container and can be re-mounted in another container instance. In the provided Docker Hub link, this is the portion of the run command which begins with “-v” (for volume).

          4) For now, you can ignore the “$DOMAIN” portion listed in the run command as shown on the Docker Hub page. I don’t know that this is the best way, but it works, and we’ll come back to it in a moment.

          5) In a web browser, go to the IP of the device you’re launching this on, followed by the port you chose for the secure (https) access. For example, https://192.168.1.100:442

          Note that you’ll have to manually include the “https://” portion. I suspect that this might be done slightly differently if this weren’t done via Docker and/or if you didn’t skip the “$DOMAIN” thing as I suggested above. Regardless, this works.

          This will take you to a screen warning that the certificate is not valid, etc., but go ahead and proceed – this is simply because you are accessing it through your local network and not via a URL which you’ve aquired an SSL certificate for. You can do that later with LetsEncrypt, within the NCP web panel once it’s up and running. Once you proceed, it will take you to an Activation website. This screen shows that your default username is “ncp” and then auto-generates a random password for your NCP web panel (port 4442) and for your actual NextCloud instance (port 442). COPY THESE DOWN and then click “Activate” near the bottom, which will take a few moments to completely run.

          6) Once you’ve patiently waited for the activation process to complete, it will re-direct to a different page. Loading of this page will fail, however, since it defaults to the 4443 port and we’ve chosen a different port. So, in the browser’s URL bar, correct this to read “https://192.168.1.100:4442”.

          7) Again, it will yell at you about an invalid certificate. Don’t sweat that for now, and proceed anyway. It will now ask you for a username and password. Enter “ncp” for the username and the auto-generated password for the “nextcloudpi” that you copied down in Step 5.

          This is a NextCloudPi-specific web panel for accessing all the cool additions that have been baked in to NextCloudPi. For example, this is where you’d add an SSL certificate via LetsEncrypt, for secure access via the internet if you’d like (HIGHLY recommended!).

          I’d recommend first clicking “nc-update” in order to update the NCP web panel, and then “nc-autoupdate-ncp” and check the active box and apply, in order to have it automatically do that from then on.

          Also, IMPORTANT: click on “nc-trusted-domains”. Here we’ll want to add the local network IP (192.168.1.100) and any domain(s) you want to access it from via the internet – more below on that. If you don’t do this, it will not allow you to even log in to your NextCloud – more below on that, too.

          8) Once satisfied with the web panel, you can move to access your actual NextCloud instance, returning whenever you’d like. To move on, again modify the browser’s URL bar, this time to say “http://192.168.1.100:442” For your admin account, enter “ncp” as the username and the auto-generated password for the “nextcloud” that you copied down in Step 5. This is the actual NextCloud instance, and where you could add additional users, and set up NextCloud as you normally would.

          9) At this point, you are up and running. However, you’ve only accessed it via your local network (e.g., 192.168.1.100), and not made it accessible via the internet (e.g., subdomain.domain.net). For that, you’ll want to either get a DDNS URL within the web panel of NextCloudPi and/or get your own domain.

          However, to have those domains point to your actual instance of NextCloud, you’ll have to setup a reverse proxy somewhere within your network and have that domain forwarded to the ports we chose for our running container (e.g., 442). This is where you’d want a valid SSL certificate, and the browser would stop yelling at you about the invalid certificate. A reverse proxy is outside of the scope of this impromptu writeup, but could be another fun Docker Container experiment for you! I know people like “nginx” or “traefik” for a lightweight use, such as this use-case.

          ….OK. I hope that helped some. I’ve assumed that you didn’t know things that I also didn’t know/understand until recently, and I hope this is correct (enough). It has worked for me, but anyone can PLEASE chime in if you know of anything simpler and/or I’ve done something against best practices.

        2. Wow! Thanks for that detailed instructions! This is really helpful for everyone who is new to the topic. Really appreciate your effort!

          I had NCP running on my Raspi before. (So I am somewhat familiar with steps 5) to 8).)
          I came across docker and wanted to try that because it has more possibilities.

          I was/am setting up NCP via the Docker addon within OpenMediaVault, not via the command line.

          It seems that the ports which I chose were not working properly. I still don’t know why.
          Now I use port 81 associated with 80, 442 associated with 443, and 4443 associated with 4443. When I had 4442 associated with 4443 I had access to the NCP interface but no matter what I wanted to do (e.g. nc-update) it said ‘Invalid origin’.

          So, for now it’s working from inside my network.

          My next step is to open ports, enable Let’s Encrypt and set up my DNS.
          What I don’t understand: Do I have to open ports 442 and 81 (in my case)? Or do I have to open 443 and 80?
          I allowed automatic port share in my router settings, but nc-forward-ports didn’t work for 443, 80 nor for 442, 81.
          Does the Let’s Encrypt certificate that I want to get has to be set up for the whole OMV server or just the NCP docker instance?

          Don’t feel forced to reply, please. My lack of prior knowledge and the fact that I don’t know anyone who I can ask in person make me desperate to write on here. I am just really keen to get this working.

        3. What I discovered:
          To be able to have access from outside your network 443 and 80 have to be open (442 and 80 for example is just not working).
          Also, when I choose a custom container path where data volume will be created, it is not working.
          I let the field ‘container path’ blank one time and then it worked.
          But when I can’t choose the container path, I can’t find the Nextcloud folder. And where the Nextcloud user data is stored is another mystery..

          ‘Easy to set up for non technical users’ was the reason why I gave NCP a try. Turns out that doesn’t count for NCP in docker.

        4. The docker way is a bit more advanced. For one thing, you need to be familiar with docker. The port usage and all the rest has been explained in the wiki.

          Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *