Your Guide to the Nextcloud All-in-One on Windows 10 & 11!

Originally published at: Your Guide to the Nextcloud All-in-One on Windows 10 & 11! - Nextcloud

Setting up a Nextcloud All-in-One or AIO is a simple, effective way to achieve a full-blown Nextcloud installation with many features working out-of-the-box. It provides you easy deployment and maintenance of these features while allowing you to keep your data under your control.

In this blog, you will find the instructions for setting up an All-in-One on Windows 10 and 11. It is compatible with a PC with a x64 CPU with at least 8GB of RAM and 4 cores.

Before you start 🚨

First, you will need to get a public domain and be able to open ports for the guide to work. Also, make sure that you are not behind CGNAT as it will not work with that.

Please also keep in mind that the following instructions are meant for installations without a web server or reverse proxy (like Apache, Nginx and else) already being in place. If you want to run AIO behind a web server or reverse proxy (like Apache, Nginx and else), see the reverse proxy documentation.

With that, let’s get started!

Install Docker Desktop 🐳

  1. Download docker for Windows: https://docs.docker.com/desktop/install/windows-install/.

2. Execute the ‘.exe’ and install it.

3. Click on ‘OK’ to continue (WSL2 is recommended).

4. Wait until you see this screen: and click on ‘Close and restart’ in order to restart the PC.

5. Open ‘Docker Desktop,’ then read through and accept the Terms:

6. You should see this popup now and follow the link of the popup (https://aka.ms/wsl2kernel).

7. Click on the first link there (WSL2 Linux kernel update package for x64 machines).

8. Download the wsl_update msi and install it.

9. Now click on ‘Restart’ in order to restart Docker desktop.

10. Next you should see this popup after a while and click on ‘Skip tutorial’ in order to skip it:

11. Finally, Docker Desktop is ready and you should see this:

12. You should make sure that docker Desktop starts automatically when you log in by ticking the first value in the settings:

13. Make sure to enable ipv6-support for Docker now if you should be needing this by following this documentation.

Install AIO

After you’ve successfully completed installing the Docker Desktop, you can move on to installing your AIO.

1. Now open the command prompt:

2. Start AIO with this command:

docker run ^
--sig-proxy=false ^
--name nextcloud-aio-mastercontainer ^
--restart always ^
--publish 80:80 ^
--publish 8080:8080 ^
--publish 8443:8443 ^
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^
--volume //var/run/docker.sock:/var/run/docker.sock:ro ^
-e NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata" ^
nextcloud/all-in-one:latest

Make sure to adjust /run/desktop/mnt/host/c/ncdata to your needings. This path is equivalent to C:\ncdata on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with /run/desktop/mnt/host/. Append to that the exact location on your windows host, e.g. c/ncdata which is equivalent to C:\ncdata.

3. Then you can open the AIO interface at https://localhost:8080. ⚠️ Important: do always use an ip-address or localhost if you access this port and not a domain as HSTS might block access to it later! You need to accept the Self-Signed certificate, afterwards you should see this:

4. Click on Open Nextcloud AIO login and paste in your password:

5. Now you should finally see the AIO dashboard:

6. Next, type in your public domain that you set up before starting this guide. The interface should help you figure out the exact steps. (Set up DDNS for your domain to point to your public IP, port-forward at least ports 443/tcp and 3478/udp and 3478/tcp to your Windows machine.)

7. After you’ve set it up correctly, it should allow you to pass to the next step where you can configure wanted optional addons and the timezone and click on Start containers in order to download and start them.

8. Now you should see a spinner that will take a while (depending on your internet speed around 10min or more):

9. When all containers are downloaded and started, you will see this screen which shows the containers still starting which will do the first install for you:

10. When everything is done, you should see this screen:

11. You can now open your new Nextcloud instance and log in with the given admin credentials.

12. You should also open the Backup and restore section type in a path like e.g. /run/desktop/mnt/host/c/backup and submit it. This path is equivalent to C:\backup on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with /run/desktop/mnt/host/. Append to that the exact location on your windows host, e.g. c/backup which is equivalent to C:\backup.

That’s it! Now everything is set up and ready for production. ✨

Keep your data yours, through your new AIO!

For more information about Nextcloud AIO, check out the Github page.


This AIO manual and guide was created by team member Simon.

4 Likes

Hey, there is a pretty major update in recent (?) versions of Docker Desktop for Win. It seems that, to access actual drives in the system, instead of /run/desktop/mnt/host/c and similar you simply use /mnt/c and similar.

Here is a thread about this topic: mounting windows drive using api is not working ¡ Issue #5066 ¡ docker/for-win ¡ GitHub

Here is what one commenter there noted, for example:

in doker desktop 2.2.0.3 path is now more logical /mnt/{drive letter}/ still different and requires changes in thing like GitHub - bonigarcia/selenium-jupiter: JUnit 5 extension for Selenium WebDriver

So I couldn’t figure out why creating data and backup directories using /run/desktop/mnt/host/c/backup and * /run/desktop/mnt/host/c/ncdata* wasn’t working - giving all kinds of errors and also, nothing at all was appearing in the corresponding directories c://backup and c://ncdata.

Using /mnt/c/backup and /mnt/c/ncdata seems to work just fine.

Using directories like * /run/desktop/mnt/host/c/ncdata* still WORKED in some sense - but those are just ordinary directories under the Ubuntu file system and don’t relate in any way to the c:/ disk as you would expect.

There may be some variation here depending on exactly which version of Docker Desktop etc you are running.

But something to be aware of!

Also, my reasons for looking for the NextCloud data folder is, I set it up originally in the default location because I couldn’t get the /run/desktop/… business to work and appear on drive C:/.

Now I would like to move it to an large data drive - in my case, D:/.

But - where exactly in the Ubuntu directory structure IS that directory?

The answer is not very simple:

Quoting from that source:

Finally found a solution here:

  1. From Windows, create a disk for docker-desktop-data:

net use w: \wsl$\docker-desktop-data

  1. From your WSL distribution, mount it to docker:

sudo mkdir /mnt/docker
sudo mount -t drvfs w: /mnt/docker

Now you can get everything you want, in my case log files:

ls -l /mnt/docker/version-pack-data/community/docker/containers/

Great. I followed those instructions and they worked - except that path to the NextCloud data directory was different:

cd /mnt/docker/data/docker/volumes/nextcloud_aio_nextcloud_data/_data

Of course, it might be aliased in various other places as well. But that is one place to find it.

Also, it might be quite a lot simpler to use docker commands to copy from the relevant directory within docker. But if you were wondering where within the WSL and docker directory structure the (default) data directory is - well, that is the location.

At least for my version of WSL, docker, NextCloud, etc.

Here are other commands/locations/etc useful in updating the data directory location in NextCloud under Docker & WSL:

sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:mode --on

Location of config.php file:

/mnt/docker/data/docker/volumes/nextcloud_aio_nextcloud/_data/config/config.php (after doing the incantation above to link the docker desktop-data location to /mnt/docker)

However - it is easier to edit config.php within the docker desktop. Go to Docker desktop, click Volumes, go to volume nextcloud_aio_nextcloud, under Data find config/config.php - double click it to edit the necessary line (‘datadirectory’ => ‘/mnt/d/nextcloud_data’, or whatever your desired new directory is), then click save (the little disk in the upper right).

PERMISSIONS: You can’t change permission of a file or directory on a Windows drive as you normally can in linux or otherwise within WSL. You can chown until your belly turns blue but nothing changes (the files will normally be owned by the Windows user you are logged in as - mine always shown as bhugh:bhugh, for example, even if I tried to change it to www-data:www-data).

So you don’t need to worry about changing the owner or group - see extended discussion here: File Permissions for WSL | Microsoft Learn

The only thing you need to ensure - and problems here WILL stop NextCloud from starting properly - is that the NextCloud/docker has full access to the data directory, meaning that it can both READ and WRITE it.

You can probably do that within WSL via chmod, but is easier and more direct to visit the directory in Windows Explorer, check the properties, and make sure that “Read Only” is UNchecked for that directory and all sub-directories & files within it.

If the directory or files within it are set read-only, the nextcloud-aio-nextcloud container will continually re-start and give errors (not always entirely accurate in the context of WSL) complaining that the data directory does not exist or does not have the right content.

I Installed this when Docker was on version 4.18 and it all worked fine. I have done a new install with 4.27.1.0 and when I run the docker script to install the AIO container, I get an error about a socket not being connected and the container never starts.

I read a few links that said this should be fixed in 4.19, but I am having the same issues in 4.27. So, it this fixed yet?

Thanks all in advance.

Hi @Alan_Walker this problem was a bug in Docker Desktop 4.27.x and should have been resolved with 4.27.2. See connecting to docker socket inside container with different user than root is broken after updating to 4.27 ¡ Issue #13898 ¡ docker/for-win ¡ GitHub

Thank you for the reply, very much appreciated.

I have looked at the release notes page for 4.27.2, there is a Download Docker line, but it is not hyperlinked. Is there someone I can download this or are we awaiting an official release?

Best regards,
Alan Walker.