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

  1. Docker
    WAGO Docker Installation Guide (search for WP400 Docker IPK)

  2. PlcVisu Software (.ipk)
    WAGO PlcVisu Download Page

  3. Root Access
    Via SSH (ssh root@<wp400-ip>) or serial terminal

Hardware Requirements

  1. SD Card or SSD with USB Adapter
    • Minimum Class 10 or UHS-I
    • At least 8 GB (16+ GB recommended)
    • Formatted as ext4 or vfat (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 use mkfs.vfat if ext4 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
Use mount -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 editing daemon.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.

Instead of pulling from Docker Hub, download the prepared image file:

???? Download node-red-arm.tar

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):

  1. Install WinSCP.
  2. Connect to the WP400 using SCP (root@<wp400-ip>).
  3. Navigate to the mounted SD card directory, usually /mnt/sdcard.
  4. 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:

  1. Copy the file to a USB stick.
  2. Plug the USB into the WP400.
  3. 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 what docker images shows.
???? To use the SD card for persistent data, replace node_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.

http://<wp400-ip>:1880
/mnt/sdcard/nodered
node_red_data
docker images
node-red-arm327l:latest
docker run -it -d -p 1880:1880 -v node_red_data:/data --name wago-nodered --restart unless-stopped node-red-arm327l:latest
docker load -i /tmp/node-red-arm327l.tar
/tmp
/mnt/sdcard
mount /dev/sda1 /mnt/usb cp /mnt/usb/node-red-arm327l.tar /mnt/sdcard umount /mnt/usb
scp /path/to/node-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
scp ~/Downloads/node-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
pscp C:pathtonode-red-arm327l.tar root@<wp400-ip>:/mnt/sdcard
/mnt/sdcard
node-red-arm327l.tar
/mnt/sdcard
root@<wp400-ip>
/tmp
.tar
.tar
/var/lib/docker
daemon.json
/var/lib/docker.backup
/etc/docker/daemon.json
chmod 711 /mnt/sdcard/docker
/mnt/sdcard/docker
Permission denied
df -h
No space left on device
mkfs.ext4
mount: wrong fs type
mount --bind
/var/lib/docker
Docker Root Dir
fstab
/var/lib/docker
df -h | grep /mnt/sdcard docker info | grep --Docker Root Dir--
mount -a
/dev/sda1 /mnt/sdcard ext4 defaults 0 2
/etc/fstab
Docker Root Dir: /mnt/sdcard/docker
docker info | grep --Docker Root Dir--
/etc/init.d/docker start
{ --data-root--: --/mnt/sdcard/docker-- }
vi /etc/docker/daemon.json
mv /var/lib/docker /var/lib/docker.backup
/etc/init.d/docker stop
mkdir -p /mnt/sdcard/docker chmod 711 /mnt/sdcard/docker
df -h
mkdir -p /mnt/sdcard mount /dev/sda1 /mnt/sdcard
ext4
mkfs.vfat
mkfs.ext4 /dev/sda1
/dev/sda1
/dev/mmcblk0p1
dmesg | grep sd
lsblk
vfat
ext4
ssh root@<wp400-ip>