deployment-with-rclone.md (2012B)
1 --- 2 title: Deployment with Rclone 3 linktitle: Deployment with Rclone 4 description: If you have access to your web host with SFTP/FTP/SSH/HTTP(DAV), you can use rclone to incrementally deploy your entire Hugo website. 5 date: 2021-08-09 6 publishdate: 2021-08-09 7 lastmod: 2021-08-09 8 categories: [hosting and deployment] 9 keywords: [rclone,sftp,deployment] 10 authors: [Daniel F. Dickinson] 11 menu: 12 docs: 13 parent: "hosting-and-deployment" 14 weight: 80 15 weight: 80 16 sections_weight: 80 17 draft: false 18 aliases: [/tutorials/deployment-with-rclone/] 19 toc: true 20 notesforauthors: 21 --- 22 23 ## Assumptions 24 25 * A web host running a web server. This could be a shared hosting environment or a VPS. 26 * Access to your web host with any of the [protocols supported by rclone](https://rclone.org/#providers), such as SFTP. 27 * A functional static website built with Hugo 28 * Deploying from an [Rclone](https://rclone.org) compatible operating system 29 * You have [installed Rclone](https://rclone.org/install/). 30 31 **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 ``hugo`` commands below. 32 33 ## Getting Started 34 35 The spoiler is that you can even deploy your entire website from any compatible OS with no configuration. Using SFTP for example: 36 37 ``` 38 hugo --gc --minify 39 rclone sync --interactive --sftp-host sftp.example.com --sftp-user www-data --sftp-ask-password public/ :sftp:www/ 40 ``` 41 42 ## Configure Rclone for Even Easier Usage 43 44 The easiest way is simply to run ``rclone config``. 45 46 The [Rclone docs](https://rclone.org/docs/) provide [an example of configuring Rclone to use SFTP](https://rclone.org/sftp/). 47 48 For the next commands, we will assume you configured a remote you named ``hugo-www`` 49 50 The above 'spoiler' commands could become: 51 52 ``` 53 hugo --gc --minify 54 rclone sync --interactive public/ hugo-www:www/ 55 ``` 56 57 After you issue the above commands (and respond to any prompts), check your website and you will see that it is deployed.