How to manage external media and storage for Nextcloud snap

How to manage external media and storage for Nextcloud snap

Managing external media and storage

Snap confinement is a security feature and determines the amount of access an application has to system resources, such as files, the network, peripherals and services. Thus your Nextcloud snap is securely confined from the host system. Unless you specifically allow the Nextcloud snap to access the /media or /mnt directories on the host system, you will not be able to access any other directory outside of the confinement.

What permissions should external media have?

See FAQ’s and Snap confinement

Removable media or external storage must be mounted to either /media or /mnt as root with root permissions and connected to Snap!

The interface providing the ability to access removable media is not automatically connected upon install, so if you’d like to use external storage (or otherwise use a device in /media or /mnt for data), you need to give the snap permission to access removable media by connecting that interface:

sudo snap connect nextcloud:removable-media

How can I connect local or external media?

See Connect external media

sudo snap connect nextcloud:removable-media

How can I connect a USB media device?

See Connect USB device

sudo snap connect nextcloud:removable-media

Mount directory

Tip: Ensure USB-boot is disabled in BIOS or use the --nofail option in /etc/fstab for headless boot, especially when connecting an external USB-device.

Tip: Its not recommended to use the “automount” directory /media/$USER/. Prefer creating a dedicated directory /media/nextcloud/ or /mnt/nextcloud/ and mounting the dedicated directory in /etc/fstab.

Data directory

Network and local shares

Permissions and confinement

2 Likes