For a period of time in the 18th and 19th centuries, it was common for old, decommissioned sea vessels to serve as floating prisons. Known as prison ships or prison hulks (a hulk being a term for a ship which is no longer seagoing), these were considered a good use for vessels whose days as working boats were over.
The British and their colonies and possessions were the primary user of the prison ship concept. They were most famously used in America during the Revolutionary War. More than 11,000 Colonial POWs died in British prison ships during the Revolutionary War. Conditions were notoriously awful on these ships. Overcrowding and disease were rampant. In Australia, a huge influx of a criminal element in the 1850s resulted in overcrowding in terrestrial prisons, thus leading to the use of prison hulks.
Today, while far fewer in number, the floating prison is still in use. In fact, the largest floating prison left in the world is located in New York, the Vernon C. Bain Correctional Center. Although it was never a seagoing vessel, until 2002 the US Coast Guard did require the Center to have maritime-trained personnel on board, including a captain.