Debian Codegraph @

docs/content/en/host-and-deploy/deploy-with-rclone.md

raw
1 ---
2 title: Deploy with rclone
3 description: Deploy your site with the rclone CLI.
4 categories: []
5 keywords: []
6 aliases: [/hosting-and-deployment/deployment-with-rclone/]
7 ---
8
9 ## Assumptions
10
11 - A web host running a web server. This could be a shared hosting environment or a VPS
12 - Access to your web host with any of the [protocols supported by Rclone][], such as SFTP
13 - A functional static website built with Hugo
14 - Deploying from an [Rclone][] compatible operating system
15 - You have [`rclone`][installed Rclone] installed
16
17 **NB**: You can remove `--interactive` in the commands below once you are comfortable with Rclone, if you wish. Also, `--gc` and `--minify` are optional in the commands below.
18
19 ## Getting started
20
21 The spoiler is that you can even deploy your entire website from any compatible OS with no configuration. Using SFTP for example:
22
23 ```txt
24 hugo build --gc --minify
25 rclone sync --interactive --sftp-host sftp.example.com --sftp-user www-data --sftp-ask-password public/ :sftp:www/
26 ```
27
28 ## Simplify Rclone usage
29
30 The easiest way is simply to run `rclone config`.
31
32 The [Rclone docs][] provide [an example of configuring Rclone to use SFTP][].
33
34 For the next commands, we will assume you configured a remote you named `hugo-www`.
35
36 The above 'spoiler' commands could become:
37
38 ```txt
39 hugo build --gc --minify
40 rclone sync --interactive public/ hugo-www:www/
41 ```
42
43 After you issue the above commands (and respond to any prompts), check your website and you will see that it is deployed.
44
45 [Rclone docs]: https://rclone.org/docs/
46 [Rclone]: https://rclone.org
47 [an example of configuring Rclone to use SFTP]: https://rclone.org/sftp/
48 [installed Rclone]: https://rclone.org/install/
49 [protocols supported by Rclone]: https://rclone.org/#providers