NextCloud on Azure Error: /mnt is pointing at Azure's temp disk, .ncdata get's wiped

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 34.0.1.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.4 LTS (VM on Azure)
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.58
  • PHP version (e.g, 8.3):
    • PHP 8.3.6
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • Server restart
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Hi,
I’ve been trying to get Nextcloud working on Azure (I know Azure, one less learning curve)
However the /mnt folder in Linux is pointing at Azure’s temp disk, which it resets when when the server is restarted after a delay.
I’ve set an additional disk as nextCloud’s data disk using the menu script, but it’s sill expecting .ncdata in /mnt
the nextcloud_install_production.sh has locked down the nextccloud folder and therefore the config files to move it

Steps to replicate it (hint: details matter!):

Deploy server to azure with data disk

sudo wget https://raw.githubusercontent.com/nextcloud/vm/main/nextcloud_install_production.sh
sudo bash nextcloud_install_production.sh

sudo bash /var/scripts/menu.sh

Specify the data disk for Nextcloud data

Shutdown server for the night

Start server in morning
Browse to web interface
get:
Error

  • Your data directory is invalid.

    Ensure there is a file called “.ncdata” in the root of the data directory. It should have the content: “# Nextcloud data directory”

  • Cannot create “data” directory.

    This can usually be fixed by giving the web server write access to the root directory. See Documentation Redirect

Any ideas?
Thanks