The general rule is to install the Essentials for Office 365 software closest to your data repositories. For example, if you are migrating from a SharePoint on-premises to SharePoint Online, deploy Essentials closer to your source within your network. If you are migrating Google Drive to OneDrive for Business, consider deploying Essentials to a cloud computing service like Azure or Amazon EC2 where the benefit of not downloading and uploading through your network can be realized. Keep in mind cloud computing can be a costly operation when considering this an option.
NOTE: If you do explore the option of cloud computing in Azure be sure to provision your Azure instance in the same data region as your Office 365 tenant. If you are unsure about your tenants region, please contact Microsoft support for assistance.