Docker Community Forums

Share and learn in the Docker community.

Backup Docker Swarm


(Josephgonzales) #1

I am reading how to backup the Swarm. I read “Docker manager nodes store the swarm state and manager logs in the /var/lib/docker/swarm/ directory.” from here

Does that mean it is already backup? OR Do we need to do anything else? I do not see any steps, or code to write.

It says 3.Back up the entire /var/lib/docker/swarm directory. but how I do not see any docker code or steps to back it up.

Does anyone have steps?

(Emily Shepherd) #2

/var/lib/docker is just a directory like any other, so a rudimentary form of backup would be to just copy it:

cp -r /var/lib/docker ~/docker-backup

Another form you could do is create a zipped archive of it, to make it easy to move around, possibly saving it off server:

tar czf docker-backup.tar.gz -C /var/lib/docker .