How to install Ubuntu on a external hard drive so I can use it as both storage for windows systems and run ubuntu from it?

I want to use a 2TB external hard drive to act as both storage for my main desktop running windows while having on there Ubuntu to run some linux exclusive applications. I have created a flash drive that I can install ubuntu from. I’d also prefer if the hard drive was portable from my desktop computer to my laptop.