docker.recipes

Restic REST Server

intermediate

Restic REST server for backup repository hosting.

Overview

Restic REST Server is a lightweight HTTP server that provides a REST API backend for the Restic backup program. Restic itself is a modern, fast, and secure backup tool that offers client-side encryption, deduplication, and support for multiple storage backends. The REST server component allows you to create a centralized backup repository that Restic clients can connect to over HTTP/HTTPS, making it ideal for network-based backup scenarios where you want to consolidate backups from multiple machines to a single location. This deployment runs a single rest-server container that exposes the Restic REST API on port 8000. The server is configured with Prometheus metrics enabled and authentication disabled by default, making it suitable for development and testing environments. The backup data is stored in a dedicated Docker volume that persists across container restarts, ensuring your backup repositories remain intact even when updating or restarting the server. This setup is perfect for homelab administrators, small businesses, and development teams who need a simple, centralized backup solution without the complexity of cloud storage integration. The REST server approach provides a middle ground between local-only backups and cloud-based solutions, offering network accessibility while maintaining full control over your backup infrastructure and storage location.

Key Features

  • HTTP REST API for Restic backup clients with standardized endpoints
  • Built-in deduplication support for efficient storage utilization
  • Client-side encryption ensuring backup data remains secure in transit and at rest
  • Prometheus metrics endpoint for monitoring backup operations and server health
  • Configurable authentication and access control for production deployments
  • Append-only mode support to protect against ransomware and accidental deletion
  • Cross-platform compatibility with Restic clients on Windows, macOS, and Linux
  • Lightweight design with minimal resource requirements and fast startup times

Common Use Cases

  • 1Centralized backup repository for multiple development workstations and servers
  • 2Homelab backup solution replacing external cloud storage dependencies
  • 3Small business backup infrastructure with local network storage control
  • 4CI/CD pipeline integration for automated build artifact and database backups
  • 5Remote office backup consolidation before syncing to primary data center
  • 6Development environment backup testing before deploying to production storage
  • 7Backup staging area for data verification before long-term archival storage

Prerequisites

  • Docker and Docker Compose installed with minimum 1GB available RAM
  • Port 8000 available on the host system for REST API access
  • Basic understanding of Restic backup client configuration and repository concepts
  • Network connectivity between Restic clients and the REST server host
  • Sufficient disk space for backup data storage based on retention requirements
  • Knowledge of backup authentication and security practices for production use

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 rest-server:
3 image: restic/rest-server:latest
4 container_name: restic-rest-server
5 restart: unless-stopped
6 ports:
7 - "${REST_PORT:-8000}:8000"
8 environment:
9 - OPTIONS=--prometheus --no-auth
10 volumes:
11 - restic_data:/data
12 networks:
13 - restic-network
14
15volumes:
16 restic_data:
17
18networks:
19 restic-network:
20 driver: bridge

.env Template

.env
1# Restic REST Server
2REST_PORT=8000

Usage Notes

  1. 1REST server at http://localhost:8000
  2. 2Use with restic client
  3. 3Enable auth for production
  4. 4Prometheus metrics available

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 rest-server:
5 image: restic/rest-server:latest
6 container_name: restic-rest-server
7 restart: unless-stopped
8 ports:
9 - "${REST_PORT:-8000}:8000"
10 environment:
11 - OPTIONS=--prometheus --no-auth
12 volumes:
13 - restic_data:/data
14 networks:
15 - restic-network
16
17volumes:
18 restic_data:
19
20networks:
21 restic-network:
22 driver: bridge
23EOF
24
25# 2. Create the .env file
26cat > .env << 'EOF'
27# Restic REST Server
28REST_PORT=8000
29EOF
30
31# 3. Start the services
32docker compose up -d
33
34# 4. View logs
35docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/restic-rest-server/run | bash

Troubleshooting

  • Connection refused on port 8000: Verify REST_PORT environment variable matches your firewall rules and client configuration
  • Permission denied accessing /data directory: Check Docker volume permissions and ensure the container has write access to the mount point
  • Repository not found errors from Restic clients: Initialize the repository first using 'restic init' command pointing to the REST server URL
  • High memory usage during backup operations: Increase available RAM or adjust Restic client concurrency settings to reduce parallel operations
  • Prometheus metrics not accessible: Verify OPTIONS environment variable includes --prometheus flag and metrics endpoint is available at /metrics
  • Authentication errors in production: Remove --no-auth from OPTIONS and configure proper HTTP authentication or reverse proxy with SSL termination

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

Ad Space