
CasaOS is a Docker-based operating system that makes it easy for users to manage self-hosted applications. However, internal storage capacity is often limited. The solution? Mount external storage (HDD, SSD, or USB flash drive) so it can be used by Docker applications in CasaOS. This article will explain how to mount external storage in CasaOS with FAT32, NTFS, and ext4 formats, as well as set permissions so Docker applications can access it.
Preparation Before Mounting #
- Connect external storage (USB/HDD) to your CasaOS device.
- Check the storage device with this command:
sudo fdisk -lExample output:
/dev/sda1 (usually internal storage)
/dev/sdb1 (usually external storage)-
Format the storage (optional) if not already formatted:
- FAT32 (for high compatibility):
sudo mkfs.vfat /dev/sdb1 -n USB32GB- NTFS (for large files >4GB):
sudo mkfs.ntfs /dev/sdb1 -f- ext4 (recommended for Linux):
sudo mkfs.ext4 /dev/sdb1
How to Mount Storage in CasaOS #
1. Create a Mount Point #
sudo mkdir -p /mnt/external2. Manual Mount (Testing) #
For FAT32 #
sudo mount -t vfat /dev/sdb1 /mnt/external -o uid=1000,gid=1000,umask=000For NTFS #
sudo mount -t ntfs-3g /dev/sdb1 /mnt/external -o uid=1000,gid=1000For ext4 #
sudo mount /dev/sdb1 /mnt/external
sudo chown -R 1000:1000 /mnt/external # Give access to CasaOS user3. Permanent Mount (Add to /etc/fstab) #
Edit the /etc/fstab file:
sudo nano /etc/fstabAdd the following line based on your format:
FAT32 #
/dev/sdb1 /mnt/external vfat uid=1000,gid=1000,umask=000 0 0NTFS #
/dev/sdb1 /mnt/external ntfs-3g uid=1000,gid=1000 0 0ext4 #
/dev/sdb1 /mnt/external ext4 defaults 0 0Then remount:
sudo mount -a4. Set Permissions for CasaOS & Docker #
Make sure CasaOS (which usually runs as root or user 1000) can access:
sudo chmod -R 777 /mnt/external # Full access (use caution in production!)How to Use Storage in Docker Applications #
1. Add Storage to CasaOS GUI #
- Open CasaOS Dashboard → Settings → Storage.
- Click “Add Storage” and select /mnt/external.
2. Configure Volume in Docker #
When installing applications via CasaOS:
- In the “Storage” section, add:
- Host Path: /mnt/external
- Container Path: /data (adjust as needed)
Or edit docker-compose.yml manually:
volumes:
- /mnt/external:/dataTroubleshooting #
1. Getting “Permission Denied” Error in Docker? #
Make sure the storage is mounted with uid=1000 option (CasaOS user).
If it still fails, try:
sudo chmod -R 777 /mnt/external2. Storage Not Appearing in CasaOS? #
Check if it’s properly mounted:
df -hRestart CasaOS:
sudo systemctl restart casaos3. Want to Reformat to ext4? #
If FAT32/NTFS is causing issues, reformat to ext4:
sudo umount /dev/sdb1
sudo mkfs.ext4 /dev/sdb1
sudo mount /dev/sdb1 /mnt/externalConclusion #
By mounting external storage in CasaOS, you can:
- ✅ Increase storage capacity for Docker applications.
- ✅ Use HDD/USB as additional storage media.
- ✅ Set permissions according to your security needs.
Tips: #
- For best performance, use ext4 (Linux-specific).
- If you need Windows compatibility, use NTFS.
- Avoid chmod 777 on production systems (security risk).
Good luck! 🚀
References:
Mount Drive Linux: Manual & Auto Mount via fstab (Ext4/NTFS)