Skip to content

Disaster Recovery & Backups

StackPilot provides backup and rollback mechanisms intended to reduce recovery risk. Operators must test restores and retain independent backups; no backup mechanism guarantees business continuity.


1. Backup Modes Overview

In the Central Hub under Settings → Backups, operators can select from three disaster recovery modes:

Backup Mode Target Scope Storage Location Restoration Method Ideal Use Case
Proxmox VE API (pve_api) Full Host (LXC Container) Proxmox Storage / PBS Proxmox Web GUI / pct restore Homelabs running LXC containers on Proxmox VE
NFS Mount (nfs) Application Data & Volumes Mounted NFS Share (/mnt/backups) In-Hub One-Click Rollback Bare-metal Linux nodes or non-PVE hypervisors
Disabled (disabled) None None Manual only Ephemeral, staging, or test environments

2. Proxmox VE API Mode (pve_api)

When your StackPilot nodes run inside Proxmox VE unprivileged LXC containers, Proxmox VE API mode provides instantaneous host-level disaster recovery via vzdump snapshots.

flowchart LR hub["StackPilot Hub"] -->|"Create pre-update snapshot"| pve["Proxmox VE"] pve -->|"Store backup archive"| storage["Configured backup storage"] pve -->|"Report task status"| hub hub -->|"Continue after success"| agent["Host agent applies update"]

Configuration:

  1. Navigate to Settings → Backups → Proxmox VE API.
  2. Enter your Proxmox credentials:
  3. PVE API Host: e.g. https://pve.lan:8006
  4. User / Token ID: e.g. root@pam!stackpilot
  5. Token Secret: Your generated Proxmox API token secret
  6. Storage Pool: Target backup storage (e.g. local-zfs, backup-nfs, pbs-pool)
  7. Verify SSL: Toggle if using self-signed certificates.
  8. Click Save Configuration.

Key Behaviors:

  • Pre-Update Snapshots: Whenever a bulk or single container update is triggered, StackPilot calls Proxmox to snapshot the entire LXC container before updating any software.
  • Task Tracking: StackPilot monitors the Proxmox task UPID in the background until the snapshot completes successfully.
  • Context-Aware Button Visibility: Because backups are taken at the full LXC host level, individual container-level [Backups] buttons are automatically hidden across pod and service rows in the UI, keeping the interface uncluttered.
  • Snapshot Pruning: Old snapshots can be pruned automatically based on your Proxmox retention policy.

[!IMPORTANT] Host-Level vs. Selective Restore in PVE Mode: Proxmox VE snapshots are taken at the full container filesystem level. Restoring a PVE snapshot rolls back the entire LXC host (including all workloads, logs, and system files) to that exact point in time. If you need selective single-container rollback on a multi-tenant host, consider utilizing NFS Mount mode instead.


3. NFS Mount Mode (nfs)

For bare-metal installations or setups where hypervisor API access is unavailable, NFS Mount mode archives application state at the workload level:

How It Works:

  • On the agent host, backup storage is mounted at /mnt/backups/<app>/.
  • Before updating a container or stack, the agent stops the service, creates a compressed archive of persistent volumes (backup_<timestamp>.tar.gz), and rotates previous archives.
  • If an update fails or introduces breaking changes, the operator can roll back immediately.

Performing a One-Click Rollback:

  1. Locate the pod or service in the Workloads view.
  2. Click the Backups action button.
  3. The backups modal displays all historical archives with creation dates and file sizes.
  4. Click Restore on the desired backup point.
  5. StackPilot shuts down the workload, extracts the archive over the application data directory, and restarts the systemd service.

Manual On-Demand Backups:

You can trigger an immediate backup of any workload at any time by opening the Backups modal and clicking Backup Now.


4. Port Conflict Preflight & Deletion Cleanup

Port Preflight Check

During workload deployment or migration, StackPilot inspects host network sockets to verify that required published ports are free. If a collision is detected (e.g. port 80 already bound by another service), StackPilot flags the conflicting service and halts deployment before a failure occurs.

Deletion Cleanup Commands

When deleting a workload via Remove: - StackPilot audits any host firewall rules (UFW) opened for the application. - It generates specific, copy-paste terminal cleanup commands for firewall ports and removed secrets.