"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
docs: improve guide for installing from source - fixes #5809
albertony47b1a0d6fad3
diff --git a/docs/content/install.md b/docs/content/install.mdindex 14a7c8f68..07d343d38 100644--- a/docs/content/install.md+++ b/docs/content/install.md@@ -3,11 +3,11 @@ title: "Install"description: "Rclone Installation"----# Install #+# InstallRclone is a Go program and comes as a single binary file.-## Quickstart ##+## Quickstart* [Download](/downloads/) the relevant binary.* Extract the `rclone` executable, `rclone.exe` on Windows, from the archive.@@ -22,7 +22,7 @@ run `rclone -h`.Already installed rclone can be easily updated to the latest versionusing the [rclone selfupdate](/commands/rclone_selfupdate/) command.-## Script installation ##+## Script installationTo install rclone on Linux/macOS/BSD systems, run:@@ -35,7 +35,7 @@ For beta installation, run:Note that this script checks the version of rclone installed first andwon't re-download if not needed.-## Linux installation from precompiled binary ##+## Linux installation from precompiled binaryFetch and unpack@@ -59,7 +59,7 @@ Run `rclone config` to setup. See [rclone config docs](/docs/) for more details.rclone config-## macOS installation with brew ##+## macOS installation with brewbrew install rclone@@ -68,7 +68,7 @@ NOTE: This version of rclone will not support `mount` any more (seeon macOS, either install a precompiled binary or enable the relevant optionwhen [installing from source](#install-from-source).-## macOS installation from precompiled binary, using curl ##+## macOS installation from precompiled binary, using curlTo avoid problems with macOS gatekeeper enforcing the binary to be signed andnotarized it is enough to download with `curl`.@@ -96,7 +96,7 @@ Run `rclone config` to setup. See [rclone config docs](/docs/) for more details.rclone config-## macOS installation from precompiled binary, using a web browser ##+## macOS installation from precompiled binary, using a web browserWhen downloading a binary with a web browser, the browser will set the macOSgatekeeper quarantine attribute. Starting from Catalina, when attempting to run@@ -109,7 +109,7 @@ The simplest fix is to runxattr -d com.apple.quarantine rclone-## Install with docker ##+## Install with dockerThe rclone maintains a [docker image for rclone](https://hub.docker.com/r/rclone/rclone).These images are autobuilt by docker hub from the rclone source based@@ -188,39 +188,93 @@ ls ~/data/mountkill %1```-## Install from source ##+## Install from source-Make sure you have at least [Go](https://golang.org/) go1.16-installed. [Download go](https://golang.org/dl/) if necessary. The-latest release is recommended. Then+Make sure you have git and [Go](https://golang.org/) installed.+Go version 1.16 or newer is required, latest release is recommended.+You can get it from your package manager, or download it from+[golang.org/dl](https://golang.org/dl/). Then you can run the following:-```sh+```git clone https://github.com/rclone/rclone.gitcd rclonego build-# If on macOS and mount is wanted, instead run: make GOTAGS=cmount-./rclone version```-This will leave you a checked out version of rclone you can modify and-send pull requests with. If you use `make` instead of `go build` then-the rclone build will have the correct version information in it.+This will check out the rclone source in subfolder rclone, which you can later+modify and send pull requests with. Then it will build the rclone executable+in the same folder. As an initial check you can now run `./rclone version`+(`.\rclone version` on Windows).++Note that on macOS and Windows the [mount](https://rclone.org/commands/rclone_mount/)+command will not be available unless you specify additional build tag `cmount`.-You can also build the latest stable rclone with:+```+go build -tags cmount+```- go get github.com/rclone/rclone+This assumes you have a GCC compatible C compiler (GCC or Clang) in your PATH,+as it uses [cgo](https://pkg.go.dev/cmd/cgo). But on Windows, the+[cgofuse](https://github.com/winfsp/cgofuse) library that the cmount+implementation is based on, also supports building+[without cgo](https://github.com/golang/go/wiki/WindowsDLLs), i.e. by setting+environment variable CGO_ENABLED to value 0 (static linking). This is how the+official Windows release of rclone is being built, starting with version 1.59.+It is still possible to build with cgo on Windows as well, by using the MinGW+port of GCC, e.g. by installing it in a [MSYS2](https://www.msys2.org)+distribution (make sure you install it in the classic mingw64 subsystem, the+ucrt64 version is not compatible).++Additionally, on Windows, you must install the third party utility+[WinFsp](http://www.secfs.net/winfsp/), with the "Developer" feature selected.+If building with cgo, you must also set environment variable CPATH pointing to+the fuse include directory within the WinFsp installation+(normally `C:\Program Files (x86)\WinFsp\inc\fuse`).++You may also add arguments `-ldflags -s` (with or without `-tags cmount`),+to omit symbol table and debug information, making the executable file smaller,+and `-trimpath` to remove references to local file system paths. This is how+the official rclone releases are built.-or the latest version (equivalent to the beta) with+```+go build -trimpath -ldflags -s -tags cmount+```- go get github.com/rclone/rclone@master+Instead of executing the `go build` command directly, you can run it via the+Makefile, which also sets version information and copies the resulting rclone+executable into your GOPATH bin folder (`$(go env GOPATH)/bin`, which+corresponds to `~/go/bin/rclone` by default).-These will build the binary in `$(go env GOPATH)/bin`-(`~/go/bin/rclone` by default) after downloading the source to the go-module cache. Note - do **not** use the `-u` flag here. This causes go-to try to update the dependencies that rclone uses and sometimes these-don't work with the current version of rclone.+```+make+```++To include mount command on macOS and Windows with Makefile build:++```+make GOTAGS=cmount+```++As an alternative you can download the source, build and install rclone in one+operation, as a regular Go package. The source will be stored it in the Go+module cache, and the resulting executable will be in your GOPATH bin folder+(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default).++With Go version 1.17 or newer:++```+go install github.com/rclone/rclone@latest+```++With Go versions older than 1.17 (do **not** use the `-u` flag, it causes Go to+try to update the dependencies that rclone uses and sometimes these don't work+with the current version):++```+go get github.com/rclone/rclone+```-## Installation with Ansible ##+## Installation with AnsibleThis can be done with [Stefan Weichinger's ansiblerole](https://github.com/stefangweichinger/ansible-rclone).@@ -236,7 +290,7 @@ Instructions- rclone```-## Portable installation ##+## Portable installationAs mentioned [above](https://rclone.org/install/#quickstart), rclone is singleexecutable (`rclone`, or `rclone.exe` on Windows) that you can download as a@@ -314,7 +368,7 @@ the [PsExec](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec)utility from Microsoft's Sysinternals suite, which takes option `-s` toexecute commands as the `SYSTEM` user.-#### Start from Startup folder ###+#### Start from Startup folderTo quickly execute an rclone command you can simply create a standardWindows Explorer shortcut for the complete rclone command you want to run. If you@@ -329,7 +383,7 @@ functionality to set it to run as different user, or to set conditions oractions on certain events. Setting up a scheduled task as described belowwill often give you better results.-#### Start from Task Scheduler ###+#### Start from Task SchedulerTask Scheduler is an administrative tool built into Windows, and it can be used toconfigure rclone to be started automatically in a highly configurable way, e.g.@@ -339,14 +393,14 @@ be available to all users it can run as the `SYSTEM` user.For technical information, seehttps://docs.microsoft.com/windows/win32/taskschd/task-scheduler-start-page.-#### Run as service ###+#### Run as serviceFor running rclone at system startup, you can create a Windows service that executesyour rclone command, as an alternative to scheduled task configured to run at startup.-##### Mount command built-in service integration ####+##### Mount command built-in service integration-For mount commands, Rclone has a built-in Windows service integration via the third-party+For mount commands, rclone has a built-in Windows service integration via the third-partyWinFsp library it uses. Registering as a regular Windows service easy, as you just have toexecute the built-in PowerShell command `New-Service` (requires administrative privileges).@@ -366,7 +420,7 @@ Windows standard methods for managing network drives. This is currently notofficially supported by Rclone, but with WinFsp version 2019.3 B2 / v1.5B2 or laterit should be possible through path rewriting as described [here](https://github.com/rclone/rclone/issues/3340).-##### Third-party service integration #####+##### Third-party service integrationTo Windows service running any rclone command, the excellent third-party utility[NSSM](http://nssm.cc), the "Non-Sucking Service Manager", can be used.