He was living the Herbalife dream.

John Peterson, 58, was a picture-perfect salesman for the nutritional products company, earning millions to fund a lavish lifestyle that included a ranch in Colorado, a beach house in Mexico, exotic vacations and two private aircraft.

The dream was shattered last Sunday when he died from an apparent suicide.

Peterson was found inside a 2008 Ford pickup parked at his residence in Steamboat Springs, Colo., where he “succumbed to a single gunshot wound,” said Ray Birch, undersheriff for Routt County. Birch said the initial investigation indicated the gunshot was self-inflicted.

Herbalife CEO Michael Johnson wrote to distributors, in a widely circulated memo, that Peterson “passed away suddenly, following a tragic accident at his home.”

Herbalife told The Post that the company does not comment on “private family matters.”

A failed Houston real estate agent in the early 1980s, Peterson joined the controversial multi-level marketing company in its early days.

He became one of only a handful of Herbalife’s 3.2 million distributors who made it to the very elite “Founder’s Circle” of top salespeople.

Last year, Peterson earned an estimated $3 million, according to an independent ranking. He was named Herbalife’s top distributor of the year 10 times.

Peterson boasted of owning a Wyoming cattle ranch and homes in Brazil and in a private beach club in Mexico, in addition to his residence in Colorado.

A private plane and a jet helicopter took him between the homes, he said in a promotional Herbalife video.

“Build your own lifestyle; create the life you want,” Peterson said in the video, repeating a common Herbalife theme.

Peterson and his former wife, Susan, rose with the help of an Internet-based lead-generation business now banned by Herbalife.

Called Work from Home Inc. and incorporated in 2002, it recruited individuals to Herbalife and was one of several such lead-generation businesses that drew hundreds of consumer complaints to the Federal Trade Commission in recent years.

In April, Herbalife told distributors they could no longer buy or sell leads as of June 30.

The move was in response to allegations by activist investor Bill Ackman, who in December announced a $1 billion short of Herbalife shares and called it a pyramid scheme.

Herbalife denied the accusation but has taken steps to address some of its controversial practices.

In a memorial video, Peterson boasted that his “downline” amounted to 200,000 people in “55 to 56” countries. Distributors get a cut of the business from everyone below them.

According to a 1996 lawsuit against the company, Peterson and his former wife were the first to bring Herbalife to Mexico, which became one of the company’s biggest markets.

“I’ve always had another goal, another dream, a reason to keep going,” said Peterson on the Herbalife video.