In the epic and Puranic accounts, Krishna leads his people west from Mathura to escape a persistent enemy and founds a fortified city on the coast of what is now Gujarat. Dvaraka, the city of gates, is described as raised from the sea by divine command, laid out in gold and jewels, and defended by water. It is where Krishna rules as king rather than plays as a cowherd, which is a different aspect of the same figure and the reason the temple here calls him Dwarkadhish, lord of Dwarka.
The end of the story matters as much as the beginning. After a feud destroys the Yadava clan and Krishna is killed by a hunter's arrow, the sea rises and reclaims the city, and the surviving women and children are led away. Hindu chronology places that departure at the beginning of the present age of decline, so the drowning of Dwarka is not merely an episode but the hinge between two ages.
The Dwarkadhish temple stands above the shore on a high plinth, its tower carried on rows of carved pillars, and it is generally attributed to the sixteenth century on foundations far older. A flag is raised on the spire several times each day, sewn by families who hold the right and paid for by devotees who queue years in advance for a turn. Pilgrims complete the visit at Bet Dwarka, an island offshore reached by boat, and often at the nearby Nageshwar shrine, counted among the twelve jyotirlingas of Shiva.