github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/docs/content/install.md (about) 1 --- 2 title: "Install" 3 description: "Rclone Installation" 4 date: "2018-08-28" 5 --- 6 7 # Install # 8 9 Rclone is a Go program and comes as a single binary file. 10 11 ## Quickstart ## 12 13 * [Download](/downloads/) the relevant binary. 14 * Extract the `rclone` or `rclone.exe` binary from the archive 15 * Run `rclone config` to setup. See [rclone config docs](/docs/) for more details. 16 17 See below for some expanded Linux / macOS instructions. 18 19 See the [Usage section](/docs/) of the docs for how to use rclone, or 20 run `rclone -h`. 21 22 ## Script installation ## 23 24 To install rclone on Linux/macOS/BSD systems, run: 25 26 curl https://rclone.org/install.sh | sudo bash 27 28 For beta installation, run: 29 30 curl https://rclone.org/install.sh | sudo bash -s beta 31 32 Note that this script checks the version of rclone installed first and 33 won't re-download if not needed. 34 35 ## Linux installation from precompiled binary ## 36 37 Fetch and unpack 38 39 curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip 40 unzip rclone-current-linux-amd64.zip 41 cd rclone-*-linux-amd64 42 43 Copy binary file 44 45 sudo cp rclone /usr/bin/ 46 sudo chown root:root /usr/bin/rclone 47 sudo chmod 755 /usr/bin/rclone 48 49 Install manpage 50 51 sudo mkdir -p /usr/local/share/man/man1 52 sudo cp rclone.1 /usr/local/share/man/man1/ 53 sudo mandb 54 55 Run `rclone config` to setup. See [rclone config docs](/docs/) for more details. 56 57 rclone config 58 59 ## macOS installation with brew ## 60 61 brew install rclone 62 63 ## macOS installation from precompiled binary, using curl ## 64 65 To avoid problems with macOS gatekeeper enforcing the binary to be signed and 66 notarized it is enough to download with `curl`. 67 68 Download the latest version of rclone. 69 70 cd && curl -O https://downloads.rclone.org/rclone-current-osx-amd64.zip 71 72 Unzip the download and cd to the extracted folder. 73 74 unzip -a rclone-current-osx-amd64.zip && cd rclone-*-osx-amd64 75 76 Move rclone to your $PATH. You will be prompted for your password. 77 78 sudo mkdir -p /usr/local/bin 79 sudo mv rclone /usr/local/bin/ 80 81 (the `mkdir` command is safe to run, even if the directory already exists). 82 83 Remove the leftover files. 84 85 cd .. && rm -rf rclone-*-osx-amd64 rclone-current-osx-amd64.zip 86 87 Run `rclone config` to setup. See [rclone config docs](/docs/) for more details. 88 89 rclone config 90 91 ## macOS installation from precompiled binary, using a web browser ## 92 93 When downloading a binary with a web browser, the browser will set the macOS 94 gatekeeper quarantine attribute. Starting from Catalina, when attempting to run 95 `rclone`, a pop-up will appear saying: 96 97 “rclone” cannot be opened because the developer cannot be verified. 98 macOS cannot verify that this app is free from malware. 99 100 The simplest fix is to run 101 102 xattr -d com.apple.quarantine rclone 103 104 ## Install with docker ## 105 106 The rclone maintains a [docker image for rclone](https://hub.docker.com/r/rclone/rclone). 107 These images are autobuilt by docker hub from the rclone source based 108 on a minimal Alpine linux image. 109 110 The `:latest` tag will always point to the latest stable release. You 111 can use the `:beta` tag to get the latest build from master. You can 112 also use version tags, eg `:1.49.1`, `:1.49` or `:1`. 113 114 ``` 115 $ docker pull rclone/rclone:latest 116 latest: Pulling from rclone/rclone 117 Digest: sha256:0e0ced72671989bb837fea8e88578b3fc48371aa45d209663683e24cfdaa0e11 118 ... 119 $ docker run --rm rclone/rclone:latest version 120 rclone v1.49.1 121 - os/arch: linux/amd64 122 - go version: go1.12.9 123 ``` 124 125 There are a few command line options to consider when starting an rclone Docker container 126 from the rclone image. 127 128 - You need to mount the host rclone config dir at `/config/rclone` into the Docker 129 container. Due to the fact that rclone updates tokens inside its config file, and that 130 the update process involves a file rename, you need to mount the whole host rclone 131 config dir, not just the single host rclone config file. 132 133 - You need to mount a host data dir at `/data` into the Docker container. 134 135 - By default, the rclone binary inside a Docker container runs with UID=0 (root). 136 As a result, all files created in a run will have UID=0. If your config and data files 137 reside on the host with a non-root UID:GID, you need to pass these on the container 138 start command line. 139 140 - It is possible to use `rclone mount` inside a userspace Docker container, and expose 141 the resulting fuse mount to the host. The exact `docker run` options to do that might 142 vary slightly between hosts. See, e.g. the discussion in this 143 [thread](https://github.com/moby/moby/issues/9448). 144 145 You also need to mount the host `/etc/passwd` and `/etc/group` for fuse to work inside 146 the container. 147 148 Here are some commands tested on an Ubuntu 18.04.3 host: 149 150 ``` 151 # config on host at ~/.config/rclone/rclone.conf 152 # data on host at ~/data 153 154 # make sure the config is ok by listing the remotes 155 docker run --rm \ 156 --volume ~/.config/rclone:/config/rclone \ 157 --volume ~/data:/data:shared \ 158 --user $(id -u):$(id -g) \ 159 rclone/rclone \ 160 listremotes 161 162 # perform mount inside Docker container, expose result to host 163 mkdir -p ~/data/mount 164 docker run --rm \ 165 --volume ~/.config/rclone:/config/rclone \ 166 --volume ~/data:/data:shared \ 167 --user $(id -u):$(id -g) \ 168 --volume /etc/passwd:/etc/passwd:ro --volume /etc/group:/etc/group:ro \ 169 --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \ 170 rclone/rclone \ 171 mount dropbox:Photos /data/mount & 172 ls ~/data/mount 173 kill %1 174 ``` 175 176 ## Install from source ## 177 178 Make sure you have at least [Go](https://golang.org/) 1.7 179 installed. [Download go](https://golang.org/dl/) if necessary. The 180 latest release is recommended. Then 181 182 git clone https://github.com/rclone/rclone.git 183 cd rclone 184 go build 185 ./rclone version 186 187 You can also build and install rclone in the 188 [GOPATH](https://github.com/golang/go/wiki/GOPATH) (which defaults to 189 `~/go`) with: 190 191 go get -u -v github.com/rclone/rclone 192 193 and this will build the binary in `$GOPATH/bin` (`~/go/bin/rclone` by 194 default) after downloading the source to 195 `$GOPATH/src/github.com/rclone/rclone` (`~/go/src/github.com/rclone/rclone` 196 by default). 197 198 ## Installation with Ansible ## 199 200 This can be done with [Stefan Weichinger's ansible 201 role](https://github.com/stefangweichinger/ansible-rclone). 202 203 Instructions 204 205 1. `git clone https://github.com/stefangweichinger/ansible-rclone.git` into your local roles-directory 206 2. add the role to the hosts you want rclone installed to: 207 208 ``` 209 - hosts: rclone-hosts 210 roles: 211 - rclone 212 ```