Docker disappears after installing 1panel on a server with Docker already installed

Scenario Reproduction

A host has many Docker containers installed. To facilitate management, 1Panel was installed, and during the installation of 1Panel, image acceleration was selected.
As a result, after 1Panel was installed, all previous Docker containers disappeared.

docker ps -a  

Only a few 1Panel images were visible.

Cause

During the installation of 1Panel, once image acceleration is selected, 1Panel directly modifies the daemon.json file to enable image acceleration. The problem is that this file contains not only the image sources but also Docker’s configuration path. Once overwritten, the Docker configuration path is lost, and naturally, all Docker containers become invisible.

During the installation of 1Panel, the following operations are performed on the existing Docker configuration:

  1. Detects the installed Docker service
  2. Prompts the user whether to configure image acceleration
  3. If the user chooses “Yes,” the system will:
    • Backup the original daemon.json file as daemon.json.1panel_bak
    • Generate a new daemon.json configuration file
    • Restart the Docker service

If image acceleration was accidentally selected during 1Panel installation and the file was overwritten, there is still a way to fix it.

Retrieve daemon.json.1panel_bak, rename it to daemon.json, and then restart Docker with systemctl restart docker.

References