[HOWTO] Rclone via docker

  • Hey everyone

    Since my Duplicati plugin stopped working and the docker version also had problems uploading to a cloud sftp, i made the switch to Rclone.
    Now Rclone is a powerfull application but has a weird setup you have to go through.


    In this thread I will try to explain how to get through the installation and setup phase.

    Step 1: docker install.
    enough guides on this forum

    Step 2: installation
    use the following docker image: https://hub.docker.com/r/romancin/rclonebrowser
    In the setup you will need to expose port 5800 for the browser plugin or 5900 for the vnc plugin.

    In volumes expose your share to /media and for the config you set it to /config


    Step 3: setup remote
    Now we come to the difficult and weird part of the setup.

    First you need to setup a new remote, by pressing config in the remotes tab.

    You will get a terminal window that goes through the setup of rclone.

    Press "n" for new remote

    Give the remote a name, i have chosen sftpcloud

    A the storage phase you can setup various cloud providers in my case it was SFTP, so I choose number 29. (with extra dip ;))
    give it the hostname of the cloud

    typed in the username

    typed in the password (by typing i mean typing not copying, that doesn't work)

    port was default 22, so pressed enter
    all the other options I left on default, so enter away.


    The config is now finished and you can new open the remote by clicking in the remote tap.


    Step 3.1: encrypt remote (optional)

    I wanted my files to be encrypted when they are send to the cloud provider.

    The way this works on rclone is super weird, basically you create a new remote with crypt on an existing remote.


    Before you start create a folder on the cloud provider where rclone can put all encrypted folders and files.
    In this example we will use the folder "rclone"

    Go to config

    create new remote so press "n"

    give it a name, like sftpcloud-crypt or something

    In the storage phase type "crypt"

    On the remote you will need the name of the remote created in step 3 with the folder you have created, so remotename:folder

    so in my case it was "sftpcloud:rclone" (sftpcloud is the name of the remote created in step 3, rclone is the folder we created in the beginning of step 3.1)

    The next steps are not that difficult, like do you want to encrypt files or only obfuscate the file names or do you want to encrypt the folder names as well.
    Generate or type in a password. (tip: with password generation you can copy the password, using the clipboard button in the right corner)

    Now you will have 2 remotes: one for non encrypted, the other for encrypted.

    In step 4 you want to use the encrypted remote (the icon is a padlock).


    Step 4: sending files

    In the remote tab, click on one of your remotes and it will open a tab for that remote.
    Now press on the upload button.

    You will see a new popup be opened to setup a upload task.

    Select your source, in the file browser go to the media folder where the host volume is mounted.
    select the folder that you want to upload.

    leave the destination part, it will create a folder with same name as the source folder.

    Choose COPY, SYNC or MOVE. I choose copy because i wanted a backup.

    In the task description you will need to give the task a name like backup-foldername or something.
    Press save

    Go to the task tab and you will see your newly created job.
    Press run to start uploading.
    In the jobs tab you will see your running job.


    If you choose encryption in step 3.1 your files will be send encrypted to the remote.


    Step 5: scheduling

    There is no scheduling support in the browser or the docker image, but I have found a workaround.

    When you ran a job in the task tab there is a button to copy the rclone command.
    press the button and then click on the clipboard button in the right corner.

    you can now copy the rclone command.

    ssh into your openmediavault host server.

    create a new script into your home folder, for example /home/rclone.sh

    In this script you put the rclone command you copied from the browser.

    setup a new cronjob with the following command: docker exec -i containername sh < /home/rclone.sh


    Now it should start the rclone jobs on a schedule without manual interventions.
    The downside is that these scheduled jobs don't appear in the task tab.



    Well i hope this guide was helpful, if you have questions or don't understand stuff let me know.

    I will try to answer them, but beware i am a beginner into rclone so don't know all the details.
    I only used it in combination with sftp and haven't set anything up with gdrive, onedrive, ...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!