How to fix Docker.app will damage your computer warning on MacOS?

The warning message “'Docker.app' will damage your computer” on macOS indicates that macOS’s security features, such as Gatekeeper, have flagged Docker as potentially harmful. This warning can arise from:

  1. A false positive by macOS or antivirus software.
  2. A corrupted Docker installation.
  3. A compromised Docker binary downloaded from an untrustworthy source.

Here’s how you can resolve this issue step-by-step:


1. Verify the Source of Docker

Ensure you downloaded Docker Desktop from its official source. If not:


2. Update macOS

Make sure your macOS is up-to-date, as updates can resolve false-positive security alerts.

  1. Go to System Preferences > Software Update.
  2. Install any pending updates.
  3. Restart your system and retry launching Docker.

3. Check for Malware

The warning could also indicate that the Docker binary has been tampered with. Scan your system for malware using reliable tools:

  • Use macOS’s built-in malware scanner:
    • macOS may have quarantined Docker. Open System Preferences > Security & Privacy > General and check if there’s an option to allow Docker.
  • Run a third-party malware scan:

4. Reinstall Docker Desktop

To ensure a clean installation:

Remove the Existing Docker Installation

  1. Open Terminal and run the following commands to remove Docker and related files:bash
    sudo rm -rf /Applications/Docker.app
    sudo rm -rf ~/Library/Group\ Containers/group.com.docker
    sudo rm -rf ~/Library/Containers/com.docker.docker
    sudo rm -rf ~/Library/Application\ Support/Docker\ Desktop
    sudo rm -rf ~/.docker
  2. Clear cached Docker preferences:bash
    sudo rm -rf ~/Library/Preferences/com.docker.docker.plist

Reinstall Docker

  1. Download Docker Desktop from the official website:
  2. Install it by dragging the .app file to your Applications folder.
  3. Open Docker Desktop. If prompted, follow the instructions to allow it through macOS security.

5. Manually Allow Docker in Gatekeeper

If Docker is still flagged after reinstalling:

  1. Open System Preferences > Security & Privacy > General.
  2. You should see a message that Docker was blocked. Click Allow Anyway.

Alternatively, use Terminal to manually override Gatekeeper for Docker:

sudo spctl --add /Applications/Docker.app
sudo xattr -rd com.apple.quarantine /Applications/Docker.app

6. Verify Docker Installation

To confirm Docker is working correctly:

  1. Open Terminal and run:bash
    docker --version
  2. Run a test container:bash
    docker run hello-world
    If Docker is correctly installed, you’ll see a success message.

7. Report to Docker or Apple

If the issue persists and you suspect a false positive:

No images available.