I recently set up Docker on a GL.iNet MT3600BE router running OpenWrt, using a USB disk for storage (since the internal flash is tiny).
Check OpenWrt Version
cat /etc/openwrt_release
Output:
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='21.02-SNAPSHOT'
DISTRIB_REVISION=''
DISTRIB_TARGET='mediatek/mt7987'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt 21.02-SNAPSHOT'
DISTRIB_TAINTS='busybox override'
Check Storage Situation
df -h
You’ll likely see something like this:
Filesystem Size Used Available Use% Mounted on
/dev/root 62.0M 62.0M 0 100% /rom
tmpfs 240.6M 5.3M 235.4M 2% /tmp
/dev/ubi0_2 354.3M 624.0K 349.0M 0% /overlay
overlayfs:/overlay 354.3M 624.0K 349.0M 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 58.7G 13.3M 58.7G 0% /tmp/mountd/disk1_part1
Key point:
- Internal flash is way too small for Docker
- USB disk (/dev/sda1) is where Docker must live
Check USB Disk File System (Must Be ext4)
mount | grep sda1
If it’s already ext4, you should see something like:
/dev/sda1 on /tmp/mountd/disk1_part1 type ext4 (rw,relatime)
If it’s NOT ext4 (
this will erase the disk)
Umount:
umount /tmp/mountd/disk1_part1
Format:
mkfs.ext4 -F /dev/sda1
Create a mount point:
mkdir -p /tmp/mountd/disk1_part1
Mount it:
mount /dev/sda1 /tmp/mountd/disk1_part1
Verify again:
mount | grep sda1
Install Docker
opkg update
opkg install docker dockerd
Check Docker status:
docker info | grep "Docker Root Dir"
By default, you’ll see:
Docker Docker Root Dir: /opt/docker
That’s bad (internal flash).
Move Docker Root to USB Disk (Symlink Method)
Stop Docker:
/etc/init.d/dockerd stop
Prepare directory on USB disk:
mkdir -p /tmp/mountd/disk1_part1/docker
chmod 755 /tmp/mountd/disk1_part1/docker
Remove the old Docker directory:
rm -rf /opt/docker
Create a symlink to the USB disk:
ln -s /tmp/mountd/disk1_part1/docker /opt/docker
Start Docker again:
/etc/init.d/dockerd start
Verify:
docker info | grep "Docker Root Dir"
Now you should see:
Docker Root Dir: /tmp/mountd/disk1_part1/docker
Docker is officially living on the USB disk.
Test Docker
docker run --rm docker.m.daocloud.io/library/hello-world
If you see the Hello World output — you’re done ![]()
Final Notes
- ext4 is strongly recommended (don’t use FAT32/exFAT)
- USB disk avoids storage exhaustion and random Docker crashes
- This setup works well even on low-power OpenWrt routers