Hoppa yfir í aðalefni

Mounting Nextcloud as a Local Drive

Nextcloud exposes your files over WebDAV, which means you can mount your Nextcloud storage as if it were a local drive or folder, without having to sync files manually through the desktop client. This guide covers Windows, macOS, Linux, and our HPC system.

Throughout this guide, replace <username> with your Nextcloud username and <app-password> with an app password generated under Settings → Security → Devices & sessions. Using an app password instead of your real account password is strongly recommended, since it can be revoked independently if a device is lost.

The base WebDAV URL for our Nextcloud instance is:

https://ireigogn.hi.is/remote.php/dav/files/<username>/

Windows

  1. Open File Explorer.

  2. Right-click This PC and choose Map network drive….

  3. Pick an unused drive letter (e.g. Z:).

  4. In the Folder field, enter:

    https://ireigogn.hi.is/remote.php/dav/files/<username>/
  5. Check Connect using different credentials, then click Finish.

  6. When prompted, enter your Nextcloud username and your app password.

Tillaga

Windows' built-in WebDAV client can be slow or flaky with large directories. If you run into timeouts or "network path not found" errors, consider using RaiDrive or WinSCP (SFTP-style WebDAV mounting) as more reliable alternatives.


macOS

  1. Open Finder.

  2. From the menu bar, choose Go → Connect to Server… (or press Cmd+K).

  3. Enter the server address:

    https://ireigogn.hi.is/remote.php/dav/files/<username>/
  4. Click Connect.

  5. Choose Registered User, enter your username and app password, and click Connect.

The drive will appear in Finder under Locations and on your Desktop (if that preference is enabled). To reconnect automatically at login, drag the mounted drive into System Settings → General → Login Items.


Linux

There are two common approaches: davfs2 for a true filesystem mount, or your file manager's built-in GVfs WebDAV support for a quick graphical mount.

  1. Install davfs2:

    # Debian/Ubuntu
    sudo apt install davfs2

    # Fedora/RHEL
    sudo dnf install davfs2
  2. Create a mount point:

    sudo mkdir -p /mnt/nextcloud
  3. Add an entry to /etc/fstab:

    https://ireigogn.hi.is/remote.php/dav/files/<username>/ /mnt/nextcloud davfs user,rw,auto 0 0
  4. Store credentials securely instead of typing them every mount, in /etc/davfs2/secrets (root-readable only):

    /mnt/nextcloud <username> <app-password>
    sudo chmod 600 /etc/davfs2/secrets
  5. Mount it:

    sudo mount /mnt/nextcloud

Option B: GVfs (Nautilus/Files, GNOME-based desktops)

  1. Open your file manager (e.g. Files/Nautilus).

  2. Go to Other Locations.

  3. In the address bar at the bottom, enter:

    davs://ireigogn.hi.is/remote.php/dav/files/<username>/

    (note: davs:// not https://)

  4. Enter your username and app password when prompted.

This mounts under /run/user/<uid>/gvfs/ and is convenient for quick access, but it isn't a real POSIX mount, so it won't work well for command-line tools or scripts.


HPC Cluster (Elja-IRHPC)

Mounting Nextcloud directly on the HPC cluster requires membership in a restricted group, since WebDAV mounts on shared compute infrastructure have to be controlled carefully.

1. Request access

Mounting Nextcloud storage on the HPC system is gated behind the [GROUP_NAME] group. To request access:

  • Contact the HPC administrators at [CONTACT_ADDRESS], or
  • Submit a request via [REQUEST_PROCESS / TICKET SYSTEM]

Include your HPC username and a brief justification for needing direct Nextcloud access from the cluster.

Once approved, you'll be added to the group, and you should log out and back in (or run newgrp [GROUP_NAME]) for the membership to take effect.

2. Store your credentials

Once you're in the group, set up your WebDAV credentials in ~/.davfs2/secrets (same format as the standalone Linux instructions above):

mkdir -p ~/.davfs2
cat <<EOF > ~/.davfs2/secrets
https://ireigogn.hi.is/remote.php/dav/files/<app-login>/ <app-login> <app-password>
EOF
chmod 600 ~/.davfs2/secrets

Use your link login name (HPC username) and the app password generated in Nextcloud, not your regular account password.

3. Mount and unmount with cloud_connect2

The cluster provides a wrapper script, cloud_connect2, that handles the davfs2 mount/unmount for you using the credentials in ~/.davfs2/secrets. Your Nextcloud storage is mounted at:

/hpchome/share/mnt/<hpcusername>

To mount:

cloud_connect2

To unmount:

cloud_connect2 --unmount
Mount/unmount in batch jobs

Because HPC nodes are shared, you must not leave the mount open outside of active use. If your job reads from or writes to your Nextcloud storage, mount it at the start of the job and unmount it at the end, inside the same batch script:

#!/bin/bash
#SBATCH --job-name=my-job
#SBATCH ...

cloud_connect2

# your calculations, reading/writing under /hpchome/share/mnt/<hpcusername>
./my_program --input /hpchome/share/mnt/<hpcusername>/data --output ./results

cloud_connect2 --unmount

Leaving the mount active after your job finishes (or across multiple concurrent jobs) can cause conflicts or stale mounts on shared nodes, so always unmount as one of the last steps in the script, even if the job fails partway through — consider wrapping the calculation step with a trap to guarantee cloud_connect2 --unmount runs on exit.


Troubleshooting

  • 401 Unauthorized: Make sure you're using an app password, not your regular login password — Nextcloud rejects regular passwords for WebDAV if two-factor authentication is enabled.
  • Slow listing of large folders: This is a known WebDAV limitation with folders containing thousands of files. Consider using the desktop sync client for those folders instead.
  • Mount disappears after sleep/reboot: On Linux, ensure the auto option is in your fstab entry, or set up a systemd.mount unit for more reliable reconnects.