The logistics and difficulties inherent in such ventures have been heavily explored in science fiction.
NASA trains astronauts in an underwater habitat, to simulate living and working in the International Space Station.
They conduct scientific research on the human body and coral reefs, and build undersea structures to simulate space station assembly spacewalk tasks.
NanoRacks, after finalizing its contract with NASA, and after winning NextSTEPs Phase II award, is now developing its concept Independence-1 (previously known as Ixion), the first 'outpost' in NanoRacks' Space Outpost Program, which would turn spent rocket tanks into a habitable living area, often known as a wet workshop.
The setting may be another planet, Earth-like or otherwise; or a spaceship large enough to house a city.