The official way to get movies and TV series for self hosting is to purchase them on physical disc, then rip that media to your computer so you don't need to swap out discs anymore.
There are also tools to rip the movies from streaming sites. Depending on how you want to do it, there's various tools to download the content, but it's a bit of a war between the streamers and the end users.
There's also ways to download that content from people who share it online. Depending on where you live, this might be completely legal, it might get you fined, it might get your internet shut off, or it might get you put in jail. The worst most people get is a letter telling them to knock it off, but you should look into the laws where you live to find out for sure.
https://lemmy.dbzer0.com/c/piracy has some guides on it.