Fix Docker API Version Error for CasaOS (App Not Loading)

Having trouble with CasaOS and Docker after an update? You’re not alone. This post covers new fixes—especially for LXC/Proxmox users—and includes a handy script to resolve recent Docker API and AppArmor permission errors.

Backup your data before running.

Installing from scratch?

This script is a modified and improved version of IceWhales install CasaOS script.

Continue for fixing existing installs

This script fixes common Docker errors with CasaOS including:

  • Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44
  • OCI runtime create failed: runc create failed: unable to start container process: error during container init: open sysctl net.ipv4.ip_unprivileged_port_start file: reopen fd 8: permission denied
  • Docker permission issues and corrupted overlay2 storage
  • CVE-2025-52881 AppArmor issues in LXC/Proxmox environments

The Problem

These errors commonly occur with CasaOS when:

  1. Docker gets upgraded to a very recent version that is incompatible with CasaOS’s older Docker client
  2. Docker overlay2 filesystem permissions become corrupted
  3. Container runtime state becomes inconsistent
  4. NEW: containerd.io 1.7.28-2 or newer causes AppArmor permission errors in LXC/Proxmox containers

Special Note for LXC/Proxmox Users

If you’re running CasaOS or Docker in an LXC container (common with Proxmox), you may encounter the permission denied error after updating containerd. This is caused by CVE-2025-52881 security patches that conflict with AppArmor profiles in nested containers.

The error looks like:

failed to create shim task: OCI runtime create failed: runc create failed:
unable to start container process: error during container init:
open sysctl net.ipv4.ip_unprivileged_port_start file: reopen fd 8: permission denied

This script automatically detects LXC environments and installs containerd.io 1.7.28-1 (the last version before the breaking change) to prevent this issue.

References:


What does this script do?

  • Detects your operating system (Debian/Ubuntu-based)
  • Detects LXC/Proxmox environment and adjusts containerd version accordingly
  • Checks if CasaOS is installed
  • Checks for and removes Snap Docker installations that would conflict
  • Verifies Docker binary locations to ensure no conflicts
  • Stops CasaOS services temporarily (if installed)
  • Cleans Docker runtime state and fixes permissions
  • Ensures all Docker processes are completely terminated before upgrade
  • Fixes overlay2 directory permissions
  • Installs Docker 28.0.x (one version behind latest for stability, API 1.47/1.48)
  • Verifies the dockerd binary version after installation
  • Installs containerd.io 1.7.28-1 to avoid CVE-2025-52881 AppArmor issues in LXC/Proxmox
  • Configures Docker daemon with proper settings
  • Holds Docker packages to prevent automatic upgrades
  • Removes standalone docker-compose if present
  • Installs Docker Compose plugin
  • Ensures Docker daemon fully restarts with new binaries
  • Verifies API version actually changed after installation
  • Restarts CasaOS services (if installed)
  • Intelligently detects and fixes the sysctl permission denied error

Run command

bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh)"

Can’t Resolve Domain

To resolve this issue, please follow these steps:

  1. Copy the contents of run.sh from this repository.
  2. Create a file named run.sh on your server.
  3. Execute the following command on your server:
bash run.sh

What causes these errors?

These errors occur when:

  • Docker gets auto-upgraded to version 27+, 28+, or 29+ (API 1.52)
  • There’s a version mismatch between CasaOS’s Docker client and the system’s Docker daemon
  • System updates automatically upgrade Docker without considering CasaOS compatibility
  • Docker overlay2 storage permissions become corrupted
  • Container runtime (runc/containerd) state becomes inconsistent
  • Improper system shutdowns or Docker crashes leave stale state files
  • containerd.io 1.7.28-2 or newer in LXC/Proxmox (CVE-2025-52881 AppArmor conflict)

Requirements

  • Debian or Ubuntu-based Linux distribution
  • Sudo privileges or root access
  • Active internet connection
  • CasaOS installed (optional - script works without it too)

After running the script

You can verify the fix by running:

docker version

Both the client and server API versions should now be compatible. The script installs Docker 28.0.x which:

  • Supports API version 1.47 or 1.48 (compatible with modern CasaOS and newer distros)
  • Provides modern features while maintaining stability
  • Is one version behind the latest (29.0.x) for reliability
  • Is held at this version to prevent auto-upgrades
  • Works with both older CasaOS (via API override) and newer versions

If the API version didn’t change

If you ran the script but docker version still shows an unexpected API version, the script will display diagnostic information. Common causes and fixes:

  1. Docker daemon didn’t restart properly
sudo systemctl stop docker
sudo pkill -9 dockerd
sudo systemctl start docker
docker version
  1. Verify the dockerd binary was replaced
dockerd --version

Should show: Docker version 28.0.x

  1. Check for multiple Docker installations
which -a docker
which -a dockerd

Should only show /usr/bin/docker and /usr/bin/dockerd

  1. Verify package versions
dpkg -l | grep docker-ce

Should show version 5:28.0.x-1~…

If the packages show the correct version (28.0.x) but docker version still shows a newer API:

  • The dockerd process may not have fully restarted
  • Try rebooting your system
  • Check for lingering processes: ps aux | grep dockerd

Preventing future issues

The script automatically holds Docker packages to prevent automatic upgrades:

sudo apt-mark hold docker-ce docker-ce-cli containerd.io

Important for LXC/Proxmox users: The script holds containerd.io at version 1.7.28-1 to prevent the CVE-2025-52881 AppArmor issue. Do not upgrade containerd until this issue is resolved upstream.

If you want to allow Docker upgrades in the future (after confirming CasaOS compatibility), run:

sudo apt-mark unhold docker-ce docker-ce-cli containerd.io

:warning: Warning for LXC/Proxmox users: Before unholding containerd.io, check if the AppArmor issue has been fixed:


Version Information

  • Script Version: 1.6.1
  • Docker CE: 28.0.x (one version behind latest)
  • Docker API: 1.47 or 1.48 (Docker 28.0.x series)
  • containerd.io: 1.7.28-1 (prevents CVE-2025-52881 AppArmor issues)
  • Works with:
    • Modern CasaOS versions (0.4.x+)
    • Older CasaOS versions (via Docker API override)
    • Ubuntu 20.04, 22.04, 24.04
    • Debian 11 (Bullseye), 12 (Bookworm), 13 (Trixie)
    • LXC/Proxmox environments

Alternative Solutions for LXC/Proxmox (Advanced)

If you prefer not to downgrade containerd, you can modify the LXC container configuration on the Proxmox host:

Option 1: Disable AppArmor for the container (in /etc/pve/lxc/$CTID.conf):

lxc.apparmor.profile: unconfined
lxc.mount.entry: /dev/null sys/module/apparmor/parameters/enabled none bind 0 0

Option 2: Wait for upstream fixes:

  • Proxmox/LXC to update their AppArmor profiles
  • containerd/runc to implement workarounds

This script uses the downgrade approach as it’s the safest and most reliable solution that doesn’t require host-level configuration changes.


Backup your data before running.

How to backup all Docker containers & settings


Support This Work

If this script saved you time or fixed your setup, consider supporting more free tools and tutorials:

:hot_beverage: Support on Ko-fi

I think the script has a problem. I executed it with sudo but Docker remains in version 29.0.0

Hello, what is the output of the script any errors?

I ran the script, but I was still on version 29.0.0.
Right after running it, some containers stopped starting due to permission issues.

To resolve the Docker API problem, I downgraded using this procedure, but with the --reinstall option: https://github.com/IceWhaleTech/CasaOS/issues/2387#issuecomment-3514996581

For my Ubuntu version, this resulted in:
sudo apt-get install --reinstall docker-ce=5:28.5.2-1~ubuntu.25.04~plucky docker-ce-cli=5:28.5.2-1~ubuntu.25.04~plucky

However, I’m still having permission problems since running the script and I don’t know how to fix them yet :worried:

Do you have any logs or the permission error? Also have you tried the script again since 1.1.0?

After checking, I ran the script in version 1. I never ran it in version 1.1.0.

I have no errors in the Docker logs; however, in the containers that no longer start, I have:

big-bear-owncloud-db:

  • [ERROR] mariadbd: Can't create/write to file '/tmp/ibpZGu5k' (Errcode: 13 "Permission denied")
  • /usr/local/bin/docker-entrypoint.sh: line 138: cannot create temp file for here-document: Permission denied

n8n:

  • Error: EACCES: permission denied, mkdir '/home/node/.cache'

jdownloader2:

  • APP_NAME: /etc/cont-env.d/APP_NAME: line 1: JDownloader: not found

paperless-tika:

  • org.apache.tika.server.core.TikaServerCli Can't start: java.util.concurrent.ExecutionException: java.nio.file.AccessDeniedException: /tmp/apache-tika-server-forked-tmp-13142266320983578138

paperless-webserver:

  • FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/usr/src/paperless/src']

The permissions permission of var/lib/docker:

drwx--x---  12 root root  4096 nov.  12 00:57 .
drwxr-xr-x  77 root root  4096 oct.  21 08:33 ..
drwx--x--x   3 root root  4096 mai   27 12:39 buildkit
drwx--x---  38 root root  4096 nov.  12 01:23 containers
-rw-------   1 root root    36 mai   27 12:39 engine-id
drwxr-xr-x   3 root root  4096 mai   27 12:39 image
drwxr-x---   3 root root  4096 mai   27 12:39 network
drwx--x--- 500 root root 65536 nov.  12 01:23 overlay2
drwx------   3 root root  4096 mai   27 12:39 plugins
drwx------   2 root root  4096 nov.  12 00:57 runtimes
drwx------   2 root root  4096 mai   27 12:39 swarm
drwx------   3 root root  4096 nov.  12 00:57 tmp
drwx-----x  52 root root  4096 nov.  12 00:57 volumes

I found this script which has a function called fix_docker_permissions, which sets the permissions of /var/lib/docker and /var/lib/docker/tmp to 755 : casaos-toolkit

But I’d appreciate your opinion before I start running any scripts.

Edit:
I finally realized that the best solution was to recreate the problematic containers.
That’s fixed.

I’m stuck. My runnig System got a update and crashed. After some efforts to fix it i ended up installing the whole thing from scratch. I installed Ubuntu server 24.04.2, witch i used bach in March. Everything looks fine. Next installed casaos and ended up with Docker version 29.0.0. Then I tried to downgrad as recommended, didn’t work. Still Docker 29.0.0

So now what can I do to get casaos running again.

Never mind. I got it working

VERSION_STRING=5:28.3.2-1~ubuntu.24.04~noble
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin

did the trick- Now casaos starts the gui and i can install all the app from scratch.

1 Like

Hello all,

1.5.0 of the big-bear-script has been released that should address allot of these issues on old and newer distros.

Tried the script v 1.5.0 and still had failures
Running debian/OMV (debian bullseye)

Stopping Docker socket…

Checking for lingering Docker processes…
Cleaning Docker sockets and pids…
rm: cannot remove ‘/var/run/docker/netns/default’: Device or resource busy

Updating package lists with Docker repository…
E: Conflicting values set for option Signed-By regarding source bullseye: /etc/apt/keyrings/docker.asc != /usr/share/keyrings/docker.gpg
E: The list of sources could not be read.
ERROR: Failed to update package lists
ERROR: Failed to set up Docker repository

ERROR: Docker installation/configuration failed

Attempting to start Docker…
Docker started with previous configuration.
The version downgrade may have failed, but Docker is running.

==========================================
Docker Configuration Complete!

Installed Docker Package Versions:
containerd.io = 2.1.5-1~debian.11~bullseye
docker-ce = 5:29.0.0-1~debian.11~bullseye
docker-ce-cli = 5:29.0.0-1~debian.11~bullseye
docker-ce-rootless-extras = 5:29.0.0-1~debian.11~bullseye

Docker Version Information:
Client: Docker Engine - Community
Version: 29.0.0
API version: 1.52
Go version: go1.25.4
Git commit: 3d4129b
Built: Mon Nov 10 21:47:13 2025
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 29.0.0
API version: 1.52 (minimum version 1.44)
Go version: go1.25.4
Git commit: d105562
Built: Mon Nov 10 21:47:13 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v2.1.5
GitCommit: fcd43222d6b07379a4be9786bda52438f0dd16a1
runc:
Version: 1.3.3
GitCommit: v1.3.3-0-gd842d771
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Docker Compose Version:
Docker Compose version v2.40.3

Step 7a: Verifying Docker API version change…
Verifying Docker API version…
Current Docker API version: 1.52

:warning: WARNING: Docker API version is 1.52
Expected: 1.43 or 1.44 for CasaOS compatibility

This might indicate:

  • The Docker package downgrade didn’t work properly
  • A different Docker binary is being used
  • The Docker daemon didn’t restart with the new version

==========================================

WARNING: Docker API Version Issue Detected

The Docker API version may not have changed as expected.

Diagnostic Information:

  1. dockerd binary version:
    Docker version 29.0.0, build d105562

  2. Running dockerd process(es):
    3891035 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

  3. Docker binary in use:
    /usr/bin/docker
    Binary location: /usr/bin/docker

  4. Installed Docker packages:
    containerd. io = 2.1.5-1~debian.11~bullseye
    docker-ce = 5:29.0.0-1~debian.11~bullseye
    docker-ce-cli = 5:29.0.0-1~debian.11~bullseye
    docker-ce-rootless-extras = 5:29.0.0-1~debian.11~bullseye

  5. Docker service status:
    Docker service is active

==========================================

Troubleshooting steps:

  1. Verify the dockerd binary was actually replaced:
    dockerd --version
    (Should show version 24.0.x)

  2. Manually restart Docker to ensure new binary loads:
    sudo systemctl stop docker
    sudo pkill -9 dockerd
    sudo systemctl start docker
    docker version

  3. Check if there are multiple Docker installations:
    which -a docker
    which -a dockerd

  4. Verify package installation succeeded:
    dpkg -l | grep docker-ce
    (Should show version 5:24.0.x-1~…)

  5. Check Docker daemon logs for errors:
    sudo journalctl -u docker --no-pager -n 50

Step 8: Configuring Docker permissions…
Running as root - skipping docker group addition

Step 9: Restarting CasaOS services…
Starting CasaOS services…
Starting casaos-gateway.service…
Starting casaos-message-bus.service…
Starting casaos-user-service.service…
Starting casaos-local-storage.service…
Job for casaos-local-storage.service failed because the control process exited with error code.
See “systemctl status casaos-local-storage.service” and “journalctl -xe” for details.
Starting casaos-app-management.service…
Starting casaos.service…

==========================================

CasaOS Docker Fix Complete!

Docker has been set to version 24.0.x (compatible with CasaOS)
Docker packages have been held to prevent automatic upgrades.

To allow Docker to be upgraded in the future, run:
sudo apt-mark unhold docker-ce docker-ce-cli containerd. io

The Docker client version error should now be resolved.
You can now run your Docker commands without API version issues.

:warning: Docker API version unchanged: 1.52
This may indicate the downgrade didn’t take effect.
Please review the troubleshooting steps above.

root@omvdell:~# docker version
Client: Docker Engine - Community
Version: 29.0.0
API version: 1.52
Go version: go1.25.4
Git commit: 3d4129b
Built: Mon Nov 10 21:47:13 2025
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 29.0.0
API version: 1.52 (minimum version 1.44)
Go version: go1.25.4
Git commit: d105562
Built: Mon Nov 10 21:47:13 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v2.1.5
GitCommit: fcd43222d6b07379a4be9786bda52438f0dd16a1
runc:
Version: 1.3.3
GitCommit: v1.3.3-0-gd842d771
docker-init:
Version: 0.19.0
GitCommit: de40ad0
root@omvdell:~# which docker
/usr/bin/docker

For those trying ALL of the solutions presented here and reddit who still have got nothing solved, here’s the only thing I’ve found that truly worked for me, on first try:

Moderator Note:
The external blog link was removed because it was posted as a referral without a summary, context, or explanation of the steps.
To keep solutions accessible and help all community members, we ask that you include direct instructions, summaries, or personal experience in your post.
Thanks for understanding and for helping keep the forum helpful for everyone!

if you are not able to create the file directly due to an error:

Fist navigate to /etc/systemd/system/

cd /etc/systemd/system/

create the docker.service.d folder:

mkdir docker.service.d

then create the override.conf file and paste the snippet:

sudo nano override.conf

paste the following, Ctrl+X and save:

[Service]
Environment=DOCKER_MIN_API_VERSION=1.24

afterall, restart docker and restart the system, aaand, ta-daah. Fixed! Fast and simple.

Regarding what it does, and how to adjust it later on after this bug is fixed I’m not sure, I’m on CasaOS and linux for about 6 months now, very little knowledge on it all.

But….. due to the simplicity of the fix, I guess I will just delete the docker.service.d folder created later on and it should be back to standard.

2 Likes

Hello @Malagoni,

You can fix the Docker API version error in CasaOS by running the following one-liner:

bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh)"

This script will automatically detect your OS, check for Docker compatibility, and set up the correct Docker version for CasaOS (along with any needed fixes for LXC/Proxmox or permission issues).

@dragonfire1119 That didn’t work for me as I posted above with failure messages.. Debian with OMV (open media vault)

I’m working on a pull request to fix the errors above.

@Malagoni solution worked for me , as I mentioned I am on Open Media Valut (which uses Debian but has its own apt repo so the solution your script tries fails because of the conflict)

1 Like

Unfortunately this script didn’t work for me, first the WebUI terminal crashed, went for SSH and it took ages stuck, then I copied the .sh, chmod it and bash runned, still an error, went back to the wget waited for the ages until it loaded and also crashed.

the crashing also happened to the healthcheck script.

I tried other things as well, but only ended the problem with the external override.conf file.

@Eric_Gustafson Just released 1.6.1 that should fix this issue.

@Malagoni Sounds like a network timeout. Can you try:

bash -c "$(wget -O - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh)"

this worked for me. thanks

Hello @lrname_name did the script not work up top that makes this easy? Did you get any errors?

Hi, the script didn't work for me; I'm getting an error message.

root@pi-5:/home/pi# bash -c "$(wget -O - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh)"
--2025-11-18 22:13:33--  https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh
Auflösen des Hostnamens raw.githubusercontent.com (raw.githubusercontent.com)… 185.199.109.133, 185.199.108.133, 185.199.110.133, ...
Verbindungsaufbau zu raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 404 Not Found
2025-11-18 22:13:33 FEHLER 404: Not Found.

Try curl -I https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-fix-docker-api-version/run.sh from both your problematic device and another one; compare headers and status codes.