The idea for the song came about when Starr was on a ship belonging to comedian Peter Sellers in Sardinia in 1968. He ordered fish and chips for lunch, but instead of fish he was served squid. This was his first time trying calamari, and he stated, "It was okay. A bit rubbery. It tasted like chicken.") The captain of the boat told Starr how octopuses travel along the seabed picking up rocks and shiny objects to build gardens with. Starr's songwriting was further inspired by his desire to escape the growing hostility between the Beatles, later admitting that he "wanted to be under the sea, too".