Prerequisites
- working Truenas Server
- remote Server:
- running docker
- and docker compose
- having enough storage for the backup
Setup Remote Server
Basic Setup
create a docker-compose.yml
file with the following content
services:
tailscale:
image: tailscale/tailscale:latest
environment:
- TS_AUTHKEY=<your tailscale auth key>
- TS_STATE_DIR=/var/lib/tailscale
volumes:
- /path/for/tailscale/config:/var/lib/tailscale
cap_add:
- net_admin
- sys_module
restart: unless-stopped
webdav:
image: dgraziotin/nginx-webdav-nononsense:latest
environment:
- WEBDAV_USERNAME=username
- WEBDAV_PASSWORD=supersecretpassword
# - CLIENT_MAX_BODY_SIZE=5G # must end with M(egabytes) or G(igabytes)
# - TIMEOUTS_S=1200 # seconds
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
# see https://hub.docker.com/r/dgraziotin/nginx-webdav-nononsense
volumes:
- /path/for/files:/data
network_mode: service:tailscale
depends_on:
- tailscale
restart: unless-stopped
Get a tailscale auth key and replace <your tailscale auth key>
in the docker compose.
Also replace the paths
/path/for/tailscale/config
with the path for the tailscale config/path/for/files
with the folder for the Files
On my setup I’m currently using a SMB mount on the remote for file storage
.htpasswd for Auth
soon…
Add SSL Certs (optional)
soon…
Setup Truenas Server
Setup Tailscale
- Get another tailscale auth key for your Truenas server
- Add Tailscale as a Truenas App
- make sure
Network Configuration
⇒Host Network
is checked
- make sure
- Test the Tailscale setup
- go to
System
⇒Shell
- enter
ip addr
- you should see an interface with the name
tailscale0
- you should see an interface with the name
- try to ping your remote server trough Tailscale
- get your Tailscale IP of the remote client on the Tailscale Website
ping <yourIP>
- go to
Setup a Backup Job
- Go to
Data Protection
- Add a `Cloud Sync Task
- Add new Credentials
- Provider:
WebDAV
- URL:
http://<ip>
(orhttps://example.com
with SSL) - WebDAV Service: `OTHER“
- Username: as set on the remote`
- Password: as set on the remote
- Provider:
- What and When
- Direction:
PUSH
(pushing the files to the remote) - Transfer Mode: usually
SYNC
(see Help: Transfer Mode) - Directory/Files: local folder to sync
- Folder: folder on the remote (must exist on the remote)
- Direction:
- Save
- Add new Credentials
- Enable Remote encryption (optional)
- Find the Sync Task and click the edit icon
- Under
Advanced Options
enableRemote Encryption
- Set a LONG and SECURE
Encryption Password
andEncryption Salt
- Always securely back up this password / salt! Losing the encryption password will result in data loss.
- Save
Sources: