New user trying to get restic and sftp setup

Hi all I just found Restic and i am excited to get it working. I am new to this and kinda new to Linux in general. I have a remote VPS running centos 7 and my local laptop has Fedora on it. I am wanting to backup my stuff to the centos 7 VM. Can somebody please show me how this can be done.

I know I need to setup sftp on the centos vm but I don’t know what all that means.

Any help would be greatly appreciated!

1 Like

Do you have SSH access to the centos VM? If so you have SFTP too. If not you should look up how to set that up - it’s not really related to restic & there’s guides out there.

If you normally ssh to the VM as foo@bar you should be able to init a repo (located in /tmp/backup - you will no doubt want to change this) like so:

restic -r sftp:foo@bar:/tmp/backup init

And then perform a backup with:

restic -r sftp:foo@bar:/tmp/backup backup ~/Pictures

This is covered in the docs here with much more information than I can provide.


oh my gosh!! That was so simple lol. It’s working. I thought i had to setup ssh to use keys and use chroot for sftp and everything. lol This is so easy! Thank you so much. :slight_smile:


Yeah, is really easy but you should setup ssh keys because it is not convenient at all to put the password every time you want to make something with restic via sftp. It may seems complicated at first but it is really easy. Read about it here


Also SSH keys are more secure and it’s a good thing to learn about for anyone getting into (or just wanting to learn more about) Linux. Definitely a good recommendation.


Thanks guys I will get that setup! Thanks for the help. :slight_smile: