Create Backup Docker and Portainer

  • Hi,


    is there a simple guide for a newcomer and little knowledge of Linux how I can backup and restore selected Docker containers, portainer settings, images (Pihole, OpenVpn)?


    If my SD card crashes or I want to set up the whole thing again, I simply want to create the containers again in Portainer. It is important that all my settings and functions run again immediately!


    Maybe there is also a graphic plugin for Openmediavault 5 to secure individual containers.


    Thanks a lot

  • If you set an individual share and use it as docker root (you can do so in OMV-Extras -> Docker), you are able to backup it to an external drive with OMVs own USB backup plugin. If you set up your containers through docker compose files or portainer stacks, these definitions contain everything needed to restore complete functionality of your containers. Setup of container volumes within the shared docker folder is required.

    Chaos is found in greatest abundance wherever order is being sought.
    It always defeats order, because it is better organized.
    Terry Pratchett

  • If you want to create a docker-compose file from a running docker container, run this in the shell. You can redirect it to a file if you wish.


    Code
    docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose:latest container_name

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Hello, I have now set up the following planned script. I hope it works.


    Code
    sudo systemctl stop docker && sudo rsync -ahhvX --stats --progress --delete /var/lib/docker/ /srv/dev-disk-by-label-Data/Data/Backup/Backup-Docker-System && sudo systemctl start docker

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!