Combining restic with rclone allows you to set up a service on a backup server using rclone that serves a restic REST API that restic can connect to from the machine(s) that you want to back up. Using the REST API is usually much faster than using restic over SFTP.
This is well documented by rclone serve restic --help, including how to use SSL and how to do htpasswd authentication. You should read that documentation carefully. If your backup server is public-facing (it shouldn't be), or if you do this for some non-personal setup, you will need to secure it with some way of authenticating individual users.
The minimum you need to set it up to be usable from outside of localhost on a local network is the following on the host that serves as the backup server:
rclone serve restic --addr :8080 /var/backup/restic
Here, /var/backup/restic is the path under which you want to store your restic repositories (the user that runs the above command needs to have write permissions there, so you might want to create a dedicated service user for that). The --addr :8080 means "bind to port 8080 on all available interfaces" (by default, rclone binds only to localhost:8080).
You may then connect to this with the following (this initializes a restic repository and creates the first snapshot of my home directory):
restic -r rest:http://backupsrv:8080/testrepo init restic -r rest:http://backupsrv:8080/testrepo backup "$HOME"
This assumes that you want to create and use a restic repository called testrepo and that your backup server is accessible as backupsrv. You should replace that hostname with the correct name or IP number.
This will prompt you interactively for the repository password, but you can obviously pass that in the RESTIC_PASSWORD environment variable as usual (just like you can pass the restic repository in RESTIC_REPOSITORY instead of using -r ...).
On my personal Synology NAS, I run the following Docker container (this is a docker-compose.yml file):
version: '3' services: rclone: image: rclone/rclone:latest container_name: rclone hostname: diskstation.local ports: - 18080:8080 restart: unless-stopped command: ["serve","restic","/backup"] environment: - RCLONE_ADDR=0.0.0.0:8080 - RCLONE_STATS=1h - RCLONE_VERBOSE=1 volumes: - /volume1/Restic/backup:/backup
This serves the restic REST API on port 18080 on the NAS and lets me store my backups in /volume1/Restic/backup (by means of a bind mount into the container). Note that the security in the rclone setup is minimal as this is a personal NAS in a walled-off LAN (behind both a firewall and a carrier-grade NAT).