github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/install.md (about)

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