Nextcloud url on Windows/Ubuntu does not respond after changing data folder

I successfully installed nextcloud by following Then I tried to change data folder to external drive, as per the instructions in it, and after that http://localhost/nextcloud/ is not showing anything. It takes me to http://localhost/nextcloud/index.php/apps/dashboard/ but hangs there, no error. The drive is accessible through windows file manager but I don’t see it in ubuntu.

Commands executed to change the drive -

sudo cp -r /var/www/html/nextcloud/ /mnt/n

Updated ‘datadirectory’ to

sudo chmod 0770 /mnt/n/data
sudo chown -R www-data:www-data /mnt/n/data

Operating system and version: Windows 10 home, Ubuntu 22.04
Apache or nginx version: 2.4.52
PHP version: 8.1.2

The issue you are facing: No response from localhost/nextcloud

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install NC on windows 10 as mentioned above
  2. Change the data folder as mentioned above
  3. Open http://localhost/nextcloud/

The output of your Nextcloud log in Admin > Logging: This is from /var/www/html/nextcloud/data/nextcloud.log

{"reqId":"iLlUqfQvtzHdrYm2FFx5","level":2,"time":"2023-06-13T23:39:16+00:00","remoteAddr":"::1","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was >{"reqId":"iLlUqfQvtzHdrYm2FFx5","level":2,"time":"2023-06-13T23:39:16+00:00","remoteAddr":"::1","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was >{"reqId":"lhWzPhFR1RoI9RAM9zwK","level":2,"time":"2023-06-13T23:40:58+00:00","remoteAddr":"::1","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host localhost was>{"reqId":"lhWzPhFR1RoI9RAM9zwK","level":2,"time":"2023-06-13T23:40:58+00:00","remoteAddr":"::1","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host localhost was>{"reqId":"NYb9WmDuSdapz9JUXcEf","level":3,"time":"2023-06-13T23:41:30+00:00","remoteAddr":"::1","user":"nc2023","app":"PHP","method":"GET","url":"/nextcloud/index.php/settings/apps/list","message":"dns_get_re>{"reqId":"ISsJBT35FvW8DuIXzA8x","level":3,"time":"2023-06-13T23:42:22+00:00","remoteAddr":"::1","user":"nc2023","app":"index","method":"GET","url":"/nextcloud/index.php/core/preview?fileId=43&x=250&y=250","me>

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!): output of /var/www/html/nextcloud/config/config.php

$CONFIG = array (
  'instanceid' => 'oc5vzw323t9o',
  'passwordsalt' => 'cB+...',
  'secret' => '/...',
  'trusted_domains' =>
  array (
    0 => 'localhost',
  'datadirectory' => '/mnt/n/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://localhost/nextcloud',
  'dbname' => 'nextdb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '...',
  'dbpassword' => 'nc@...',
  'installed' => true,

The output of your Apache/nginx/system log in /var/log/____: Don’t know the path

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary. - Already provided above


I changed the drive format from NTFS to exFAT and made a little progress after mounting the N drive in ubuntu. Now I am getting error -

/mnt/g/dataYour data directory is invalid. Ensure there is a file called ".ocdata" in the root of the data directory. Your data directory is readable by other users. Please change the permissions to 0770 so that the directory cannot be listed by other users. 

I am getting error for /mnt/g/data though config file has /mnt/n/data and its permission is set to 0770.

Install guide had incomplete path for customized data folder. Reinstalling with correct path solved the issue.