Even before it was a prison, Rikers Island was home to crooks.

Magistrate Richard Riker, owner of the island in the early 1800s, was a descendant of the German-Dutch von Rycken family, which had held the island in its possession since the 1600s.

Riker’s contemptible side gig involved rubber-stamping from his judge’s bench the paperwork that allowed free black men, women and children to be kidnapped off New York City’s streets and trafficked down South as slaves.

“It was a plague,” said Jacob Morris, director of the Harlem Historical Society. “And this was the patriarch of Rikers.”

But Magistrate Riker was just the beginning.

The island’s history shows it has been a human grist mill for nearly two centuries, eventually becoming home to hundreds of thousands of criminals a year as the city’s largest jail.

It is now such a hellhole that city officials want to shut it down permanently.

Morris said the island’s name should be changed, although perhaps still keeping a tie to its penal history.

“How about Correction Island?” he recently suggested to The Post.

“Or better yet,” he said with a laugh, “The Island That Needs Correction.”

The marshy island has never been considered prime real estate, which has contributed to its sordid history.

Years after Riker, during the Civil War, the island was used as a training ground for Union Army regiments, a last stop before they headed south to face the enemy.

In between encampments, pigs were raised on the island for slaughter.

After the war, on July 3, 1884, the city bought the island from the last of the Riker family owners, John T. Wilson, for $180,000, with the intent of building a workhouse.

But the island lay silent for the next 30 years.

Then in the 1920s, the city decided it would be just the right spot for building a jail to replace the small, crumbling Blackwell’s Island Penitentiary on what’s now Roosevelt Island.

Rikers Island was then a mere 87.5 acres and ringed by shoals just under the waterline.

A jail would require more land, officials decided.

Their dilemma was easily solved by using convict labor to build up the island with trash delivered by barge from Manhattan.

But the trash proved troublesome.

“The rats grew so numerous and so large that the department imported dogs in an effort to eliminate the rats,” Heather Rogers writes in her 2006 book, “Gone Tomorrow: The Hidden Life of Garbage.”

“The dogs were not fed by the authorities but lived solely on the rats. Despite this . . . the rats continued to multiply.”

‘Rikers is a mass-incarceration model that stains everything that it touches.’ - former New York state Chief Judge Jonathan Lippman

Then, Rogers writes, came the explosions.

“Gases . . . were constantly exploding through the soil covering and bursting into flames . . . in the summer the ground resembled a sea of small volcanos, all breathing smoke and flames.”

Out of this literal hell rose the Rikers Island we know today.

Rikers Island opened its doors for the first time to inmates in 1932, seven years after the city first debated putting a jail there.

In the decades since, Rikers’ infamy only grew as the lawless lockup became known for violence between prison gangs, hard-boiled inmates and their sometimes brutal keepers.

Within just seven years of opening, a Bronx court decried conditions inside the prison, saying it was filthy, overcrowded and plagued by a growing trade in contraband.

But the next year, inmates were put to work turning one of its garbage dumps into a tree farm, which eventually grew thousands of shrubs and trees that were then transplanted into city parks.

There were other brief moments of decency in its history, too.

On a snowy February night in 1957, a Miami-bound DC-6A plane carrying 95 passengers took off from La Guardia Airport, only to crash onto the island and explode minutes later.

Twenty people died.

But as The Post recounted recently, the correction officers on duty that night allowed the 69 inmates who had been signed up for snow removal duty to help free the remaining passengers from the burning wreckage.

“I don’t know if all of us would’ve even gotten out without them,” passenger Kenneth Kronen, now 89, told The Post from his home on the Upper East Side.

In 1959, the city also created a school, PS 616, on Rikers to help educate its imprisoned masses.

In 1965, the artist Salvador Dalí donated a drawing for its walls as an apology because he couldn’t get to a talk about art for the prisoners.

It was swiped in March 2003 and replaced with a fake.

Three employees were charged with the theft, but the work was never found.

Over the years, violence soared as the jail became more crowded — fueled by the crack epidemic of the 1980s and ’90s — and rival drug gangs that fought for turf on the streets also waged bloody battles inside the walls.

Plenty of boldface names found themselves locked up with common thieves and violent felons over the decades.

“Son of Sam” serial killer David Berkowitz was busted in 1977 after a killing spree that left six women dead and terrorized the Big Apple.

Berkowitz, a 24-year-old postal worker from Yonkers, spent time at the jail until pleading guilty in 1978, when he was transferred to a prison upstate.

Sex Pistols bassist Sid Vicious spent seven weeks at Rikers after cops found his girlfriend Nancy Spungen stabbed to death in the Chelsea Hotel in 1978.

He was charged with second-degree murder, then released on bail, but got sent back to the slammer for getting into a barroom brawl.

Vicious got out in early 1979 while awaiting trial. He was found dead of a drug overdose the next day after a night of celebrating.

Mark David Chapman was sent to Rikers after assassinating John Lennon outside his apartment in the Dakota apartment building in December 1980. He was later transferred upstate to Attica.

GOP state Sen. Guy Velella was forced to quit in 2004 after he was convicted of taking $137,000 in bribes to help companies get state contracts.

He was sentenced to a year in prison but spent only 182 days on Rikers.

Hip-hop stars, including DMX and Lil Wayne, also did time on the island.

DMX couldn’t stay away from cocaine or out of trouble and was busted in 2005 after failing to take a mandated drug test and refusing to go into treatment. Instead, he spent 40 days at Rikers.

Lil Wayne was sentenced to a year at Rikers after pleading guilty to weapons charges in 2010.

Ex-New York Giants receiver Plaxico Burress was on Rikers in 2009 after an infamous incident in which he accidentally shot himself inside a Manhattan club.

Dominique Strauss-Kahn, a former head of the International Monetary Fund and a onetime French presidential candidate, also got locked up on Rikers after he was accused of sexually assaulting a maid at the posh Sofitel hotel in Midtown.

The Manhattan DA later dropped the case.

Morris, of the local historical society, has lobbied for years to change the name of the island so that the blighted place no longer bears the moniker of Magistrate Riker.

But even with its modern-day infamy, his petition has hardly caught fire. It still had only 33 signatures Monday.

He said he thought he might get a boost from Hollywood at one point, with the 2013 release of an Oscar-winning movie based on the memoir of a free-born New York African-American who was kidnapped and sold into slavery.

“I figured that with the movie ‘12 Years a Slave,’ I’d get some support,” Morris explained.

But some others are pulling for a different new moniker.

Last week, it surfaced that a blue-ribbon panel was recommending the jail be completely shut down and potentially replaced by new facilities across the five boroughs.

“Rikers is a mass-incarceration model that stains everything that it touches,” said former New York state Chief Judge Jonathan Lippman, who led the panel. “Rikers is by any standard a penal colony. It’s a penal colony. It’s a 19th-century solution to a 21st-century problem.”

Days later, city Public Advocate Letitia James proposed renaming the island after Kalief Browder, the teen who hanged himself in 2015 after three years as a Rikers inmate.

Browder’s family members have expressed mixed feelings about the “honor,” saying they would like to think it over.