I’ll try to explain it:
- Manually mount the CIFS share:
sudo mount -t cifs -o username=your_user,password=your_pass //server_ip/share_name /mnt/nextcloud_data
- Add it to
/etc/fstab
for persistence:
//server_ip/share_name /mnt/nextcloud_data cifs username=your_user,password=your_pass,uid=33,gid=33,iocharset=utf8 0 0
Tip: You can store your credentials in a separate file (e.g.,
/root/.cifs_credentials
) for better security. Format:
username=your_user
password=your_pass
Then modify /etc/fstab
:
//server_ip/share_name /mnt/nextcloud_data cifs credentials=/root/.cifs_credentials,uid=33,gid=33,iocharset=utf8 0 0
- Update Docker Compose or Docker run to map the CIFS share:
volumes:
- /mnt/nextcloud_data:/var/www/html/data
- Set permissions so Nextcloud can access it:
sudo chmod -R 755 /mnt/nextcloud_data
- Restart the container and verify in Nextcloud.
Always backup any data that’s important.