Christopher Carter

For King and Country

Deploy a Website With rsync

April 16, 2025

You can deploy a static website easily using rsync. No CI/CD, git integration, Netlify, or other modern devops bloat required!

On the remote machine, create a directory under your user, e.g. ~/www/mysite. Then create a symlink so the website can be served by your webserver, e.g. from /var/www/mysite.

sudo ln -sT ~/www/mysite /var/www/mysite

On the local machine, assuming your static site lives at mysite/ set up ssh with the remote server and use the following rsync command:

rsync -uvrP --delete-after mysite/ you@yourserver.com:~/www/mysite/

This will upload only changed files, and delete any files on the remote machine that don’t exist locally.

in hoc signo, vinces

© 2021-2025 Chris Carter. All rights reserved.