Install Nextcloud 21 on NFS Share

Hello community,

after tinkering around with settings for almost a week I am out of ideas and so seems google. I want to install NC21 on a VM with an NFS share mounted to the path /mnt/www. I tried the following share setups on my file server:
rw,sync,fsid=0,crossmnt,no_subtree_check,no_root_squash
rw,sync,anonuid=33,anongid=33,no_subtree_check

Then I mounted this share on the webserver under /mnt/www. There is a folder on the base of that share that will contain any websites called html. I changed the apache config file 000-default.conf to:
ServerAdmin webmaster@localhost

    DocumentRoot /mnt/www/html
    <Directory /mnt/www/html/>
            Options -Indexes
            Require all granted
            AllowOverride All
            Options FollowSymLinks MultiViews
            <IfModule mod_dav.c>
                    Dav off
            </IfModule>
    </Directory>

With that change I was able to see the my default website now on the NFS share. After that I downloaded the web installer and executed it. All dependencies were found and I started the process of installing NC21. The package (nc.zip) was downloaded and properly unzipped. I clicked next to move to the config screen. That is the first time I ran into the issue that NC told me there was an error and I should check the logs. At that point there are no logs, it is a fresh install. Nothing is defined in the config.php. So I went into the NC folder and executed
sudo -u www-data php8.0 occ check
That was the first time I got an error that the file config.php could not be locked and that is where I am stuck now. I was able to install NC on a smb share but that is too slow. I want that speed that NFS is offering. Is anyone out there that can help?
I am sure it is a config thing but I could not find if it was a config thing on the NFS server or the apache2 server.

Thanks so much for your help.

realshadow

I think you over complicate things…

Manual installation of Nextcloud consists of two parts: first - the command line, second - web-based. There are quite a few how-tos on the web depending on requirements
You don’t have to worry about the data partition (that you want to be on an NFS share) during the first part…

It’s before you start the second you need to decide where your data will be located and mounted.
This is when you create a new VMDK (virtual drive) and mount it where you want it…

After this is done, start the web-based part and specify where the data partition is located…

The NFS (Versions 2 and 3) protocol does not support file locking. Are you sure you are connection with version 4? You may also have to change some config params to enable it. Since you are not supplying info on OS and version, it’s a little hard to diagnose further.

@vikinggeek you are correct. The mounting happens with NFS v3 NOT 4 which is why your comment explains perfectly why it is not working. I am using Debian 10 so now I at least have an indication where I can start looking and trying to figure out if I can install NC completely on a NFS share.

@henry well, I do know how to install NC which I did but it is not installed like I want it. If a VM goes down all its’ content will go down with it. That includes a NC install. Having everything stored outside, including the filesystem of NC allows me to be much faster in restoring everything. That is why I wanted to have a NFS share as my installation drive. I already use a “virtual drive” or a NFS mount for the data directory.

Thanks to both of you for your answers. They help me to plot a path forward. Really appreciate it.

realshadow