Not-So-Safe Harbor

"''"Where the streets have no name Where the devil's in all men If you knew what was at stake Pay or flee in Tortuga Bay"''"

- Running Wild,"Tortuga Bay"

As far as humankind has dominated the sea, sailors have been considered as one of the lowest links of the social hierarchy, since these men spend many, many weeks at sea and usually not having a steady place to live, traveling a lot and usually, but not always, using the little wages they have on lowly pleasures. Hence, the typical image got through times on the settlements made to give these men a place to spend their wages and satisfy their urges.

Common elements of these Wretched Hive-types of ports are shady merchants, run-down taverns with lots of drinking and gambling, cheap whores, barrels and crates everywhere, and lots and lots of fish. But we have managed to classify them in two types:

Type 1 is the Booty Bay, usually the hangout of your favorite Pirates, whether they're idle or not. Expect them to be on an unknown location where authorities try to be on the margin of things and raids every once in a while. Set either somewhere in the Caribbean or in Southeast Asia, though not exclusively, expect it to be on the 18th or the early 19th century. And yes, it's full of both kinds of Pirate Booty.

Type 2 is the Stormalong Harbor, generally associated with the novel Moby Dick and a staple of the New England culture in general, though it is not a requirement to be. Expect sea shanties, whalers, maidens who wait for their men to return, and privateers around, usually set during the 19th century or the early 20th century.

This trope still has its echoes in present-day fiction, as dockyards remain a popular setting for police to uncover contraband of all sorts. Its friendlier counterpart is the Port Town.

Anime and Manga

 * Roanapur from Black Lagoon is a modern-day version type 1, being a hangout for pretty much every illegal or semi-legal shipping crews in the south asian sea.
 * Avast! The city of Vritanis, containing at least one Pirate captain, complete with eyepatch, pegleg and cutlass.
 * The Grand Line in all its cliched piratey glory.
 * Interestingly, you can find both kinds.
 * Mock Town is an insanely violent version of Type 1. It's so bad there, a man standing on top of a building challenging everyone to a fight and killing anyone who dares with his bare hands barely draws a crowd, much less a flaming man getting kicked out a window.
 * Water 7 is a type 2. Mostly legitimate businesses of shipwrights and traders, but it's still a place full of gambling, street parties, bars, and other places where you can spend several MILLION of the world's currency in a matter of hours and have nothing to show for it.
 * Berserk has an arc around a battle next to a port. Being a Crapsack World like few others, the whole town and implicitly its port fits this.

Comics

 * Madripoor in the Marvel Universe is a Type 1 set in modern times.

Film

 * Sweethaven in Popeye The Movie.
 * Tortuga, Singapore and Shipwreck Cove from Pirates of the Caribbean. Jack tells his crew to be careful about the latter as it's apparently a Meaningful Name.
 * In reality, the actual wretched hive of the Caribbean during that time period was Port Royal. It shows up as the city Governor Swann runs, and is portrayed as being orderly and clean. Tortuga had been a notorious Wretched Hive in the late 17th century, but had cleaned up its act and lost that reputation by the time Pirates is apparently set.
 * The Tortuga of the film is still somewhat cleaned up and Disney-fied, compared to how you'd expect it to be in real life; women can walk safely around without any fears of being raped, for example. Considering that a lot of the pirates have no qualms about murder ( at least in theory), that there are much more men than women everywhere in the film, and how most pirates spend a long time in boats without women, you'd expect that even pretty young men wouldn't be safe, let alone Elizabeth Swann.
 * Samoa in Nate and Hayes.
 * Mos Eisley is this trope IN SPACE! You will never find a more wretched hive...

Folklore

 * Libertatia (or Libertalia), the free communalist colony forged by pirates on Madagascar under the leadership of Captain James Misson in the late 1600s. There is little historical evidence to suggest that Libertatia ever actually existed.
 * It was more an ideal to strive for than an actual place, and in that ideal it wasn't an example of this trope - it was basically a democratic utopia where people's worth was determined by their abilities, not by birthright.

Literature

 * Innsmouth in the Cthulhu Mythos is a Type 2 Town with a Dark Secret.
 * The movie Dagon transports the location to Spain and renames the town "Imboca", which translates to "in the mouth". It's set in the present day, but looks as though it could be the 19th century.
 * The pirate town of Tortage in the Barachan Islands in the Conan the Barbarian novels.
 * Damocles Docks in the third book of A Series of Unfortunate Events.
 * Gloucester in Captains Courageous
 * Rhodes in Over the Wine Dark Sea is the home port. A whole bunch of other cities are where they visit.
 * The Dragaera novel Orca is set in a costal city and involves the House of Orca, whose "hat" is both seafaring, and being crooked businesspeople or government officials. So, while the town is actually quite nice looking, probably like a pretty New England town, it's actually a hive of corruption.
 * In the Vorkosigan Saga, the planet Jackson's Whole started out as the Booty Bay variation In Space!
 * The Port in Septimus Heap comes awfully close to this, ebing a hiring place of pirates and having generally a reputation for being an unsafe place to be in.
 * Braavos in A Song of Ice and Fire. "Cat" provides a clam-seller's view from inside.

Live Action TV

 * Type 1 is parodied on The Mighty Boosh episode "The Legend of Old Gregg".

Music

 * Although the Frame Story takes place in the belly of a whale, a Type 2 figures prominently in "The Mariner's Revenge Song" by The Decemberists.
 * Type 2s in general are pretty common in The Decemberists' songs, being that a lot of their songs are shanties or otherwise nautically-themed.
 * Song example: Portobello Town in Emerson, Lake & Palmer's "Pirates", "where we've been told That a purse of gold Buys any man a crown".
 * "Singapore" by Tom Waits.
 * Aside from the page quote, Running Wild's "Port Royal" also dwells on the subject.

Video Games

 * World of Warcraft has Booty Bay, the Trope Namer for Type 1.
 * Though, oddly enough, pirates have actually been banned from docking there-- they dock in a natural cove nearby. The mayor of the town even sics you on them as part of a quest.
 * This is more a turf war between two pirate gangs, the Bloodsail Buccaneers and the Blackwater Raiders, who control Booty Bay.
 * Runescape boasts quite a few belonging to both types:
 * Port Sarim is the only sea town accessible to nonmembers, and the only pirate here would appear to be the friendly drunk Redbeard who just wants some Karamjan Rum.
 * In the member's world is Brimhaven on the north end of Karamja as a firm example of Type 1.
 * The Cabin Fever quest gives access to Mos Le'Harmless (pun intended), a whole island populated by pirates.
 * Port Phasmatys was once an example of Type 2, until it became a literal Ghost Town when all the residents were transformed into spirits. Surprising lack of Ghost Pirates, although Bill Teach and Pirate Pete are pirates who are still very much alive.
 * Ever Quest 1 has the entire Legacy of Ykesha expansion. All the zones in that expansion are located on an island called Brokenskull Rock, and Brokenskull Rock swarms with pirates. One of the zones is called Dulak's Harbor.
 * Smuggler's Cove in the computer game I Spy: Treasure Hunt, especially in the past, but even in the present day, most townspeople seem obsessed with pirates and the sea.
 * Melee Island in the Monkey Island series.
 * The pirate island Buccaneer's Den, appearing in the Ultima series since Ultima 4.
 * Fire Emblem: Yaaargh, the port o' Badon, what be filled with pirates and other unsavory nautical characters.
 * Paper Mario: The Thousand-Year Door has the aptly named "Rogueport".
 * Bloodstone in Fable II.
 * Brynnlaw in Baldur's Gate 2, which also has the distinction of being the port servicing Spellhold.
 * Bloodbath Bay in Sly 3: Honour Among Thieves.
 * Dragon Age II: The Docks in Kirkwall. Except for the Qunari compound (which nobody in their right mind messes with), it's a smugglers' haven in the daytime, and at night it falls into the hands of gangs. While the rest of Kirkwall is also unsafe at night, the dockside gangs get a special mention for, in two of the three Acts, being controlled by blood mages.
 * Omega is a Type 1 variation in Mass Effect 2.
 * Scurvy Docks in MediEvil (1998 video game), where you must disguise yourself as a pirate to get a boat.
 * Kao the Kangaroo Round 2 uses a pirate-infested harbor as The Hub.

Western Animation

 * Type 2 is named after the Wretched Hive of The Marvelous Misadventures of Flapjack.
 * In case you're thinking "Gee, way to name it after a cartoon I never heard of," be assured that Stormalong is a reference that is Older Than You Think.
 * The port in the Avatar: The Last Airbender episode "The Waterbending Scroll." A rather scary-looking Wretched Hive where "high-risk traders" read: "pirates", irresponsible Avatars and their inexperienced companions, and obsessive Fire Nation princes all end up at the same time. It Got Worse.