Copy files and folders to homeassistant – the easy way

No support for folder copy

The build in file editor does not enable folder upload, and only one file at a time. This makes copying a folder with multiple files and subfolders pretty cumbersome. I searched for a smarter method of doing it, but didn’t really find anything good, what to do?

Back to good old SSH

One of the add-ons available is “Terminal & SSH”, it gives the option to enable SSH, and by doing that we can use SSHFS (SFTP) to copy files and folders to our homeassistant.

Installation and configuration

Go to add-ons in the settings menu. Search for “terminal & ssh” and install it.
When installed got to the configuration tab, add a pulic ssh key to the authorized keys option (prefered) or add a password. Save and restart terminal & SSH.

Verify

You are now able to login with username root, and the key/password you have configured in the previous step. When you have verified this is working, you are ready to connect with sshfs or sftp.

Mount

On linux sshfs is very easy to use, install with apt/yum/dnf or whatever you use, create a directory and do:

sshfs homeassistant:/ -i .ssh/id_file.pub -l root

You now have the filesystem from you homeassistant on the folder you created

On Windows I think sshfs is part of the base system since Windows 11. if not, you can use WinSCP