Please have a look at man rsync
. You can specify the port on the source or the destination in the URL:
rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
You can also specify the port separately:
This specifies an alternate TCP port number to use rather than the default of 873.
This is only needed if you are using the double-colon (::) syntax to connect with an
rsync daemon (since the URL syntax has a way to specify the port as a part of the
URL). See also this option in the --daemon mode section.