Configure Docker to Use SD Card as Data Root (e.g. WP400 with PlcVisu)
This guide explains how to redirect Docker's storage to an SD card, ideal for devices with limited internal memory (like WAGO WP400). It includes preparation, persistent mounting, and structured troubleshooting.
Software Requirements
-
Docker
WAGO Docker Installation Guide (search for WP400 Docker IPK) -
PlcVisu Software (.ipk)
WAGO PlcVisu Download Page -
Root Access
Via SSH (ssh root@<wp400-ip>
) or serial terminal
Hardware Requirements
- SD Card or SSD with USB Adapter
- Minimum Class 10 or UHS-I
- At least 8 GB (16+ GB recommended)
- Formatted as
ext4
orvfat
(Linux-compatible)
Prerequisites
Mount SD Card and Prepare Docker Storage
1. Identify the SD Card Device
Run:
lsblk
or:
dmesg | grep sd
Look for a device like /dev/mmcblk0p1
or /dev/sda1
### 2. Format the SD Card (if needed – this erases all data)
mkfs.ext4 /dev/sda1
Adjust device name to match your system
You may usemkfs.vfat
ifext4
is unsupported
### 3. Create Mount Point and Mount the SD Card
mkdir -p /mnt/sdcard
mount /dev/sda1 /mnt/sdcard
Verify with:https://doc.plcvisu.cloud/en/downloads.html
df -h
4. Prepare Docker Data Directory
mkdir -p /mnt/sdcard/docker
chmod 711 /mnt/sdcard/docker
5. Stop Docker Before Changing Config
/etc/init.d/docker stop
6. Backup Existing Docker Data (Optional)
mv /var/lib/docker /var/lib/docker.backup
7. Configure Docker to Use SD Card as Data Root
Edit or create:
vi /etc/docker/daemon.json
Insert:
{
--data-root--: --/mnt/sdcard/docker--
}
Save and close.
8. Start Docker Again
/etc/init.d/docker start
9. Verify Docker Storage Path
docker info | grep --Docker Root Dir--
Expected result:
Docker Root Dir: /mnt/sdcard/docker
Optional: Make Mount Persistent After Reboot
Edit /etc/fstab
:
/dev/sda1 /mnt/sdcard ext4 defaults 0 2
⚠️ Ensure SD card is always available at boot
Usemount -a
to test
Post-Reboot Check
After reboot:
df -h | grep /mnt/sdcard
docker info | grep --Docker Root Dir--
If fallback to /var/lib/docker
→ check fstab
and Docker boot timing
Troubleshooting Guide
Symptom | Cause | Solution |
---|---|---|
Docker Root Dir is still /var/lib/docker |
SD card wasn't mounted early enough | Delay Docker start or use mount --bind |
mount: wrong fs type |
Wrong filesystem format | Reformat with mkfs.ext4 |
No space left on device |
SD card too small / wrong mount | Check with df -h , resize SD or mount right |
Permission denied on /mnt/sdcard/docker |
Wrong permissions | Run chmod 711 /mnt/sdcard/docker |
Docker doesn't start | Config error or missing folder | Check /etc/docker/daemon.json and logs |
Final Notes
- Always stop Docker before modifying its configuration
- Do not remove SD card while Docker is running
- For critical applications: use industrial-grade SD or external SSD
- You can cleanly revert by restoring
/var/lib/docker.backup
and editingdaemon.json
⚠️ Make sure the SD card is mounted before Docker starts during boot.
If the mount is too late, Docker will reinitialize in/var/lib/docker
.
Load and Run Node-RED Docker Image on WP400
This method allows you to deploy Node-RED on a WP400 without internet access by using a pre-downloaded .tar
Docker image file.
1. Download the Docker Image .tar
File (from Link)
Instead of pulling from Docker Hub, download the prepared image file:
Save the file locally on your development PC.
2. Transfer the Docker Image File to the WP400 SD Card (Mounted Directory)
Instead of transferring the Docker image to temporary memory (/tmp
), you can place it directly onto the SD card mounted on the WP400. This is especially useful if the image is large and you want to avoid exhausting internal storage.
Windows
Option A – WinSCP (GUI):
- Install WinSCP.
- Connect to the WP400 using SCP (
root@<wp400-ip>
). - Navigate to the mounted SD card directory, usually
/mnt/sdcard
. - Drag and drop the
node-red-arm327l.tar
file into/mnt/sdcard
.
Option B – Command Line with PuTTY (pscp):
pscp C:pathtonode-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
macOS
Use the Terminal:
scp ~/Downloads/node-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
Linux
Use any terminal:
scp /path/to/node-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
USB Stick (Alternative for All OS)
If transferring over the network is not possible:
- Copy the file to a USB stick.
- Plug the USB into the WP400.
- On the WP400, move it to the SD card:
mount /dev/sda1 /mnt/usb cp /mnt/usb/node-red-arm327l.tar /mnt/sdcard umount /mnt/usb
Once the file is stored under /mnt/sdcard
, continue with Step 3: Load Docker Image from the SD Card
´
Once the file is available under /tmp
, continue with Step 3: Load Docker Image on WP400
3. Load Docker Image on WP400
SSH into your WP400 and run:
docker load -i /tmp/node-red-arm327l.tar
This will load the image into your local Docker registry.
4. Run the Node-RED Container
docker run -it -d -p 1880:1880 -v node_red_data:/data --name wago-nodered --restart unless-stopped node-red-arm327l:latest
✔ Make sure the image name (
node-red-arm327l:latest
) matches whatdocker images
shows.
???? To use the SD card for persistent data, replacenode_red_data
with a full path like/mnt/sdcard/nodered
.
Access Node-RED
Open in your browser:
http://<wp400-ip>:1880
You now have a fully functional Node-RED instance running on WP400 without requiring direct internet access.