添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have a headless computer under the stairs in my house which I use to run services like RTorrent and Sonarr in Docker containers. It means that I can connect to them on my laptop or phone and then just leave them to run. I wanted to do the same for RClone, e.g. start a copy from Dropbox to Google Drive, close my laptop then go to work.

I thought I'd share what I did to get it working, although I'm not an expert and this can probably be improved. Feel free to add comments.

Firstly, add the official RClone Docker container to the computer that you want it to run on. Here's the offical documentation . I use Docker Compose (plus Portainer) to download and configure my containers and the YML file looks like this.

  rclone_rclone:
    image: rclone/rclone
    container_name: rclone_rclone
    restart: always
    command: rcd --rc-web-gui --rc-addr :5572 --rc-user jsmith --rc-pass mypassword
    ports:
      - "5572:5572"
    volumes:
      - /home/jsmith/docker/rclone_rclone:/config/rclone
      - /home/jsmith/docker/rclone_rclone:/logs
    environment:
      - PHP_TZ=Europe/London
      - PUID=1000
      - PGID=1000

Important things are the command, which runs the RClone GUI on a tiny web server built into rclone on port 5572 with a username and password, plus makes it available to other computers on the network. The volumes section puts the config and logs into a directory outside your container, which means that if you delete the container then you hang onto the config. PUID and PGID have to be correct according to your computer, more details here.

Run this container and RClone GUI should be working on http://[IP Address]:5572. It should look something like this

Screenshot 2020-02-13 at 10.35.491516×804 31.8 KB

The WebUI is now working but it's not functional because it doesn't have any remote drives configured in the config file. There may be a way of achieving that in the WebGUI but I couldn't figure that out so I did it by creating a config file on another computer by downloading a non-docker version of RClone and using the config command. In my case that was a Dropbox and two Google Drives. The resulting config file can be found using the config file command.

Having located the config file, the last step is to copy the contents of this config file to the config file which your container version uses, which can be found wherever you set the config file in the volumes section of the YML file. In my case that was /home/jsmith/docker/rclone_rclone.

As mentioned at the start, this is in no way a complete guide but it will get things up and running and might be useful for some people. Other things I'd like to do are:

  • Make it accessible to computers outside my LAN. For some reason that doesn't work.
  • Figure out how to create remote drives within the GUI.
  • Figure out how to add a local drive so that I can copy local (or network) files to my remotes.
  • Update the official docs here.
  • Hope that helps someone.

    DavidA:

    Figure out how to add a local drive so that I can copy local (or network) files to my remotes.

    You can just put in a path in the explorer I think.

    DavidA:

    Figure out how to add a local drive so that I can copy local (or network) files to my remotes.

    Mount the local drive under the volumes section, similar to your other mounted volumes.
    volumes:
    - mnt/driveMountOnLocalComputer:/LocationInDockerYouWantTo/PlaceTheDriveOrFolder

    hello. and thank you for this great post!

    i have installed rclone on my synology nas and mounted my google drive and an another mouth crpyted for my plex

    i want to move it on docker after seen your post but

    theres something i dont understand that whats benefits with rclone WebGUI ?

    and my config file (the one using now on nas) would be efficient for rclone on docker ?

    I like using a docker container instead of just installing it on the operating system because it's more robust. In the past, I've got something working, changed something in the operating system and it breaks but a docker container protects it. Plus docker containers can be reset, which makes it easy to rectify mistakes. That's not unique to rclone though, it's why people use Docker in general.

    I like using WebGUI simply because I prefer the interface to the shell.

    Hope that helps.

    Hey DavidA, you gave us a great tutorial and I want to thank you. I tried a lot with installing RClone Docker container w/GUI in an OMV5-portainer Raspberry Pi 4. It was a hell of a journey, nothing worked as it should.
    The image: rclone/rclone doesn't work as you have to install rclone/rclone:beta version for the ARMHF to work. You also have to bind the correct volumes.
    But after a lot of tinkering, I managed to got the GUI working as you mentioned. But I have no way to generate the config file (I want to connect to dropbox). When I use console in portainer from the container, I tried rclone config. I got to the part where it gave me the following link http://127.0.0.1:53682/auth?state=RhlonLNMffi0ePTMe5ZTZQ to authorize. It doesn't work the link. I tried different IPs, I open this port in portainer, it just doesn't work. Do you have any idea how to generate the config file (without using another computer). I really hope you can manage to make the GUI work. It would be groundbraking.
    Again I thank you for the tutorial. At least, I managed with your help to put rclone w/GUI in a container inside a OMV5 in a raspberrypi. That is something.

    Hey all,

    Thanks for the guide @DavidA

    I have this running in Docker and it's uploading using my config without problem. I also have the GUI running and I can access it successfully, however, the GUI doesn't update.

    Is there something obvious that I am missing that is preventing the dashboard from updating with the current upload? Perhaps a permission error? Any help would be greatly appreciated.

    I've got it working.
    here are the steps:
    my docker-compose file is stored at /home/pi/services/rclone alongside 3 other dirs (logs, data and config). Here it follows:

    version: '3.2'

    services:
    rclone:
    image: rclone/rclone
    restart: always
    cap_add:
    - SYS_ADMIN
    - SETPCAP
    command: rcd --rc-web-gui --rc-addr :5572 --rc-user pi --rc-pass 'PASSWORD'
    ports:
    - 5572:5572
    volumes:
    - /home/pi/services/rclone/data:/data
    - /home/pi/services/rclone/config:/config/rclone
    - /home/pi/services/rclone/logs:/logs
    - /etc/passwd:/etc/passwd:ro
    - /etc/group:/etc/group:ro
    - /dev/fuse:/dev/fuse
    environment:
    - PHP_TZ=Europe/London
    - PUID=1000
    - PGID=1000
    deploy:
    mode: global
    placement:
    constraints: [node.platform.os == linux]

    deploy with:
    ssh into the remote machine that will run rclone
    $ docker stack deploy --compose-file=docker-compose.yaml rclone

    Web gui should be working. But we dont need it right now. Configuration is done via console within portainer. If you dont have portainer you can attach to the running container with docker exec -it CONTAINERID sh and perform the same steps.

    Open portainer, click on "containers" then find and click on the "exec console" icon for the rclone container run:
    $ rclone config
    fill in the information as usual (client id and secret if you have)
    at the end the wizard will ask to auto configure it. THIS IS IMPORTANT!!
    say NO
    then it will show you an url to authenticate (that is not 127.0.0.1)
    Open it in your local machine. Authenticate with Google drive.
    finally the rclone file is created.

    then, go back to portainer dashboard, find the rclone stack (inside services) and click on the button UPDATE THE SERVICE. THIS IS IMPORTANT. the rclone webgui service must restart to be able to load the new config.
    Wait the rclone container to reload.
    You can open the web gui for rclone and check your files.

    Thanks for the reply, I do follow your docker compose which able to setup rclone docker with web gui. There are several problems I am facing with rclone, wonder if you could help.

    I was able to perform a mount action at the web gui, but the gui just show a success message at the top right corner, and did not list out the mount folder at the gui.

    Although the gui does not list out the mount folder, the folder still could successfully mount and able to read the content outside of the docker with "sudo ls ". But the strange things is while I try to expose the volume to my EMBY docker, EMBY does not show the path contain rclone mounted folder. I wonder this might be a permission related issues.

    The last thing is every time I try to restart the rclone docker, it also failed with a error mentioning the path for rclone data does exist a file, I need to manually run a "sudo umount" every time I stop the docker.

    I hope there is a way to automatically mount the folder while with the web gui enable at the docker starts.

    I'm still fixing a thing or two.
    Currently I can mount within the gui. I had to fix the docker compose though.. (follows below) and to start it, i did with docker-compose instead of docker stack deploy because otherwise fuse wont work.
    I can definitely see the content of my remote drive within the container (I attached into the container with docker exec) but the content is not available outside it. I still have to figure out why.

    version: '3.2'

    services:
    rclone:
    image: rclone/rclone
    restart: always
    cap_add:
    - SYS_ADMIN
    - SETPCAP
    - MKNOD
    devices:
    - /dev/fuse:/dev/fuse
    command: rcd --rc-web-gui --rc-addr :5572 --rc-user pi --rc-pass 'XXXXXXXX'
    ports:
    - 5572:5572
    volumes:
    - /home/pi/services/rclone/data:/data
    - /home/pi/services/rclone/config:/config/rclone
    - /home/pi/services/rclone/logs:/logs
    - /etc/passwd:/etc/passwd:ro
    - /etc/group:/etc/group:ro
    environment:
    - PHP_TZ=Europe/London
    - PUID=1000
    - PGID=1000
    deploy:
    mode: global
    placement:
    constraints: [node.platform.os == linux]

    It was a hell of a journey but i finally managed to expose the rclone mount point to the host and therefore other containers.
    I had to change the docker-compose file.
    Later I will post a clean version of it.

    Ok, there was some improvement to be done. Specially with regard to mounting.
    I was trying to find a clean way to do it. As the mounts done from the web interface are not persistent.
    worse, the web interface doesnt even see the mounts that were made without it.
    Thus in combined it with another service and a simple configuration file.
    The tutorial will be up soon.

    Good news.
    I've finally have time to test everything and it works like a charm.
    I manage to get a Raspberry pi 3 with rclone (with rclone mount), plex (playing directly from rclone mount) + with a reverse proxy (traefik) + ssl (letsencrypt) + radarr, +sonarr + bazarr + jackett + transmission + portainer + web interface (to manage the status) all working with an optional vpn.
    Now I have to write up and comment on the docker-compose file the instructions to make it work smoothly.

    Add to tag this post
    Be good to know if you can get this to work

    Got it working once for a moment but just can't get it to work with fuse.

      rclone:
        image: rclone/rclone
        container_name: rclone
        restart: always
        volumes:
          - /home/plex/.config/rclone:/config/rclone
          - /home/plex/.config/rclone/cache:/home/plex/.cache/rclone/webgui
          - /home/plex/data:/data:shared
          - /etc/passwd:/etc/passwd:ro
          - /etc/group:/etc/group:ro
        cap_add:
          - SYS_ADMIN
          - SETPCAP
          - MKNOD
        devices:
          - /dev/fuse:/dev/fuse
        command: "mount media: /data/media --buffer-size 256M --dir-cache-time 1000h --log-level DEBUG --poll-interval 15s --timeout 1h --rc --rc-web-gui --rc-addr :5572 --rc-user=plex --rc-pass=plexmedia --log-file /config/rclone/logs/rcloneUnion04072020d.log"
        ports:
          - 5572:5572
        security_opt:
          - seccomp:unconfined
        environment:
          - PHP_TZ=Europe/London
          - PUID=1001
          - PGID=1001