Synology: How to Back Up Docker Containers

Synology How to Back Up Docker Containers

So many of you have been asking me lately how to do a backup of your Docker Containers to prevent loss of data in case your NAS crashes or there is an unforeseen event that could jeopardize your working environment setup. In this article we will discover together, in a few simple steps, how to do a complete backup of your Docker Containers so that you may enjoy peace of mind across the board. You all know the main STEP on mariushosting, which is the most important one: Please Support My work by Making a Donation. So, before you get started, make sure this STEP is done to avoid karma🙂. Below I will present 3 different backup options for your Docker containers for the three main installation methods you may employ.

đź“’Back Up Docker Containers That Use Portainer

  • STEP 1 RULE 1

For the first backup option, let’s consider a Docker guide that uses the Portainer installation, for example, PaperlessNGX. What you need to do first is back up the paperlessngx folder that you find in File Station, under the Docker folder, on an USB or on another NAS or a PC. For this operation, you can use Synology Hyper Backup that automates the process, or you can opt for a manual backup of this folder on your USB key which you can do from time to time. My advice for all users is to use Synology’s Hyper Backup package that you can find in Package Center. If you have another NAS, the procedure is quite simple and straightforward. And you can also upload your backup file in your Cloud service such as Dropbox, Synology C2 etc. Check out my Guide on Hyper Backup and the Example guide on Hyper Backup.

đź’ˇBasically, to resume STEP 1 RULE 1: It’s mandatory to make a backup of your paperlessngx folder.

  • STEP 1 RULE 2

Make sure to back up Portainer using my guide. The Portainer backup will save you a lot of headache because it will save all your stack compose codes.

đź’ˇBasically, to resume STEP 1 RULE 2: It’s mandatory to make a backup of your Portainer settings.

  • STEP 1 RULE 3

Disaster Scenario: Let’s imagine you’ve lost all access to your own NAS, the one you have the paperlessngx folder on.

  1. In a new NAS, just reinstall Docker or the Container Manager Package from Package Center.
  2. Re-upload the paperlessngx folder in the Docker folder (STEP 1 RULE 1)
  3. Install Portainer using my guide. Use the backup file to restore Portainer (STEP 1 RULE 2). Go to the Portainer stack, select your paperlessngx stack, then click Deploy Stack.
  4. Enjoy your PaperlessNGX from your Backup.

🗒️Using this same procedure, you can back up all your other containers and restore them, if needed, in a few simple steps. For example, you can back up your entire Docker Folder altogether, then re-deploy all the stack one by one using Portainer.

đź“’Back Up Docker Containers That Use Task Scheduler

  • STEP 2 RULE 1

For the second backup method, let’s consider a Docker guide that has a Task Scheduler installation, such as Pi-Hole. First of all, back up the pihole folder that you find in File Station, under the Docker folder, using Synology Hyper Backup. You will find the Synology Hyper Backup package in Package Center. If you have another NAS, the procedure is quite simple and straightforward. And you can also upload the pihole folder in your Cloud service such as Dropbox, Synology C2 etc. Check out my Guide on Hyper Backup and the Example guide on Hyper Backup.

đź’ˇBasically, to resume STEP 2 RULE 1: It’s mandatory to make a backup of your pihole folder using Hyper Backup.

  • STEP 2 RULE 2

Disaster Scenario: Let’s assume you’ve lost the access to your own NAS, the one you have the pihole folder on.

  1. In the new NAS, just reinstall Docker or the Container Manager Package from Package Center.
  2. Re-upload the pihole folder in the Docker folder, and your DSM settings backup, using Hyper Backup (STEP 2 RULE 1)
  3. Your Task Scheduler codes are automatically saved with Hyper Backup so you will still have all your codes. Go to Task Scheduler, then run the Install Pi-Hole task.
  4. Enjoy your Pi-Hole from your Backup.

🗒️Using this same procedure, you can back up all your other containers and restore them, if needed, in a few simple steps. For example, you can back up your entire Docker Folder altogether, then run all the tasks again for every container that uses Task Scheduler as the installation method.

đź“’Back Up Docker Containers That Use Container Manager

  • STEP 3 RULE 1

For the third backup method, let’s consider a Docker guide that uses Container Manager for the installation together with a Project. Back up the entire Docker folder that you find in File Station using Synology Hyper Backup. You will find the Synology Hyper Backup package in Package Center. If you have another NAS, the procedure is quite simple and straightforward. You can also upload the pihole folder in your Cloud service such as Dropbox, Synology C2 etc. Check out my Guide on Hyper Backup and the Example guide on Hyper Backup.

đź’ˇBasically, to resume STEP 3 RULE 1: It’s mandatory to make a backup of your entire Docker folder using Hyper Backup.

  • STEP 3 RULE 2

Disaster Scenario: Say you’ve lost all access to your own NAS, the one you have all your Docker Containers on.

  1. In the new NAS, just reinstall Docker or the Container Manager Package from Package Center.
  2. Re-upload the Docker folder using Hyper Backup (STEP 3 RULE 1)
  3. In Container Manager, on the left sidebar, click Project. Run the Project that you want again simply by copy-pasting your Project compose.
  4. Enjoy your Docker Containers from your Backup.

🗒️Using this same procedure, you can back up all your other containers and restore them, if needed, in a few simple steps. For example, you can back up your entire Docker Folder altogether, then run all the projects for every docker that uses a Project Compose for the installation method again.

This post was updated on Saturday / February 24th, 2024 at 5:10 AM