Installing NextCloud
Installing NextCloud in Cosmic Desktop
-
Recommendations for Setting Up NextCloud in Cosmic Desktop
This version assumes nothing is installed yet and uses this exact local Linux username and external hard-drive path:
Linux username: ben External drive: /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 Recommended sync folder: /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncThis guide installs and configures:
-
Nextcloud Server with the Snap package.
-
Nextcloud Desktop Client with the official Linux AppImage.
-
The desktop client so it syncs to the Seagate external drive.
-
Automatic server startup after reboot.
-
Automatic desktop-client startup after
benlogs in to COSMIC. -
A startup wrapper that waits for the external drive before launching sync.
0. Read this first: server storage vs. desktop sync folder
Nextcloud has two different parts.
-
Install Snap
Run these commands exactly:
sudo apt update sudo apt install -y snapd sudo systemctl enable --now snapd.socketThen reboot:
sudo rebootAfter reboot, log back in as
benand check that Snap now works:snap versionThen continue with Nextcloud:
sudo snap install nextcloud sudo snap start --enable nextcloud snap services nextcloudI also added this troubleshooting note to your Capacities page so the guide now covers
sudo: snap: command not found.
Nextcloud Server
The server is the web application. It manages users, files, sharing, the Android app, the web interface, and remote access.
In this guide, the server is installed with:
sudo snap install nextcloudThe server will start automatically after the computer boots.
Nextcloud Desktop Client
The desktop client is the sync program. It runs after
benlogs in to COSMIC and keeps a local folder synchronized with the Nextcloud server.In this guide, the desktop client syncs to:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncImportant safety rule
Do not use the same folder as both:
-
the server’s internal data folder, and
-
the desktop client’s sync folder.
That can create sync loops, permission conflicts, duplicates, or data loss.
This guide uses the external hard drive as the desktop sync target. That means files placed in the external drive’s
Nextcloud_Syncfolder are uploaded to the Nextcloud server, and files uploaded to the server appear in that folder.
1. Verify the external hard drive
Open COSMIC Terminal.
Set the drive path as a variable:
DRIVE="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1"Check that the drive exists:
ls -ld "$DRIVE"Check the filesystem type and free space:
df -T "$DRIVE" df -h "$DRIVE"Check whether Linux recognizes it as a mount point:
findmnt "$DRIVE"Test whether user
bencan write to it:touch "$DRIVE/.nextcloud-write-test" rm "$DRIVE/.nextcloud-write-test"If the
touchcommand fails, fix ownership:sudo chown ben:ben "$DRIVE" chmod 755 "$DRIVE"Do not recursively change ownership of the entire drive yet unless you are sure everything on it should belong to
ben.
2. Make the external drive mount reliably after reboot
Nextcloud sync must not start before the external drive is ready.
First, find the drive UUID:
lsblk -fLook for the partition that mounts at:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1Write down its UUID and filesystem type
a8dc957e-100b-49f7-93e2-651cacec923fOpen
/etc/fstab:sudo nano /etc/fstabIf the drive is
ext4, add a line like this, replacing<UUID>with the real UUID:UUID=<UUID> /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 ext4 defaults,nofail,x-systemd.automount 0 2If the drive is
ntfs3, first check user and group IDs:id benFor a typical single-user system,
benis usually UID1000and GID1000. If the numbers are different, use the real numbers.Add a line like this for
ntfs3:UUID=<UUID> /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 ntfs3 rw,uid=1000,gid=1000,nofail,x-systemd.automount 0 0Save and exit Nano:
Ctrl+O → Enter → Ctrl+XReload and test:
sudo systemctl daemon-reload sudo mount -a findmnt "$DRIVE"Do not continue until
findmntconfirms that the drive is mounted at the exact path.
3. Create a dedicated Nextcloud sync folder on the external drive
Do not use the raw drive root as the sync folder unless you intentionally want everything at the top of the drive synced.
Recommended folder:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncCreate it:
SYNC_ROOT="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync" mkdir -p "$SYNC_ROOT" sudo chown -R ben:ben "$SYNC_ROOT" find "$SYNC_ROOT" -type d -exec chmod 755 {} \; find "$SYNC_ROOT" -type f -exec chmod 644 {} \;Confirm:
ls -ld "$SYNC_ROOT"It should show
ben benas owner and group.If you already have files on the Seagate drive that you want in Nextcloud, the safest novice method is:
-
Keep them where they are for now.
-
Finish the server and client setup.
-
After the sync client works, move or copy the desired folders into
Nextcloud_Sync.
Avoid syncing Linux system folders such as
lost+found.
4. Install system requirements
Update the system:
sudo apt update sudo apt full-upgrade -yInstall basic tools:
sudo apt install -y snapd curl wget jq ufw gnome-keyring libsecret-tools libnotify-bin desktop-file-utils sudo apt install -y libfuse2t64 || sudo apt install -y libfuse2Enable Snap support:
sudo systemctl enable --now snapd.socket sudo snap install coreReboot once:
sudo rebootAfter reboot, log back in as
benand open COSMIC Terminal.Confirm Snap works:
snap version
5. Install the Nextcloud server
Install the Nextcloud server Snap:
sudo snap install nextcloudConfirm it installed:
snap list nextcloud snap services nextcloudEnable and start all Nextcloud services:
sudo snap start --enable nextcloud
6. Create the first Nextcloud admin account
Use
benas the first Nextcloud admin username:read -s -p "Create a strong Nextcloud admin password for ben: " NC_ADMIN_PASS echo sudo nextcloud.manual-install ben "$NC_ADMIN_PASS" unset NC_ADMIN_PASSStore this password in a password manager.
This creates the first admin account for the web interface.
7. Configure trusted local access
Test the local server:
xdg-open http://localhostIf the page opens, log in as:
Username: ben Password: the password created in Phase 6Find the local IP address:
LOCAL_IP="$(hostname -I | awk '{print $1}')" echo "$LOCAL_IP"Add local trusted domains:
sudo nextcloud.occ config:system:set trusted_domains 1 --value="localhost" sudo nextcloud.occ config:system:set trusted_domains 2 --value="$LOCAL_IP" sudo nextcloud.occ config:system:get trusted_domainsTest local IP access:
xdg-open "http://$LOCAL_IP"
8. Turn on the firewall safely
Allow web traffic:
sudo ufw allow 80/tcp sudo ufw allow 443/tcpIf you use SSH to manage this computer remotely:
sudo ufw allow OpenSSHEnable the firewall:
sudo ufw enable sudo ufw status verbose
9. Optional: configure public domain and HTTPS
Skip this section if you only need local network access for now.
Use this section if you want Android, tablet, or laptop access from outside the local network.
Example domain:
hub.benjaminlstewart.netRequirements before enabling Let’s Encrypt:
-
the domain points to your public IP address
-
router port forwarding sends TCP 80 to this COSMIC computer
-
router port forwarding sends TCP 443 to this COSMIC computer
-
the firewall allows ports 80 and 443
-
your ISP does not block inbound 80 or 443
Add the domain as trusted:
DOMAIN="hub.benjaminlstewart.net" sudo nextcloud.occ config:system:set trusted_domains 3 --value="$DOMAIN" sudo nextcloud.occ config:system:get trusted_domainsEnable Let’s Encrypt HTTPS:
sudo nextcloud.enable-https lets-encryptFollow the prompts.
Test:
xdg-open "https://hub.benjaminlstewart.net"For local testing only, self-signed HTTPS is also possible:
sudo nextcloud.enable-https self-signedSelf-signed certificates will cause browser and Android trust warnings.
10. Verify that the server starts automatically after reboot
Reboot:
sudo rebootAfter logging back in as
ben, check the server:snap services nextcloud sudo nextcloud.occ status xdg-open http://localhostIf using a domain:
xdg-open https://hub.benjaminlstewart.netAt this point, the server should start automatically after every reboot.
11. Install the Nextcloud Desktop Client AppImage
Create local application folders:
mkdir -p /home/ben/Applications /home/ben/.local/bin /home/ben/.local/share/applications /home/ben/.config/autostartDownload the latest official Linux x86_64 AppImage from the Nextcloud desktop release repository:
APPIMAGE_URL="$( curl -fsSL https://api.github.com/repos/nextcloud-releases/desktop/releases/latest \ | jq -r '.assets[] | select(.name | test("x86_64.AppImage$")) | .browser_download_url' \ | head -n 1 )" echo "$APPIMAGE_URL" wget -O /home/ben/Applications/Nextcloud.AppImage "$APPIMAGE_URL" chmod +x /home/ben/Applications/Nextcloud.AppImageConfirm:
ls -lh /home/ben/Applications/Nextcloud.AppImageIf the command-line download fails, download the Linux AppImage manually from:
https://nextcloud.com/install/Then move it to:
/home/ben/Applications/Nextcloud.AppImageand run:
chmod +x /home/ben/Applications/Nextcloud.AppImage
12. Create a COSMIC launcher for the desktop client
Run:
cat > /home/ben/.local/share/applications/nextcloud-appimage.desktop <<EOF [Desktop Entry] Type=Application Name=Nextcloud Comment=Nextcloud Desktop Sync Client Exec=/home/ben/Applications/Nextcloud.AppImage Icon=nextcloud Terminal=false Categories=Network;FileTransfer; EOF update-desktop-database /home/ben/.local/share/applications 2>/dev/null || trueIf the app does not appear in the COSMIC launcher immediately, log out and log back in.
13. Launch the desktop client for the first time
Start the client manually:
/home/ben/Applications/Nextcloud.AppImageIn the setup wizard:
-
Click Log in to your Nextcloud.
-
For a local server on the same COSMIC computer, enter:
http://localhost- If you configured public HTTPS, you may instead enter:
https://hub.benjaminlstewart.net-
The browser opens.
-
Log in as
ben. -
Click Grant access.
-
Return to the desktop-client wizard.
14. Select the Seagate external drive sync folder
In the desktop-client wizard, change the local sync folder from the default:
/home/ben/Nextcloudto this exact folder:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncRecommended novice choice:
Choose what to syncStart with a small set of folders first. After confirming everything works, add more folders.
If the server is new and empty, the sync folder may also be empty at first. That is normal.
Click Connect.
After connection, the Nextcloud tray icon should appear. It may show sync activity while it indexes.
15. Move existing Seagate files into Nextcloud sync safely
If your Seagate drive already contains folders you want synced, move or copy them into:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncExample:
mv "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/My Course Files" "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync/"Or copy first, if you want a safer test:
cp -a "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/My Course Files" "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync/"Do not move everything at once if the drive contains hundreds of GB or more. Start with one small folder and verify the web interface sees it.
16. Create the startup script that waits for the Seagate drive
This script prevents the desktop client from starting before the external drive is mounted.
Create the script:
cat > /home/ben/.local/bin/start-nextcloud-client-after-seagate.sh <<'EOF' #!/usr/bin/env bash APP="/home/ben/Applications/Nextcloud.AppImage" DRIVE="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1" SYNC_ROOT="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync" LOCAL_STATUS_URL="http://localhost/status.php" DOMAIN_HOST="hub.benjaminlstewart.net" # Avoid duplicate desktop-client processes. if pgrep -f "Nextcloud.AppImage" >/dev/null 2>&1; then exit 0 fi # Wait up to 5 minutes for the external drive, sync folder, and server/network. for i in {1..60}; do if mountpoint -q "$DRIVE" && [ -d "$SYNC_ROOT" ] && [ -x "$APP" ]; then if curl -fsS "$LOCAL_STATUS_URL" >/dev/null 2>&1 || ping -c 1 -W 1 "$DOMAIN_HOST" >/dev/null 2>&1; then exec "$APP" --background fi fi sleep 5 done notify-send "Nextcloud client not started" "The Seagate drive, sync folder, server, or AppImage was not ready after 5 minutes. Check /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1." exit 1 EOF chmod +x /home/ben/.local/bin/start-nextcloud-client-after-seagate.shTest it manually:
/home/ben/.local/bin/start-nextcloud-client-after-seagate.shConfirm the client is running:
pgrep -a -i nextcloud
17. Add the desktop client to COSMIC autostart
Create the autostart file:
cat > /home/ben/.config/autostart/nextcloud-client-seagate-cosmic.desktop <<EOF [Desktop Entry] Type=Application Name=Nextcloud Desktop Client - Seagate Sync Comment=Start Nextcloud after the Seagate external drive is mounted Exec=/home/ben/.local/bin/start-nextcloud-client-after-seagate.sh Terminal=false X-GNOME-Autostart-enabled=true EOFCheck it:
cat /home/ben/.config/autostart/nextcloud-client-seagate-cosmic.desktopImportant: use one desktop-client autostart method only.
In the Nextcloud desktop client, open:
Settings → GeneralIf Launch on System Startup is enabled, turn it off because this guide uses the safer Seagate-wait script instead.
Check for duplicates:
grep -ril "nextcloud" /home/ben/.config/autostart 2>/dev/nullThe preferred autostart file is:
/home/ben/.config/autostart/nextcloud-client-seagate-cosmic.desktop
18. Final reboot test
Reboot:
sudo rebootLog back in as
ben.Wait 30–60 seconds.
Check the Seagate drive:
DRIVE="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1" SYNC_ROOT="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync" findmnt "$DRIVE" ls -ld "$SYNC_ROOT"Check the server:
snap services nextcloud sudo nextcloud.occ statusCheck the desktop client:
pgrep -a -i nextcloudOpen the server:
xdg-open http://localhostIf using a domain:
xdg-open https://hub.benjaminlstewart.net
19. Test sync from the Seagate drive to Nextcloud
Create a test file inside the Seagate sync folder:
echo "Nextcloud Seagate sync test created on $(date)" > "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync/test-from-seagate.txt"Wait for the Nextcloud tray icon to finish syncing.
Then open the web interface:
xdg-open http://localhostLook for:
test-from-seagate.txtNow test the other direction:
-
In the Nextcloud web interface, upload or create a small file.
-
Wait for sync.
-
Check the Seagate sync folder:
ls -la "/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync"If files move both ways, the core setup works.
20. Optional: allow the Snap server to see removable media
This is only needed if you later use the Nextcloud server’s External Storage app to expose folders from
/mntdirectly through the web interface.Connect the Snap removable-media interface:
sudo snap connect nextcloud:removable-mediaEnable the External Storage app:
sudo nextcloud.occ app:enable files_externalThen in the Nextcloud web interface:
Profile icon → Administration settings → External storageUse this only if you understand the difference between:
-
desktop-client sync folder, and
-
server-side external storage.
Do not configure the exact same folder as both a desktop sync folder and a server-side external storage location.
If you want server-side external storage later, create a separate folder such as:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Server_ExternalKeep this separate from:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync
21. Troubleshooting
The Seagate drive is not mounted after reboot
Check:
findmnt /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 lsblk -f systemctl status mnt-usb\x2dSeagate_Portable_NT3FC3M0\x2d0:0\x2dpart1.automount 2>/dev/null || trueRecheck the
/etc/fstabline.The desktop client starts but shows a missing-folder warning
This means the client started before the drive or sync folder was ready, or the folder path changed.
Run:
mountpoint -q /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 && echo "Drive mounted" ls -ld /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncThen restart the client:
pkill -f Nextcloud.AppImage /home/ben/.local/bin/start-nextcloud-client-after-seagate.shThe desktop client does not start after login
Check the autostart file:
cat /home/ben/.config/autostart/nextcloud-client-seagate-cosmic.desktopTest the script manually:
/home/ben/.local/bin/start-nextcloud-client-after-seagate.shCheck processes:
pgrep -a -i nextcloudAppImage does not open
Install FUSE support:
sudo apt install -y libfuse2t64 || sudo apt install -y libfuse2 /home/ben/Applications/Nextcloud.AppImageNextcloud asks for login again after reboot
Check keyring support:
dpkg -l | grep -E "gnome-keyring|libsecret"If COSMIC asks to unlock the keyring, unlock it. The desktop client needs a Linux password manager/keyring to remember login securely.
Duplicate Nextcloud clients are running
Check:
pgrep -a -i nextcloud grep -ril "nextcloud" /home/ben/.config/autostart 2>/dev/nullKeep only one autostart method.
Android cannot delete files
If Android cannot delete files that are stored in the server’s normal file area, check Nextcloud web permissions first.
If Android cannot delete files from a server-side External Storage mount, the issue is usually server-side filesystem or external-storage permission configuration, not an Android app setting.
For this guide’s main setup, files inside
Nextcloud_Syncare synced by the desktop client as userben, so local write permission should belong toben.
22. Maintenance commands
Check server status:
snap services nextcloud sudo nextcloud.occ statusRestart server:
sudo snap restart nextcloudCheck desktop client:
pgrep -a -i nextcloudRestart desktop client:
pkill -f Nextcloud.AppImage /home/ben/.local/bin/start-nextcloud-client-after-seagate.shCheck sync folder:
ls -la /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_SyncCheck available space:
df -h /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1
23. One-page command summary
Use this only after reading the full guide.
# Variables DRIVE="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1" SYNC_ROOT="$DRIVE/Nextcloud_Sync" # Verify drive ls -ld "$DRIVE" df -T "$DRIVE" findmnt "$DRIVE" touch "$DRIVE/.nextcloud-write-test" && rm "$DRIVE/.nextcloud-write-test" # Create sync folder mkdir -p "$SYNC_ROOT" sudo chown -R ben:ben "$SYNC_ROOT" find "$SYNC_ROOT" -type d -exec chmod 755 {} \; find "$SYNC_ROOT" -type f -exec chmod 644 {} \; # System prep sudo apt update sudo apt full-upgrade -y sudo apt install -y snapd curl wget jq ufw gnome-keyring libsecret-tools libnotify-bin desktop-file-utils sudo apt install -y libfuse2t64 || sudo apt install -y libfuse2 sudo systemctl enable --now snapd.socket sudo snap install core # Install server sudo snap install nextcloud sudo snap start --enable nextcloud # Create admin account read -s -p "Create a strong Nextcloud admin password for ben: " NC_ADMIN_PASS echo sudo nextcloud.manual-install ben "$NC_ADMIN_PASS" unset NC_ADMIN_PASS # Trust localhost and local IP LOCAL_IP="$(hostname -I | awk '{print $1}')" sudo nextcloud.occ config:system:set trusted_domains 1 --value="localhost" sudo nextcloud.occ config:system:set trusted_domains 2 --value="$LOCAL_IP" # Firewall sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw enable # Check server snap services nextcloud sudo nextcloud.occ status xdg-open http://localhost # Install desktop client AppImage mkdir -p /home/ben/Applications /home/ben/.local/bin /home/ben/.local/share/applications /home/ben/.config/autostart APPIMAGE_URL="$( curl -fsSL https://api.github.com/repos/nextcloud-releases/desktop/releases/latest \ | jq -r '.assets[] | select(.name | test("x86_64.AppImage$")) | .browser_download_url' \ | head -n 1 )" wget -O /home/ben/Applications/Nextcloud.AppImage "$APPIMAGE_URL" chmod +x /home/ben/Applications/Nextcloud.AppImage # Launcher cat > /home/ben/.local/share/applications/nextcloud-appimage.desktop <<EOF [Desktop Entry] Type=Application Name=Nextcloud Comment=Nextcloud Desktop Sync Client Exec=/home/ben/Applications/Nextcloud.AppImage Icon=nextcloud Terminal=false Categories=Network;FileTransfer; EOF # Startup script cat > /home/ben/.local/bin/start-nextcloud-client-after-seagate.sh <<'EOF' #!/usr/bin/env bash APP="/home/ben/Applications/Nextcloud.AppImage" DRIVE="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1" SYNC_ROOT="/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync" LOCAL_STATUS_URL="http://localhost/status.php" DOMAIN_HOST="hub.benjaminlstewart.net" if pgrep -f "Nextcloud.AppImage" >/dev/null 2>&1; then exit 0 fi for i in {1..60}; do if mountpoint -q "$DRIVE" && [ -d "$SYNC_ROOT" ] && [ -x "$APP" ]; then if curl -fsS "$LOCAL_STATUS_URL" >/dev/null 2>&1 || ping -c 1 -W 1 "$DOMAIN_HOST" >/dev/null 2>&1; then exec "$APP" --background fi fi sleep 5 done notify-send "Nextcloud client not started" "The Seagate drive, sync folder, server, or AppImage was not ready after 5 minutes." exit 1 EOF chmod +x /home/ben/.local/bin/start-nextcloud-client-after-seagate.sh # COSMIC autostart cat > /home/ben/.config/autostart/nextcloud-client-seagate-cosmic.desktop <<EOF [Desktop Entry] Type=Application Name=Nextcloud Desktop Client - Seagate Sync Comment=Start Nextcloud after the Seagate external drive is mounted Exec=/home/ben/.local/bin/start-nextcloud-client-after-seagate.sh Terminal=false X-GNOME-Autostart-enabled=true EOF # Launch setup wizard /home/ben/Applications/Nextcloud.AppImageIn the setup wizard, choose this local sync folder:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1/Nextcloud_Sync -
Linux Mint
-
Recommendations for accessing NextCloud in Linux Mint Cinnamon 22.3
Updated replacement for the “Recommendations for accessing NextCloud from Office” toggle
Use this updated version because the office external drive is also connected to a Nextcloud server-side external storage workflow. The safest setup is not simply
ben:benownership. The drive should allow both the Linux desktop userbenand the Nextcloud web-server user/groupwww-datato write, delete, and keep new files group-accessible.
Phase 1: Prepare the external hard drive with shared permissions
Linux Mint may dynamically mount external drives when you click them in Nemo, but for a large Nextcloud library and server-side external storage, use a stable mount path and shared group permissions.
In this setup, the Seagate drive is mounted at:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1The drive is formatted as
ext4, which is good because Linux ownership and permissions work normally.First, confirm the mount and filesystem type:
ls -ld /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 df -T /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1If the drive is being used by both your desktop user and Nextcloud, set ownership to user
benand groupwww-data:sudo chown -R ben:www-data /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1Then give the owner and group write access:
sudo find /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 -type d -exec chmod 2775 {} \; sudo find /mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 -type f -exec chmod 664 {} \;Add
bento thewww-datagroup so the desktop user and Nextcloud can both manage the same files:sudo usermod -aG www-data benThen log out and log back in, or reboot, so the new group membership takes effect.
The
2in2775sets the setgid bit on directories. This helps new folders inherit thewww-datagroup, reducing future permission conflicts between Nemo, the Nextcloud desktop client, and the Nextcloud server process.
Phase 2: Check the Nextcloud external storage mount
In the Nextcloud web interface, go to:
Profile icon → Administration settings → External storage
Edit the mount:
/Seagate Existing FilesConfirm these settings:
-
External storage: Local
-
Location:
/mnt/usb-Seagate_Portable_NT3FC3M0-0:0-part1 -
Read only: OFF
-
Check filesystem changes: Once every direct access
-
Enable previews: optional, currently OK
-
Enable sharing: optional; turn on only if this external storage needs to be shared through Nextcloud
Click Edit to save.
Phase 3: Test deletion in the correct order
Test deletion from the Nextcloud web interface first. If deletion works in the web interface, the Android app should inherit the same permission behavior.
Recommended test:
-
Create a small temporary text file inside the Seagate external storage.
-
Delete it from the Nextcloud web interface.
-
Create another temporary file.
-
Delete it from the Nextcloud Android app.
If deletion works on the web but not Android, the issue is likely Android app cache/account state. If deletion fails on the web too, the problem is still server filesystem permissions.
Phase 4: Rescan Nextcloud files after permission or direct filesystem changes
After large file moves or permission fixes, rescan files so Nextcloud updates its file index:
sudo nextcloud.occ files:scan --allBecause this installation uses the Snap package, use
sudo nextcloud.occrather than the manual-install commandsudo -u www-data php /var/www/nextcloud/occ.
Practical rules for the office setup
-
Do not leave the drive owned only by
www-data:www-data; that can make folders appear locked in Nemo for the desktop user. -
Do not leave the drive owned only by
ben:benwith755permissions; that lets Linux browse the files but can prevent Nextcloud from deleting or modifying them. -
Preferred shared setup:
ben:www-dataownership, directories2775, files664. -
Avoid moving tens of thousands of files with Nemo while Nextcloud is actively scanning or syncing the same location.
-
After large file operations outside the web interface, run
sudo nextcloud.occ files:scan --all. -
The Android app does not have a separate delete-permission setting. It depends on the server-side storage permissions and share permissions.
-
-
Recommended Configuration
Recommended configuration
A. If the Nextcloud sync folder is on an internal drive
Use the built-in Nextcloud autostart option.
-
Open the Nextcloud tray icon.
-
Go to Settings → General.
-
Enable Launch on System Startup.
-
Confirm that a Linux keyring/password manager is available. On Linux Mint Cinnamon, this is usually GNOME Keyring.
-
Reboot, log in, and verify that Nextcloud starts in the tray within 30–60 seconds.
Verification commands:
pgrep -a nextcloudgrep -i launchOnSystemStartup ~/.config/Nextcloud/nextcloud.cfgA healthy setup should show the
nextcloudprocess running and should showlaunchOnSystemStartup=trueor an equivalent enabled state in the configuration file.
B. If the Nextcloud sync folder is on an external drive
Use a more reliable setup. The basic Launch on System Startup checkbox may start Nextcloud before the external drive is mounted. If that happens, Nextcloud may report sync-folder errors or treat the folder as missing.
The better setup is:
-
Mount the external drive at a stable path.
-
Start Nextcloud only after that mount point is available.
-
Avoid duplicate Nextcloud autostart entries.
Step 1: Give the external drive a stable mount path
Find the drive UUID and filesystem type:
lsblk -fCreate a stable mount point:
sudo mkdir -p /mnt/Nextcloud_Library sudo chown $USER:$USER /mnt/Nextcloud_LibraryOpen
/etc/fstab:sudo nano /etc/fstabAdd one line for the external drive. Replace
<UUID>and<filesystem>with the values fromlsblk -f.For an ext4 drive:
UUID=<UUID> /mnt/Nextcloud_Library ext4 defaults,nofail,x-systemd.automount 0 2For an NTFS drive, first check your user and group IDs:
id -u id -gThen use those values in the
uid=andgid=fields:UUID=<UUID> /mnt/Nextcloud_Library ntfs3 rw,uid=1000,gid=1000,nofail,x-systemd.automount 0 0After editing
/etc/fstab, reload and test:sudo systemctl daemon-reload sudo mount -a findmnt /mnt/Nextcloud_LibraryDo not continue until
findmntconfirms that the drive is mounted at/mnt/Nextcloud_Library.
Step 2: Make Nextcloud use the stable path
In the Nextcloud desktop client, the local sync folder should be inside the stable mount path, for example:
/mnt/Nextcloud_LibraryIf the current sync folder is still under a dynamic path such as
/media/ben/YourDriveName/Nextcloud_Library, change it carefully:-
Pause syncing in the Nextcloud tray menu.
-
Open Settings.
-
Remove the current folder sync connection, but do not delete local files.
-
Add a new folder sync connection using
/mnt/Nextcloud_Library. -
Resume syncing after confirming the correct folder path.
Avoid syncing a large library from a path that may change after reboot.
Step 3: Create a wrapper that waits for the drive before starting Nextcloud
Create a local scripts folder:
mkdir -p ~/.local/binCreate the startup script:
nano ~/.local/bin/start-nextcloud-after-mount.shPaste this script:
#!/usr/bin/env bash SYNC_ROOT="/mnt/Nextcloud_Library" SERVER_HOST="hub.benjaminlstewart.net" for i in {1..60}; do if mountpoint -q "$SYNC_ROOT" && ping -c 1 -W 1 "$SERVER_HOST" >/dev/null 2>&1; then exec nextcloud --background fi sleep 5 done notify-send "Nextcloud not started" "The sync folder or network was unavailable after 5 minutes. Check /mnt/Nextcloud_Library and your network connection."Make it executable:
chmod +x ~/.local/bin/start-nextcloud-after-mount.shTest it manually:
~/.local/bin/start-nextcloud-after-mount.shThen confirm that Nextcloud is running:
pgrep -a nextcloud
Step 4: Add the wrapper to Cinnamon Startup Applications
To prevent duplicate Nextcloud instances, use one autostart method only.
Recommended for an external-drive setup:
-
Open the Nextcloud tray icon → Settings → General.
-
Turn off the default Launch on System Startup option.
-
Open the Linux Mint menu.
-
Search for Startup Applications.
-
Click Add.
-
Use:
Name: Nextcloud after external drive mount Command: /home/ben/.local/bin/start-nextcloud-after-mount.sh Comment: Starts Nextcloud only after /mnt/Nextcloud_Library is mounted Startup delay: 15 secondsIf the username is not
ben, replace/home/ben/with the correct home folder path.Alternative command that works regardless of username:
sh -lc "$HOME/.local/bin/start-nextcloud-after-mount.sh"
Step 5: Reboot test
Reboot the computer:
sudo rebootAfter logging back into Cinnamon, check:
findmnt /mnt/Nextcloud_Library pgrep -a nextcloudThen check the tray icon:
-
Green checkmark = synchronized and connected.
-
Blue sync icon = synchronization is running.
-
Gray disconnected icon = network/server connection problem.
-
Red X or warning = configuration or sync-folder problem.
Optional log check:
ls ~/.config/Nextcloud/logstail -n 80 ~/.config/Nextcloud/logs/*.log
Practical rules for this setup
-
The desktop client starts after user login, not before login. This is normal for the GUI Nextcloud Desktop Client.
-
For continuous sync, keep the GUI desktop client running in the tray.
-
Do not use
nextcloudcmdas the continuous sync solution. -
Do not create multiple autostart entries for Nextcloud.
-
If the sync folder lives on an external drive, prefer a stable mount path such as
/mnt/Nextcloud_Libraryinstead of a changing/media/...path. -
If Nextcloud asks for login again after every reboot, check that GNOME Keyring is installed and unlocked when you log into Cinnamon.
Quick recovery commands
Check whether the drive mounted:
findmnt /mnt/Nextcloud_LibraryCheck whether Nextcloud is running:
pgrep -a nextcloudStart Nextcloud manually in the background:
nextcloud --backgroundStop duplicate Nextcloud processes:
pkill nextcloudThen restart using the wrapper:
~/.local/bin/start-nextcloud-after-mount.sh -
-
Recommendations for accessing NextCloud from Office.
This is absolutely the safest and most resilient way to handle a massive library. By creating a true local mirror on your office machine, you guarantee that heavy multi-track audio for The Learning Weaver is sitting right on the disk ready for editing, while lightweight files like your UDL syllabi and textbook chapters sync seamlessly in the background.
Since this completely replaces the need for third-party bridges like Insync, the Nextcloud Desktop Client will handle all the bidirectional mirroring natively.
Here is the complete blueprint to build this robust local mirror on Linux Mint Cinnamon 22.3.
Phase 1: Prepare the External Hard Drive
Linux Mint dynamically mounts external drives when you click on them, but for a background sync client handling 1.5 TB of data, we need to ensure the target folder is completely prepped and owned by your user account before Nextcloud ever touches it.
-
Plug in the 2TB drive and open your Nemo file manager to mount it.
-
Note the mount path: It will typically be something like
/media/ben/YourDriveName. -
Create the master sync directory: Open your terminal and create the dedicated folder:
mkdir /media/ben/YourDriveName/Nextcloud_Library(Make sure to replace
YourDriveNamewith the actual name of your drive).
4. Take absolute ownership: Ensure your user account has full read/write permissions so the sync client doesn’t hit a wall:sudo chown -R $USER:$USER /media/ben/YourDriveName/Nextcloud_Library
Phase 2: Install the Nextcloud Desktop Client
While Linux Mint has a version of the client in its standard repositories, adding the official Nextcloud PPA ensures you get the latest performance updates and native file manager integrations for Cinnamon.
Run these commands in your terminal:
sudo add-apt-repository ppa:nextcloud-devs/client -y sudo apt update sudo apt install nextcloud-desktop nemo-nextcloud -y(The
nemo-nextcloudpackage adds the green checkmarks and sync icons directly onto your files inside the file manager).
Phase 3: The “Trapdoor” Configuration (Crucial Step)
This is the most important part of the setup. If you speed through the setup wizard, Nextcloud will attempt to dump all 1.5 TB of data directly into your local
~/Nextcloudfolder on your OS drive, immediately filling it up and crashing the system. We must reroute it to the external drive.-
Launch the Client: Open your Cinnamon menu and search for Nextcloud.
-
Log In: Click Log in and enter your server address:
https://hub.benjaminlstewart.net. This will open your Zen browser to authorize the connection. -
Grant Access: Once authorized, close the browser and return to the Nextcloud app window.
-
Reroute the Sync:
-
You will see an option for Local Folder.
-
Click the folder path button (it usually defaults to
/home/ben/Nextcloud). -
Navigate to your external drive and select the
/media/ben/YourDriveName/Nextcloud_Libraryfolder you created in Phase 1.
- Select Sync Options: * Choose Sync everything from server if you want the entire 1.5 TB physically present on the external drive for offline access.
- Alternatively, check Use virtual files if you only want to download files as you click on them, saving space on the external drive while still showing the full folder structure.
- Connect: Click Connect.
The client will now begin pulling the data index and start quietly mirroring your library to the external drive.
Phase 4: Autostart & Workflow Optimization
To ensure your lesson plans and research formatting documents are always up-to-date when you arrive at the office, the client needs to run invisibly in the background.
- Enable Autostart:
-
Right-click the green Nextcloud icon in your Cinnamon system tray (bottom right of your screen) and select Settings.
-
Under the General tab, check the box for Launch on System Startup.
- Handling Media vs. Text:
-
For Text/Documents: Just open them directly from the
Nextcloud_Libraryfolder. When you hit save, the desktop client instantly detects the change and pushes it to the server. -
For Podcasting/Video: You can edit these heavy files right on the external drive. The desktop client handles the upload asynchronously, meaning your editing software will never freeze or lock up waiting for a network transfer to complete.
Since this background client relies on the external drive being present to function correctly, do you want to configure Linux Mint to automatically mount that specific drive at the exact same location every time the PC boots up via
fstab, ensuring the Nextcloud client never gets confused? -