No, the Apple TV movie Greyhound is not based on a true story.
The film, starring Tom Hanks, is an adaptation of the 1955 novel titled The Good Shepherd, written by C.S. Forester. Both the novel and the subsequent film adaptation present a fictional narrative.
While the characters and specific events depicted in Greyhound are creations of fiction, the story unfolds within a very real and perilous historical context: the Battle of the Atlantic during World War II. This non-fictional scenario involved crucial convoy battles where Allied ships transported vital supplies across the U-boat infested Atlantic Ocean. So, while the broad setting and the types of challenges faced by naval commanders were historically accurate, the specific journey of Commander Ernest Krause and the USS Greyhound is a product of the author's imagination.
The movie, therefore, offers a dramatic and intense look into the struggles of naval warfare during that era through a compelling, yet entirely fictional, storyline.