Restic + REST Server + Prometheus
Fast and secure backup program with REST server.
Overview
Restic REST Server is a dedicated HTTP server that provides a REST API backend for the Restic backup tool, enabling centralized backup storage over HTTP/HTTPS. Originally developed to offer a lightweight alternative to cloud storage backends, restic-rest-server allows organizations to maintain complete control over their backup infrastructure while providing the same deduplication and encryption benefits as cloud-based solutions. This stack combines restic-rest-server with Prometheus monitoring and Grafana visualization to create a comprehensive backup solution with full operational visibility. The integration leverages restic-rest-server's built-in Prometheus metrics endpoint to track backup operations, repository health, and storage utilization in real-time. This monitoring-enabled backup infrastructure is ideal for organizations that need reliable backup services with detailed operational insights, providing both the security of on-premises storage and the observability required for enterprise backup management.
Key Features
- Built-in Prometheus metrics endpoint for backup operation monitoring
- Client-side AES-256 encryption with user-controlled keys
- Content-defined chunking for optimal deduplication ratios
- RESTful API supporting all Restic backup operations
- Real-time backup performance visualization through Grafana dashboards
- Repository integrity verification and corruption detection
- Multi-client support with concurrent backup operations
- Incremental backup tracking with detailed storage analytics
Common Use Cases
- 1Centralized backup server for multiple Linux servers with monitoring dashboards
- 2Docker container backup solution with operational metrics for DevOps teams
- 3Small business backup infrastructure replacing expensive commercial solutions
- 4Homelab backup system with professional-grade monitoring capabilities
- 5Development environment backup with detailed storage utilization tracking
- 6Branch office backup consolidation with central monitoring oversight
- 7Cloud exit strategy for organizations moving backup storage in-house
Prerequisites
- Minimum 1GB RAM for optimal Restic deduplication performance
- Docker and Docker Compose installed on the host system
- Available ports 3000, 8000, and 9090 for service access
- Sufficient disk space for backup repository growth and time-series data
- Basic understanding of Restic backup concepts and repository initialization
- Network connectivity from backup clients to port 8000 on the Docker host
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 restic-rest-server: 3 image: restic/rest-server:latest4 environment: 5 - OPTIONS=--prometheus --no-auth6 volumes: 7 - restic-data:/data8 ports: 9 - "8000:8000"10 networks: 11 - restic-network12 restart: unless-stopped1314 prometheus: 15 image: prom/prometheus:latest16 command: 17 - --config.file=/etc/prometheus/prometheus.yml18 - --storage.tsdb.path=/prometheus19 volumes: 20 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro21 - prometheus-data:/prometheus22 ports: 23 - "9090:9090"24 networks: 25 - restic-network26 restart: unless-stopped2728 grafana: 29 image: grafana/grafana:latest30 environment: 31 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}32 volumes: 33 - grafana-data:/var/lib/grafana34 ports: 35 - "3000:3000"36 depends_on: 37 - prometheus38 networks: 39 - restic-network40 restart: unless-stopped4142volumes: 43 restic-data: 44 prometheus-data: 45 grafana-data: 4647networks: 48 restic-network: 49 driver: bridge.env Template
.env
1# Restic REST Server2GRAFANA_PASSWORD=secure_grafana_password34# Initialize repo:5# restic -r rest:http://localhost:8000/myrepo initUsage Notes
- 1REST server at http://localhost:8000
- 2Prometheus at http://localhost:9090
- 3Grafana at http://localhost:3000
- 4Initialize repo before use
- 5AES-256 encryption
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
restic-rest-server
restic-rest-server:
image: restic/rest-server:latest
environment:
- OPTIONS=--prometheus --no-auth
volumes:
- restic-data:/data
ports:
- "8000:8000"
networks:
- restic-network
restart: unless-stopped
prometheus
prometheus:
image: prom/prometheus:latest
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- restic-network
restart: unless-stopped
grafana
grafana:
image: grafana/grafana:latest
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
depends_on:
- prometheus
networks:
- restic-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 restic-rest-server:5 image: restic/rest-server:latest6 environment:7 - OPTIONS=--prometheus --no-auth8 volumes:9 - restic-data:/data10 ports:11 - "8000:8000"12 networks:13 - restic-network14 restart: unless-stopped1516 prometheus:17 image: prom/prometheus:latest18 command:19 - --config.file=/etc/prometheus/prometheus.yml20 - --storage.tsdb.path=/prometheus21 volumes:22 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro23 - prometheus-data:/prometheus24 ports:25 - "9090:9090"26 networks:27 - restic-network28 restart: unless-stopped2930 grafana:31 image: grafana/grafana:latest32 environment:33 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}34 volumes:35 - grafana-data:/var/lib/grafana36 ports:37 - "3000:3000"38 depends_on:39 - prometheus40 networks:41 - restic-network42 restart: unless-stopped4344volumes:45 restic-data:46 prometheus-data:47 grafana-data:4849networks:50 restic-network:51 driver: bridge52EOF5354# 2. Create the .env file55cat > .env << 'EOF'56# Restic REST Server57GRAFANA_PASSWORD=secure_grafana_password5859# Initialize repo:60# restic -r rest:http://localhost:8000/myrepo init61EOF6263# 3. Start the services64docker compose up -d6566# 4. View logs67docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/restic-backup-server/run | bashTroubleshooting
- Repository does not exist error: Initialize the repository using 'restic -r rest:http://localhost:8000/repo init' before first backup
- Prometheus metrics not appearing: Verify restic-rest-server started with --prometheus flag and check port 8000/metrics endpoint
- Grafana shows no data: Confirm prometheus.yml includes restic-rest-server target at restic-rest-server:8000
- High memory usage during backup: Adjust Restic's --limit-download and --limit-upload flags to reduce concurrent operations
- Permission denied on volumes: Check Docker volume permissions and ensure containers can write to mounted directories
- Connection refused from Restic client: Verify restic-rest-server is accessible on port 8000 and network connectivity is established
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
restic-rest-serverprometheusgrafana
Tags
#restic#backup#encryption#deduplication#rest-server
Category
Storage & BackupAd Space
Shortcuts: C CopyF FavoriteD Download