--- title: Deployment with Rysnc linktitle: Deployment with Rysnc description: If you have access to your web host with SSH, you can use a simple rsync one-liner to incrementally deploy your entire Hugo website. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 categories: [hosting and deployment] #tags: [rysnc,deployment] authors: [Adrien Poupin] menu: docs: parent: "hosting-and-deployment" weight: 70 weight: 70 sections_weight: 70 draft: false aliases: [/tutorials/deployment-with-rsync/] toc: true notesforauthors: --- ## Assumptions * Access to your web host with SSH * A functional static website built with Hugo The spoiler is that you can deploy your entire website with a command that looks like the following: ``` hugo && rsync -avz --delete public/ www-data@ftp.topologix.fr:~/www/ ``` As you will see, we put it in a shell script file, which makes building and deployment as easy as executing `./deploy`. ## Install SSH Key If it is not done yet, we will make an automated way to SSH to your server. If you have already installed an SSH key, switch to the next section. First, install the ssh client. On Debian/Ubuntu/derivates, use the following command: {{< code file="install-openssh.sh" >}} sudo apt-get install openssh-client {{< /code >}} Then generate your ssh key by entering the following commands: ``` ~$ cd && mkdir .ssh & cd .ssh ~/.ssh/$ ssh-keygen -t rsa -q -C "For SSH" -f rsa_id ~/.ssh/$ cat >> config <