Adapted from the official NextCloud instructions:
Shell commands to perform (as your regular user):
Note: replace all occurrences of adjective-noun below with your server’s unique adjective-noun combination indicated in its adjective-noun.local hostname. Replace NCUSERNAME with your NextCloud username, and NCPASSWORD with that NextCloud user’s password.
sudo apt install davfs2 usermod -aG davfs2 $USER mkdir /home/$USER/NextCloud-adjective-noun chown -R $USER:$USER ~/.davfs chmod 600 ~/.davfs/secrets chmod 700 ~/.davfs echo "/home/$USER/NextCloud-adjective-noun NCUSERNAME NCPASSWORD" >> ~/.davfs/secrets
Copy your cert from System > Root CA into /etc/davfs2/certs/ and then put:
Add to /etc/fstab:
#nextcloud webdav folder https://yournextcloudservice.local/remote.php/dav/files/NCUSERNAME/ /home/YOURLINUXUSERNAME/NextCloud-adjective-noun davfs user,rw,auto 0 0
Then reboot and it should mount at boot.