I worked as a navy contractor for a few years and at that time (mid 90s) the information as to when a ship was in port was classified confidential. We always found this amusing because information as to when it was deployed was not classified.
I don’t know if they still classify that info but easy to obtain or not, if it’s classified it’s classified.
If you want to know which ships are in port just ask the Dominoes Pizza Delivery guy.