Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Installer overwrites /etc/docker/daemon.json, deleting custom configs like data-root #7675

@CtrlAltFocus

Description

@CtrlAltFocus

Error Message and Logs

The Coolify install.sh script aggressively manages /etc/docker/daemon.json to enforce logging standards and address pools. However, it does not robustly merge these settings with existing configurations.

If a user has pre-configured Docker to use a custom data directory (e.g., for persistent storage on a separate volume):

 1 {
 2   "data-root": "/mnt/data/docker"
 3 }

The installer overwrites this file with its own template (logging + address pools), causing Docker to lose the data-root setting.

Impact:

  1. Docker restarts and reverts to /var/lib/docker (Root disk).
  2. Any existing data on the custom volume is ignored.
  3. New data (volumes, images) fills up the root disk instead of the intended persistent volume.
  4. Infrastructure-as-Code setups (Terraform/Cloud-init) that configure storage before installing Coolify are broken.

To Reproduce

  1. Configure /etc/docker/daemon.json with {"data-root": "/mnt/data"}.
  2. Run the Coolify install script: curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash.
  3. Check cat /etc/docker/daemon.json.
    • Result: data-root key is missing.
    • Expected: data-root should be preserved, merged with Coolify's logging config.

Proposed Solution
The installer should use jq (which it installs anyway) to securely merge the required logging/network config into the existing JSON file, rather than overwriting it with a static template.

Workaround
Currently, we have to implement a post-install hook to detect the overwrite, migrate any data created in /var/lib/docker during the installation window, and restore the correct daemon.json.

Steps to Reproduce

  1. Configure /etc/docker/daemon.json with {"data-root": "/mnt/data"}.
  2. Run the Coolify install script: curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash.
  3. Check cat /etc/docker/daemon.json.
    • Result: data-root key is missing.
    • Expected: data-root should be preserved, merged with Coolify's logging config.

Example Repository URL

No response

Coolify Version

4.0.0-beta.454

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.04 LTS

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 Possible BugReported issues that need to be reproduced by the team.🔍 TriageIssues that need assessment and prioritization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions