[GUIDE] Nextcloud on WD My Cloud

I have a WD My Cloud, too. I always use Windows OS. As the WD My Cloud Desktop is not working a long time, and I have to visit it by Western Digital. While my WD device has not been able to connect mostly. It makes the device becomes a storage disk at home.
Coincidently I found this post. While I know almost nothing about this. Although I tried and searched a lot, it seems still very difficult for me.
Following your steps and my understanding,

  1. I installed a Docker Desktop on my Win10, not run a NextCloud image till now.
  2. I applied a free domain online.
  3. I set and open the port 80 and 443 in the router.
  4. I installed a PuTTY to into My Cloud.
    That’s all I did. And I am stuck here and I don’t how to do next. I think I have a misunderstanding on Step 1. Please give me more guide.
    And I want to make sure if it works finally, does that mean I can access my cloud using the NextCloud’s applications for Desktop and mobile?

If you can’t get past step 1, this guide won’t be for you. Sorry mate.

I’ve been playing with Owncloud and Nextcloud on lighttpd via Entware on an EX2 Ultra box and added my findings here:

I added these features to the original guide:

  • LetsEncrypt certificates
  • Redis cache
  • MySQL data store
  • Browser caching for better browser experience

It’s an alternative to the docker based setup and seems to be a bit more stable.
I may even put all of it into a simple package.

there are plans to officially support the nextcloud

There’s no official support planned.

But I did spend a lot of time tweaking my entware based installation and it runs way smoother than the docker based installation. I also have a workaround for the disabled WD web interface.
I’d say, stay tuned and subscribe to this topic as a huge update is on the way.

1 Like

At first: thanks a lot for this Guide !.
My NextCloud with Docker installation is already finish. :slight_smile:

Only one question :grimacing:: How do I connect my NextCloud container to the MySQL database?

Using the standard SQlite I can setup the NextCloud without issues, but if I try to change the Database (at the setup beginning) an error message appears saying the following :
“Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory”

My NAS: PR2100 FW: 2.31.195


Thanks in advance for any help

Regards!

The WD OS runs a MySQL server.

ps w | grep mysql
netstat -tulnp | grep 3306

Either you stop this server or you run the docker MySQL on another port.
I’d suggest to remove all containers (docker-compose down and docker container prune).
Then setup again and verify the db container is running

docker ps

I believe I had to link them in the last field with 127.0.0.1:3306, I remember some issues with name resolution for localhost.

Check the docker logs for anything going wrong.

Thank you so much for your help Tfl :smiley:!.

The solution was:
1 - I completed the Setup instalaltion again using the standard SQlite DB
2 - Using the “Portainer” I just add this Container: - apache_app_1; apache_letsencrypt_companion_1; apache_proxy_1 to the “Network” : apaIche_default (see image attached).



3 - docker-compose down
4 - COMPOSE_HTTP_TIMEOUT=120 docker-compose up

and now the docker container is connected to the MySQL DB.
I have no Idea why , but I’m very happy to see that is working fine.

And thanks again Tfl for your help and for this incredible GUIDE!

Best Regards!

1 Like

Glad it works for you. I think you may remove that apache_proxy-tier network, just put all containers in a single network.

Hello !

Question, by typing this command:

docker-compose up -d

i get this error:
-sh: docker-compose: not found

Any Ideas ?
Many Thanks.

I don’t get past “pip install docker-compose” keeps saying not enough space on the device.
Any idea what I can delete or something? I tried using the -t option but it doesn’t work…

As mycloud.com is down since more than ten days, I’ll give nextcloud a try. However, one question in advance before I try: Does “web interface” refers to the web frontend accessible via mycloud.com or to the admin frontend accessible from your LAN? If the latter, how do you admin your device than? Thanks.

Thanks a lot for your efforts. Are there any updates on the entware based installation?
Does this guide also work on the EX2 Ultra on My Cloud OS 5?

Regards

See GitHub - WDCommunity/wdpksrc at nextcloud

I didn’t manage to make if fully dummy proof, so it won’t work out of the box.
But I’ve been running this on an EX2Ultra for a while and it was way better than the docker version, especially when I preprocessed the pictures with libepeg (2 to 5 times faster than libjpeg) to generate previews and thumbnails.
Unfortunately it’s been left untouched for a while now.

I’m very interested in this project.

I have laying around a My Cloud HOME (MCH), and I was wondering if this version is capable to run the NextCloud.

I know it’s a ARM CPU and there are some instructions here form ARM CPU, but in the 3rd party applications I see no reference to the to the MCH version bin file.

Would be great to be able to change to NextCloud.

Hi,in your case,nextcloud container do not share an IP with MySQL server, so if you want to connect nextcloud to mycloud built in MySQL:

  1. MySQL user ‘username’@‘%’ must be created
  2. The IP(the same as Mycloud LAN IP) of MySQL sever instead of “localhost” in nextcloud initialize page

Even if you can connect to the buildin MySQL server,there is still something error(utf8mb4 problem) because the version of MySQL is too low.I haven’t figure out how to solve this yet

Nice tutorial! Bit late to the game! :smiley:

The file /usr/local/apache2/conf/extra/ports.conf on my PR4100 looks completely different that what’s shown in this tutorial.

root@MyCloudPro home # cat /usr/local/apache2/conf/extra/ports.conf
Listen 127.0.0.1:8000

I’m running My Cloud OS 5 Firmware 5.22.113.

Is there any other file to change the ports 80 & 443 for the WD Dashboard?

Edit: /usr/local/config/config.xml contains the config to the web interface including a line with ‘port 80’ in it.

root@MyCloudPro home # cat /usr/local/config/config.xml | grep -B 3 -A 1 '>80<'
		<web>
			<ssl_enable>0</ssl_enable>
			<ssl_port>8543</ssl_port>
			<port>80</port>
		</web>

Update July 2023

Is there an updated guide on this?
I am running mycloudEx2Ultra with os5.
I have installed ‘Docker version 19.03.8, build afacb8b’ and pulled the latest nextcloud image.
I downloaded the bin from:

This is not the same version, maybe dual installation or something?

After running ‘$ docker run -d -p 8080:80 nextcloud’, the container starts up, I can connect to it to create the admin account, but the webserver seems to return http code 408 a lot. Also after creating the admin account, logging in doesn’t work. I tested it on my local machine and here it works fine, also tried it on an arm processor (raspberry pi), worked fine. Am I missing something?

The log:

Initializing nextcloud 27.0.0.8 ...
New nextcloud instance
Initializing finished
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
==> but the hook folder "before-starting" is empty, so nothing to do
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using docker_ip. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using docker_ip. Set the 'ServerName' directive globally to suppress this message
[Sun Jan 00 00:00:00.000000 1900] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.2.7 configured -- resuming normal operations
[Sat Jun 08 12:37:33.'''(+, 1935] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET / HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET / HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /favicon.ico HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /favicon.ico HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /favicon.ico HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET / HTTP/1.1" 200 4227 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/css/server.css?v=value HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /apps/theming/css/default.css?v=value HTTP/1.1" 200 1606 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/css/guest.css?v=value HTTP/1.1" 200 5076 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/css/server.css?v=value HTTP/1.1" 200 17428 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:22:01 +0000] "GET /core/l10n/en_GB.js?v=value HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /dist/core-common.js?v=value HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /dist/core-install.js?v=value HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/actions/toggle.svg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:22:01 +0000] "GET /dist/core-install.js?v=value HTTP/1.1" 200 3334 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/actions/caret.svg HTTP/1.1" 200 655 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/actions/toggle.svg HTTP/1.1" 200 830 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /dist/core-main.js?v=value HTTP/1.1" 200 51627 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /dist/icons.css HTTP/1.1" 200 30740 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /apps/theming/img/background/kamil-porembinski-clouds.jpg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /apps/theming/img/background/kamil-porembinski-clouds.jpg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /apps/theming/img/background/kamil-porembinski-clouds.jpg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/logo/logo.svg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:22:01 +0000] "GET /apps/theming/img/background/kamil-porembinski-clouds.jpg HTTP/1.1" 408 483 "-" "-"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/logo/logo.svg HTTP/1.1" 200 1338 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /apps/theming/img/background/kamil-porembinski-clouds.jpg HTTP/1.1" 200 190819 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /dist/core-common.js?v=value HTTP/1.1" 200 3636812 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/vendor/zxcvbn/dist/zxcvbn.js HTTP/1.1" 200 400212 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:21:37 +0000] "GET /core/img/favicon.ico HTTP/1.1" 200 3797 "-" "Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.95 Safari/537.36"
IP_of_client - - [08/Jun/1935:19:22:01 +0000] "-" 408 0 "-" "-"

HTTP code 408 means that there was a timeout while during the request.

This happens a lot with HDDs since they have low IO and are not suited for applications like NextCloud.

Seems difficult to believe that nextcloud is not able to run on a HDD…

Update:
Reinstalled docker from Release Docker v20.10.14 for WD My Cloud · WDCommunity/wdpksrc · GitHub.
Now the nextcloud image works fine.