How to Transfer Files over the Private Network

Directing commands like ping or rsync at a public IP address will automatically route the traffic over the public network. However, when using an IP address on the private network, the traffic stays on the private network.

If you have two Droplets in the same datacenter with private networking enabled, you can transfer files between them over the private network. We recommend doing so with SSH keys because they’re more secure, but you can also skip the SSH key setup and transfer files using password authentication.

Set Up SSH Keys

If you added SSH keys to your Droplets when you created them, your Droplets will have password authentication disabled. This protects the servers against password vulnerabilities but also means that to connect directly from one server to the other, you need to create and authorize SSH keys.

To transfer files from Droplet-01 to Droplet-02, SSH into Droplet-01 and create a new key.


The ssh-keygen command will prompt you for the location for the key. You can accept the default location or customize it.

Next, print the public key in ~/.ssh/ to your terminal, then copy it to your clipboard. Make sure to change the path if you saved the key to a location other than the default.

cat ~/.ssh/
lAwPT root@Droplet-01

Then, SSH into Droplet-02 and paste the public key into its authorized key file.

echo "EXAMPLEzaC1yc2E...lAwPT root@Droplet-01" >> ~/.ssh/authorized_keys

Transfer Files

From here, you can transfer files from Droplet-01 to Droplet-02 over the private networking using Droplet-02’s private IP address. For example, using rsync:

rsync --verbose /path/to/file

If you added a passphrase to Droplet-01’s SSH key pair, you’ll be prompted to enter it. If you’re using password authentication on your Droplets, you’ll be prompted to enter your password for Droplet-02.

You can verify that the transfer was successful by SSHing into Droplet-02 and looking for the file in the target location.