WIUNIX ACADEMY
Prometheus and Grafana with Docker Compose: private monitoring and recovery
Page 6 of 6. Review the earlier steps and prerequisites before continuing.
YOUR SYSTEM. YOUR STEPS.
Where are you working?
Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.
USE YOUR OWN VALUES
Configure this tutorial
Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.
Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.
Set values for my environment11 editable values
LET’S BUILD
Return to the preserved directory if needed
Run only after a failed recovery rehearsal, with the preserved before-restore directory present. This moves the failed restored tree aside without deleting it. If configuration/digest changes were involved, the old complete tree must include the matching old images and database; do not downgrade only Grafana’s image after a schema-changing upgrade.
Dedicated Linux host; Bash shell
sudo bash -eu <<'ROLLBACK'
[[ -d '/srv/academy-monitor.before-restore' && ! -e '/srv/academy-monitor.failed-restore' ]]
docker compose -f '/srv/academy-monitor/compose.yaml' down --timeout 60
mv '/srv/academy-monitor' '/srv/academy-monitor.failed-restore'
mv '/srv/academy-monitor.before-restore' '/srv/academy-monitor'
docker compose -f '/srv/academy-monitor/compose.yaml' up -d
ROLLBACK
Preserved stack runs again; repeat readiness and history checks.
LET’S BUILD
Update deliberately and retire reversibly
Before changing a digest, review both vendors’ release/security/migration notes, rehearse the stopped backup and test the new version on separate approved infrastructure. Record OS package versions, both image digests, configuration and restore evidence together. There is no automatic latest/watchtower update here. For retirement, the next panel removes only this project’s containers/network and preserves bind data, configuration, secrets and backup for your approved retention/deletion process. It does not uninstall Docker or prune shared resources. Close the SSH tunnel normally. After secret compromise, rotate the actual Grafana account and revoke sessions/affected data-source credentials; replacing only the bootstrap file is insufficient.
Dedicated Linux host; Bash shell
sudo docker compose -f '/srv/academy-monitor/compose.yaml' down --timeout 60
Project containers/network stopped; persistent files remain for an explicit retention decision.
GO TO THE SOURCE
Official references
Each environment states how it was reviewed. A documentation review does not claim a hands-on test of every version.
- Docker Ubuntu installation
- Docker Debian installation
- Compose stable releases
- Prometheus release
- Grafana OSS release
- Compose networking
- Docker port publishing
- Compose secrets
- Prometheus Docker installation
- Prometheus storage
- Prometheus file discovery
- Prometheus management API
- Grafana Docker configuration
- Grafana provisioning
- Grafana backup
KEEP LEARNING