Portainer Stack Exporter
This is a small tool to export Docker-Compose Yaml definitions from Portainer to separate files for easy backup.
Preparations
-
Generate a new Access Token in Portainer (My account --> Access tokens)
-
Copy the
CONFIG.example
toCONFIG
and update the URL to your Portainer instance as well as the access token you've generated in step 1 -
Install project dependencies (requests and rich) by running your favourite dependency manager. (If you're using uv, it'll do this automatically on the first run.)
Usage
Just run the porta_dump.py
directly - you might have to set the execute bits first:
chmod a+x porta_dump.py
./porta_dump.py
It'll write all files into the current directory.
Languages
Python
100%