Thought I’d share my journey with setting up a Kopia docker image on my Scale 24.04 box to replicate to Storj. Maybe it will be useful to someone else. Maybe someone will tell me that I’m a dummy and should do this differently- suggestions for improvement welcome. I didn’t want to use a Cloud Sync task since I wanted versions, incrementals, and compression. I like Kopia for other stuff, so I figured I’d use it. Maybe the new nifty things in 24.10 like the TrueCloud backup tasks are better than this… I’ll get there one day.
What I did at a high level:
- Create new storj account using this URL so I’d get a killer deal for a year: Storj. Make a bucket and get S3 keys.
- Create a new container in Apps for kopia
- Point Kopia at storj via S3
- Configure Kopia to take snapshots of certain pools
More details on #2:
- Go to Apps
- Click Discover Apps in the top right
- Click Custom App in the top right
- Application name: Kopia
- Image repository: kopia/kopia
- Container cmd: /bin/kopia
- Create a bunch of container args:
Note- the server username and password specified here will be used to log into the Kopia web ui at port 51515
Note- I probably should put the pw in an environment var instead of as an argument so the pw doesn’t show up in logs. I’ll tweak that eventually. - Create an environment variable:
Note: the value of the KOPIA_PASSWORD will be entered in the Kopia UI in a later step. This is your repository password. - Set up port forwarding:
- SSH in or use some other tool to make directories somewhere to store your Kopia config, cache, and logs. I did this in a subdirectory of my home directory, but you can do whatever you want.
- Mount your storage for config, cache, logs, and the dataset(s) you want to back up in your docker container:
Note: I made my dataset that I am backing up read only because I was feeling paranoid. If I ever wanted to restore something, I’d have to make it writable obviously. - Set up Portal configuration:
Then, start the app. Kopia should now be available at https://YourTruenasServer:51515. Login with the username and pw configured in your args agove. When the initial setup wizard asks for the repo password (twice for some reason), enter in the value from the KOPIA_PASSWORD environment variable.
Your repo will be an S3 compatible storage endpoint, copy the values for your bucket and API keys from Storj.
Then, follow Kopia’s standard practices to set up policies to snapshot, encrypt, compress, retain, etc. however you want.
Done!