For much of the 20th century, Manhattan’s West Side was a gritty, bustling central artery of the shipping trade, home to the East Coast’s busiest and most profitable port.

Billions of dollars passed each year through the West Side docks, spanning from Houston Street up to 110th Street, and thousands of people worked there, loading and unloading trucks and cargo ships from around the world.

And one man was at the center of it all: Eddie McGrath, an Irish mob chief and mastermind of dirty money. McGrath might not be as well known as some of his Cosa Nostra peers, but he was every bit as powerful and deadly.

The crooked life of this waterfront shot-caller is told in Neil G. Clark’s new book “Dock Boss: Eddie McGrath and the West Side Waterfront” (Barricade Books).

“Eddie McGrath’s background was interesting compared to all these other mobsters, like Dutch Schultz,” Clark tells The Post. “Your typical gangster had a childhood marked by “juvenile detention, penitentiary stays, street gangs, whereas Eddie McGrath grew up ‘normal.’ ”

Born in 1906 to Irish immigrants, McGrath came of age in New York’s East 20s, then a rough-and-tumble area known as the Gas­house District. Throughout his youth, he kept his nose clean. He got good grades and served as an altar boy and sang in the choir at St. Stephen’s Roman Catholic Church on East 29th Street. He dropped out of school after the 10th grade to work as an office clerk, which was not unusual for the time.

But a clerk’s salary wasn’t going to pay for his expensive tastes in clothes, women and nightclubs, and McGrath gradually fell in with the wrong crowd. Still, for a man who would ultimately lead a life of crime, his first arrest happened relatively late in life. McGrath was 21 years old when he was busted for burglarizing an ice-cream shop; he got off with a warning.

The warning didn’t stick.

McGrath became a low-level crook, working as a driver and salesperson for an East Harlem bootlegger named Joey Rao. The Irishman excelled at his job, in part because he was smarter than your average gangster, and friendlier, too. Clark says McGrath was personable, “sociable, kind of a master of connections,” used to operating “between worlds.”

“Your typical gangster had a childhood marked by “juvenile detention, penitentiary stays, street gangs, whereas Eddie McGrath grew up ‘normal.’ ” - Neil G. Clark

He might have been mistaken for a legitimate businessman, if not for the company he kept — men with names like “Squint” Sheridan, “Bennie the Bum” McMahon and James “Ding Dong” Bell.

Everything changed for McGrath in 1930, when he got sent up to Sing Sing for five years on a burglary rap. “There’s a reason they call [Sing Sing] ‘college,’ ” Clark says. “By the time he came out, he was a hardened criminal.” McGrath knew he wanted to be a racketeer, “and he came out with a game plan.”

That plan included teaming up with two of his big-house buddies, John “Cockeye” Dunn and John “Red” McCrossin, and taking over the loading racket on the West Side docks. (The trio quickly became a duo when word got to McGrath and Dunn that McCrossin had been skimming money from their shared profits. They took Red out drinking, and at the end of the night, deposited two bullets in his skull.)

McGrath and Dunn started placing their gangster buddies as boss loaders on the piers. Boss loaders oversaw loading gangs, which Clark describes as “groups of men who, through what was essentially squatters’ rights, controlled the loading and unloading of trucks at the piers.” The potential for corrupt profits from this flawed system was tremendous.

To enforce this scheme, Dunn and McGrath set a precedent: “Cross us and we will kill you.” And they meant it. The gang was responsible for at least 30 murders.

One example was the case of a dockworker named Mutt Whitton. In 1941, a crate of Tommy guns headed to England was stolen. Someone called the police with an anonymous tip that the guns would be found near a barber shop off Pier 54. And sure enough, that’s exactly where the police found the cache. Whitton was an ex-con who was suspected of being cozy with the police, and coincidentally or not, he had landed a new job on the docks shortly after the weapons were found.

A few days after the bust, Sheridan and his associate Joe Powell strolled down Pier 14 to where Whitton was working. They asked for a word. Sure, said Whitton. They repaired to a storage area at the end of the pier, where Squint promptly shot Whitton twice in the chest and once in the head. Then they dumped his body down a drain pipe into the river, and, still covered in his blood, they slowly walked back down the dock. They wanted to be seen, to make the point: No one snitches and lives. Months later, Whitton’s body was hauled up from the river, unidentifiable save for its fingerprints.

Clark says that McGrath and his goons had to “put the fear into the longshoremen. Because it was a hard world. These were hard men who were tough guys, and to be able to put fear into them, you had to be tougher than them.”

McGrath and Dunn’s biggest coup was infiltrating the International Longshoremen’s Association, the powerful union to which most dockworkers belonged. In 1936, the ILA’s longtime president, Joe Ryan, was facing dissension from the rank-and-file membership. To lock down his power, Ryan made common cause with the mob. He partnered with Dunn and McGrath and gave them their own local ILA charter. The gangsters assumed formal leadership roles in the union, all the while using their strongarm — and firearm — tactics to keep the dockworkers in line.

Things started to go south for the dock mobsters in the years following World War II. Veterans returning to work on the docks felt empowered; they weren’t so eager to comply with ILA corruption. One of these outspoken stevedores, Anthony Hintz, wouldn’t let well enough alone. To teach everybody a lesson, Dunn and two associates, including Sheridan, plugged him.

Surprisingly, the gangsters were arrested, charged and convicted of first-degree murder. In July 1949, Dunn and Sheridan breathed their last breaths in the chair of the death house at Sing Sing. It was a black eye for Ryan and the ILA, as well as for McGrath. The mobster started to make himself scarce in New York.

Nevertheless, McGrath continued to pull the strings of his dock operation from his luxury apartment in Florida. He also golfed a lot.

The final decline of the Irish dock mob came with the decline of the docks themselves. Containerized shipping dealt the West Side docks their biggest blow, as container-friendly docks in Staten Island and New Jersey supplanted the lion’s share of Manhattan port operations.

Unlike so many of his fellow toughs, McGrath didn’t burn out or get blown away. He essentially retired from the business, though not entirely. Clark says, “When the Mafia wanted to deal with the Irish mob, they went to Eddie McGrath.” Investigators continued to dog him, as well, and in 1980 he was sent to Rikers for three months on contempt-of-court charges.

Eddie McGrath died in Florida of natural causes at the age of 88, far from the docks that had made him rich and powerful. For all his crimes on the waterfront, he’d served only 90 days in prison.