David Nicolle, Forces of the Hanseatic League 13th-15th centuries (2014):
German merchants remained in possession of a prime location on the bank of the River Thames [in London] almost without a break from the 1170s to 1853, when the site was taken over to construct Cannon Street railway station. Known as the Steelyard, it was a rectangular area with 50m… of waterfront and stretching for some 125m… inland. Until the 1240s it had been called the Cologne merchants’ guildhall, but as merchants from Lübeck and other Baltic cities arrived in greater numbers it came to be known as the Guildhall of the Germans. From 1475 it served as the Hanseatic headquarters in England. [Wikipedia: Lübeck, Bremen and Hamburg… sold their common property, the London Steelyard, to the South Eastern Railway in 1852.]
Cities (in this case both London and the north German free cities) are what they are because of what they were, centuries ago.
I suspect that all four cities are where they are because they were at the highest point up their estuaries that were navigable by seagoing ships. Interestingly, in the middle ages seagoing ships could get all the way to Cologne too.