Which novel depicted Mars' moon Phobos as an elaborately constructed spaceport?
The barren rock of Phobos has been carved hollow by man and wreathed with metal. With a radius of only twelve kilometers at its widest, the moon is ringed by two huge dockyards, which run perpendicular to each other. They're dark metal with white glyphs and blinking red lights for docking ships. They slither with the movement of magnetic trams and cargo vessels. Beneath the dockyards, and at times rising around them in the form of spiked towers, is the Hive - a jigsaw city formed not by neoclassical Gold ideals, but by raw economics without the confines of gravity. Six centuries' worth of buildings perforate Phobos. It is the largest pincushion man has ever built.
Transshipping helium-3 up from Mars and onward to the rest of the solar system is Phobos' purpose:
In the aftermath of my escape, the Jackal initiated an immediate moratorium on all flights leaving Mars for orbit.... Ultimately, not even the ArchGovernor of Mars could ground all commerce for long, and so his moratorium was short-lived. Billions of credits lost every minute the helium-3 did not flow [via Phobos].
Phobos is the larger and innermost of the two moons of the planet Mars, the second being Deimos. It is the scene of the first Doom episode, Knee-Deep in the Dead. "Phobos" is the name of a god in Greek mythology and it can be translated as "panic fear", "flight" or "battlefield rout".
In Doom, Phobos is depicted with Earth-like gravity, a thick atmosphere, and having tall, seemingly vegetation-covered mountains; the sky texture for the episode was derived from a photograph taken of Yangshuo Cavern in China.
In reality, Phobos is a rock 22 kilometers in diameter with gravity less than a thousandth of that on Earth, and no atmosphere (even if an atmosphere could be generated artificially, the gravity would be insufficient to hold it in place). Phobos' gravity is so weak that a human being could escape it by jumping. In order to be more plausible, Doom 3 moved the plot to Mars.
One of the earliest, and extremely well-written, attempts at hard-SF about Mars is Arthur C. Clarke's Sands of Mars (1951) which features a spaceport on Deimos.
The idea has been used many times since then -- the exquisite Poul Anderson story "The Martian Crown Jewels" for instance. Phobos and/or Deimos have also been alien spaceships a number of times, but that doesn't count, I guess...
Robert Heinlein's "The Rolling Stones" has the Stone family landing at a spaceport on Phobos and then taking a ferry down to Mars.
All ships land on Phobos, which would make it a port.
The book is from 1952, though, so the Clarke story mentioned by Mark Olson in another answer beats it by a year.
Kim Stanley Robinson's Mars trilogy uses Phobos as a base.
Phobos was one of the two natural satellites of Mars, the other being Deimos. Its name means "fear" in Greek.
The first humans to arrive on it were a team of the First Hundred led by Arkady Bogdanov upon the arrival of the Ares in Mars space. During their initial settlement, they domed Stickney crater. They also secretly placed a system of remote controlled guidance jets that could drive Phobos out of its orbit and burn it in the atmosphere. At that time it was used as a communications satellite.
It was later used as a weapons platform by UNOMA and transnational forces. Arkady gave the remote control to the jets to Nadia Cherneshevsky, who used them and destroyed Phobos during the First Martian Revolution in 2061.