# Pangolin Stack Backup & Update Management Script-December-2025-Version

**URL:** <https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591>\
**Category:** Firewalls & Security\
**Tags:** scripts, pangolin\
**Created:** [March 3, 2025, 3:57pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591 "2025-03-03T15:57:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [March 3, 2025, 3:57pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/1 "2025-03-03T15:57:24Z")

</div>

# Pangolin Stack Backup & Update Management Script

 ![image](https://forum-cdn.hhf.technology/original/1X/fe9756b6f34847f94bf65caa5f3bff9a92d7e28b.png)

# Tested on Debian, Alma, and Ubuntu 24.04(Prefered)

## Introduction

This guide explains how to use the Pangolin Stack Backup & Management Script, a utility for managing Docker-based Pangolin deployments with automated backup, restore, and update functionality.

## Prerequisites

Before using the script, ensure you have:

- Pangolin and/or Crowdsec installed
- Sufficient disk space for backups
- Proper permissions to run Docker commands
- The script file with execute permissions (`chmod +x pangolin-backup-upgrade.sh`)

## Basic Usage Guide

### Getting Started

1. **Download the script** :  
Place the script in your Pangolin installation directory (where your `docker-compose.yml` file is located).

2. **Make it executable** :

3. **Run the script in interactive mode** :

### Interactive Menu Navigation

When you run the script without arguments, you’ll see the main menu with these options:

```auto
PANGOLIN BACKUP & UPDATE MANAGEMENT UTILITY
==================================

Current Configuration:
Backup Directory: /path/to/pangolin/backups
Retention Period: 60 days
Backup Items: 2 items

Backup & Restore Options:
1. Create Backup
2. Restore from Backup
3. List Available Backups
4. Delete Specific Backups
5. Configure Backup Settings
6. Setup Cron Job

Update Options:
7. Update Stack (excluding CrowdSec)
8. Update Stack (including CrowdSec)

9. Exit

Enter your choice [1-9]:

```

## Detailed Feature Walkthrough

### Creating Backups

#### Method 1: Interactive Menu

1. Run the script: `./pangolin-backup-upgrade.sh`
2. Select option `1` from the main menu
3. The script will create a backup of your Pangolin configuration in the configured backup directory
4. Upon completion, you’ll see a success message with the backup location

#### Method 2: Command Line

```bash
./backup-update-master.sh backup

```

For non-interactive use (like in cron jobs):

```bash
./backup-update-master.sh --cron backup

```

#### What Gets Backed Up

By default, the script backs up:

- Your `docker-compose.yml` file
- The entire `config` directory

### Listing Backups

#### Method 1: Interactive Menu

1. Run the script: `./setup_backup_update_manager.sh`
2. Select option `3` from the main menu
3. You’ll see a list of all available backups with indexes

#### Method 2: Command Line

This must be run in interactive mode:

```bash
./backup-update-master.sh list

```

### Restoring Backups

#### Method 1: Interactive Menu

1. Run the script: `./setup_backup_update_manager.sh`
2. Select option `2` from the main menu
3. You’ll see a list of available backups
4. Enter the index of the backup to restore, or `l` for the latest backup
5. Confirm the restore operation by typing `YES` when prompted
6. Choose whether to stop running services before restore
7. After restore completes, choose whether to start services again

#### Method 2: Command Line

Restore from a specific backup:

```bash
./backup-update-master.sh restore backups/pangolin_backup_20250101_120000.tar.gz

```

### Deleting Backups

#### Method 1: Interactive Menu

1. Run the script: `./setup_backup_update_manager.sh`
2. Select option `4` from the main menu
3. You’ll see a list of available backups
4. Enter the index of the backup to delete, multiple indexes separated by spaces, or `a` for all
5. Confirm the deletion when prompted

#### Method 2: Command Line

Delete a specific backup by index:

```bash
./backup-update-master.sh delete 2

```

### Configuring Backup Settings

1. Run the script: `./setup_backup_update_manager.sh`

2. Select option `5` from the main menu

3. The configuration menu offers these options:

4. To change the backup directory:

5. To change retention period:

6. To manage backup items:

7. Remember to select option `4` to save your configuration changes

### Setting Up Automatic Backups

1. Run the script: `./setup_backup_update_manager.sh`

2. Select option `6` from the main menu

3. You’ll see the cron job setup options:

4. Select the desired schedule or choose option `4` for a custom cron expression

5. Confirm the setup to create the scheduled backup job

### Updating the Pangolin Stack

#### Basic Update (Without CrowdSec)

1. Run the script: `./setup_backup_update_manager.sh`
2. Select option `7` from the main menu
3. The script will:
  - Check your current docker image tags
  - Ask for new versions for each component
  - Backup your current configuration
  - Pull new images
  - Stop and restart services with the new versions

#### Full Update (With CrowdSec)

1. Run the script: `./setup_backup_update_manager.sh`
2. Select option `8` from the main menu
3. Follow the same process as the basic update, but including CrowdSec

#### Update Process Notes

- You can press Enter to keep the current version of any component
- Type `c` at any prompt to cancel the update
- The script creates a backup before updating
- If services fail to start after update, you’ll be offered recovery options

## Command Line Reference

The script supports these command-line options:

```bash
./backup-update-master.sh [OPTIONS] [COMMAND]

```

### Options

- `--cron`: Run in non-interactive mode (for cron jobs)
- `--dry-run`: Simulate actions without making actual changes
- `--config FILE`: Use alternative config file
- `--dir PATH`: Override backup directory
- `--help`: Show help message

### Commands

- `backup`: Create a backup
- `restore [DIR]`: Restore from a backup
- `delete [INDEX]`: Delete specific backup
- `update-basic`: Update stack excluding CrowdSec
- `update-full`: Update stack including CrowdSec

### Examples

- Create backup in cron mode:

```bash
./backup-update-master.sh --cron backup

```

- Restore from specific backup:

```bash
./backup-update-master.sh restore backups/pangolin_backup_20250101_120000.tar.gz

```

- Simulate an update:

```bash
./backup-update-master.sh --dry-run update-full

```

## Troubleshooting Tips

### Permissions Issues

- Ensure the script has execute permissions
- Make sure you have permissions to run Docker commands
- Check the backup directory is writable

### Docker Not Running

- The script will warn you if Docker is not running
- Start Docker and try again

### Backup/Restore Issues

- If restore fails, the script will keep a backup of your current configuration
- If paths have changed, adjust the backup items accordingly

### Update Problems

- If services fail to start after an update, check logs with Docker Compose
- Use the script’s recovery options to restore from a backup
- Try updating individual services if a full update fails

## Best Practices

1. **Regular Backups** : Configure a cron job for automatic, scheduled backups
2. **Test Restores** : Periodically test the restore process to ensure backups are valid
3. **Multiple Backup Locations** : Configure an external backup directory to keep backups separate from the Pangolin installation
4. **Before Major Changes** :
  - Create a manual backup before making significant changes
  - Use the `--dry-run` option to simulate operations before running them

5. **Cleanup Old Backups** : Review and delete unnecessary backups to save disk space

By following this guide, you should be able to effectively manage your Pangolin installation, keeping it backed up and up-to-date.

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [March 6, 2025, 11:28am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/2 "2025-03-06T11:28:30Z")

</div>



---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [March 11, 2025, 5:33pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/3 "2025-03-11T17:33:16Z")

</div>



---

<div class="post-metadata">

**Author:** ![gyrene2083](https://forum.hhf.technology/user_avatar/forum.hhf.technology/gyrene2083/32/67_2.png) [@gyrene2083](https://forum.hhf.technology/u/gyrene2083)\
**Post date:** [December 7, 2025, 9:16pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/4 "2025-12-07T21:16:07Z")

</div>

Are we still using this script to update pangolin? I ask because it seems to consistently fail when it tries to restart pangolin.

The interesting thing though, after it failed to start I exited out and just used the installer script and that seemed to start the container.

So just curious how is everyone updating pangolin?

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 8, 2025, 5:23am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/5 "2025-12-08T05:23:25Z")

</div>

@gyrene2083

Sir Please Check. I have made amends. it should work

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 8, 2025, 8:58am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/6 "2025-12-08T08:58:23Z")

</div>



---

<div class="post-metadata">

**Author:** ![gyrene2083](https://forum.hhf.technology/user_avatar/forum.hhf.technology/gyrene2083/32/67_2.png) [@gyrene2083](https://forum.hhf.technology/u/gyrene2083)\
**Post date:** [December 8, 2025, 2:09pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/7 "2025-12-08T14:09:11Z")

</div>

Good evening hhf. I redownloaded the script, and ran it and I am still getting having the same problem. It just seems to get stuck trying to restart pangolin.

 ![image](https://forum-cdn.hhf.technology/original/2X/f/fe3d86e3f92bfc879842ce250240364f205413d5.jpeg)

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 8, 2025, 4:02pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/8 "2025-12-08T16:02:31Z")

</div>

please check now.

 ![image](https://forum-cdn.hhf.technology/original/2X/8/8b3162ebaccc6e77aa5241ca6db032e13cc0f0d2.png)

---

<div class="post-metadata">

**Author:** ![apperrault](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@apperrault](https://forum.hhf.technology/u/apperrault)\
**Post date:** [December 11, 2025, 2:23pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/9 "2025-12-11T14:23:39Z")

</div>

I have noticed based on my tests that I have to run this with sudo to get all the files backed up, is this normal?  
I ran the pangolin installer the way that it was recommended, which I believe is with Sudo, and now when I try and run the backup without sudo it gives me an error on the .docker/config/letsencrypt/acme.json file

Thanks for this great stuff

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 12, 2025, 4:19am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/10 "2025-12-12T04:19:38Z")

</div>

yes, this will only work with sudo.

---

<div class="post-metadata">

**Author:** ![europacafe](https://forum.hhf.technology/user_avatar/forum.hhf.technology/europacafe/32/3600_2.png) [@europacafe](https://forum.hhf.technology/u/europacafe)\
**Post date:** [December 13, 2025, 1:51am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/11 "2025-12-13T01:51:57Z")

</div>

Thanks a lot for the script. It works with sudo. Just upgrade to latest pangolin and newt.

---

<div class="post-metadata">

**Author:** ![ilco3](https://forum.hhf.technology/user_avatar/forum.hhf.technology/ilco3/32/1759_2.png) [@ilco3](https://forum.hhf.technology/u/ilco3)\
**Post date:** [December 18, 2025, 3:13pm UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/12 "2025-12-18T15:13:07Z")

</div>

tnx works like a charm . it updates without any problems .

---

<div class="post-metadata">

**Author:** ![pdmarf](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/p/4af34b/32.png) [@pdmarf](https://forum.hhf.technology/u/pdmarf)\
**Post date:** [December 19, 2025, 7:19am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/13 "2025-12-19T07:19:58Z")

</div>

Thanks so much for this, update worked great! Can i ask, does newt get updated as part of this? my pangolin site is still telling me newt is out of date.

 ![image](https://forum-cdn.hhf.technology/original/2X/3/3eb116d1c6dc804327be65c54863bf6c502a25d4.png)

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 19, 2025, 10:58am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/14 "2025-12-19T10:58:16Z")

</div>

no. newt is remote. script has no access to remote machines

---

<div class="post-metadata">

**Author:** ![europacafe](https://forum.hhf.technology/user_avatar/forum.hhf.technology/europacafe/32/3600_2.png) [@europacafe](https://forum.hhf.technology/u/europacafe)\
**Post date:** [December 23, 2025, 6:40am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/15 "2025-12-23T06:40:04Z")

</div>

Pangolin 1.14.0 now requires Badger 1.3.1+. Does the script still work for upgrading from 1.13.1 to 1.14.0?

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 23, 2025, 7:00am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/16 "2025-12-23T07:00:07Z")

</div>

badger is traefik plugin, it doesn’t touch any core files for stability, each user has custom config

---

<div class="post-metadata">

**Author:** ![europacafe](https://forum.hhf.technology/user_avatar/forum.hhf.technology/europacafe/32/3600_2.png) [@europacafe](https://forum.hhf.technology/u/europacafe)\
**Post date:** [December 23, 2025, 7:13am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/17 "2025-12-23T07:13:46Z")

</div>

Thanks. I’m no Traefik user; just use it for Pangolin. Never saw any Pangolin releases mentioned Badger, except in the 1.14.0 release.

So I have to check which version of Badger plugin has been installed on my current Traefik, and update it, if necessary?

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 23, 2025, 7:15am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/18 "2025-12-23T07:15:42Z")

</div>

yes it will definitely will be there in config folder , traefik\_config.yml

 ![image](https://forum-cdn.hhf.technology/original/2X/0/038a3d49df8a7a0874cc86d1acf43ae3aff29890.png)  
 ![image](https://forum-cdn.hhf.technology/original/2X/7/7a143d2436329bb1977c1a40653a53160d459ab2.png)

Mine is old deployment so i have not updated it yet

---

<div class="post-metadata">

**Author:** ![europacafe](https://forum.hhf.technology/user_avatar/forum.hhf.technology/europacafe/32/3600_2.png) [@europacafe](https://forum.hhf.technology/u/europacafe)\
**Post date:** [December 23, 2025, 10:17am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/19 "2025-12-23T10:17:08Z")

</div>

Thank you for the config location.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Pickles](https://forum.hhf.technology/user_avatar/forum.hhf.technology/jimmy_pickles/32/4332_2.png) [@Jimmy\_Pickles](https://forum.hhf.technology/u/Jimmy_Pickles)\
**Post date:** [December 27, 2025, 10:28am UTC](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591/20 "2025-12-27T10:28:36Z")

</div>

This script works nearly perfectly. But when I try to set a backup schedule (say daily), it will say I successfully set a cron job. But then if I go back and check again, it shows no cron job is set and no backup is made at the scheduled time. Any idea why it’s not saving my selection?

[Next page](https://forum.hhf.technology/t/pangolin-stack-backup-update-management-script-december-2025-version/591.md?page=2)
