Need help with last step of set-up process [Details inside]

Hello,

I am running a Raspberry Pi with a fresh install of Raspbian OS.

I have been following this tutorial and all has been going well apart from when I get to the last set.

I run the command

sudo chown www-data:www-data config apps

But I get the following output

chown: cannot access ‘config’: No such file or directory
chown: cannot access ‘apps’: No such file or directory

Please would anyone be kind enough to help me diagnose and solve the problem.

Many thanks in advance of your help :slight_smile:

Just checked the guide. It is a bit old, I hope you did not copy paste “$ wget https://download.nextcloud.com/server/releases/nextcloud-10.0.1.zip” but took the current “nextcloud-11.0.2.zip” instead ;).

According to the folder permissions I would recommend to use the script from admin manual which includes a slightly more complete and secure chown/chmod of all folders/files and would look like this, with the chosen folders in the guide:

#!/bin/bash
ocpath=’/var/www/html/nextcloud’
htuser='www-data’
htgroup='www-data’
rootuser=‘root’

printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
then
chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]
then
chmod 0644 ${ocpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
fi

According to your error:

  • Did you manually check, if the folders “config” and “apps” are inside the nextcloud folder as expected. Should be as they are definitely part of the archive.
  • Check that you are surely inside the nextcloud folder, when using “sudo chown www-data:www-data config apps” as there is no full path given. But I anyway would use the script above, which contains the full path and therefore it doesn’t matter where you run it ;).

But again as you are just installing nextcloud:

It is not recommended the leave the data directory inside web root / nextcloud folder. As yours is still empty it is now still easy to move it to another place and adjust the config.php accordingly.
See the security hardening guidance of the admin manual for this and other security recommendations :slight_smile:.

€: Ah little down your guide, moving of the data directory is also mentioned :+1:

seems to me you skipped one of the steps here :

$ sudo mkdir -p /var/www/html/nextcloud/data
$ sudo chown www-data:www-data /var/www/html/nextcloud/data
$ sudo chmod 750 /var/www/html/nextcloud/data

re-do these steps