Michael Kirby Smith for The New York Times

Until recently, Fairway was not much more than a popular market on Manhattan’s Upper West Side, where residents went for goods like smoked salmon, medjool dates and cheeses.

Today, it is a fast-growing 12-store grocery chain with ambitions of opening 300 outlets across the country.

On Wednesday, Fairway hopes the investing public will aid in its expansion after its stock starts trading for the first time.

Its initial public offering got off to a strong start Tuesday evening, with Fairway pricing its shares at $13 each, above the expected range. It raised $177.5 million, valuing the whole company at $536.1 million.

Fairway’s tag line claims that it is “like no other market,” yet it is seeking to expand in a hypercompetitive industry. A chief rival is Whole Foods, which has aggressively expanded in the New York metropolitan area and in August opened its seventh store in the city.

Grocers have also lost customers to the big-box retailers like Walmart and Target, which have become forces in the food business. And even drugstore chains like Duane Reade and CVS sell products once available only in supermarket aisles.

Driving Fairway’s growth is Sterling Investment Partners, a private equity firm that acquired an 80.1 percent stake in the company in 2007 and will continue to control it after the I.P.O. With Sterling’s support, Fairway expanded in New York, New Jersey and Connecticut and is making plans to open stores at a rate of three to four a year.

But with the expansion has come fresh risks. The company lost $11.9 million in the fiscal year that ended in April 2012, even as sales increased 14 percent, to $554.9 million. Its debt has grown, reaching $203.6 million as of last April.

The store in the Red Hook section of Brooklyn, one of the most promising outposts, suffered when Hurricane Sandy struck in late October. Five feet of water washed through the store, destroying its inventory and damaging equipment.

Fairway had recently filed to go public. But with the Red Hook store closed, the company lost out on what might have been $12.7 million in sales, judging by results in the period a year earlier. The store reopened at the beginning of March with a celebration attended by Mayor Michael R. Bloomberg.

For decades, Fairway was a family business, beginning in the 1930s as a fruit and vegetable stand run by Nathan Glickberg. Originally known as 74th Street Market, the store expanded in 1954, adding meat, cheese and dairy products, and adopted its current name in an effort to reflect its fair prices.

The founder’s grandson, Howard Glickberg, who is vice chairman of development, will continue to own a small stake after the I.P.O. and will receive a $1.8 million bonus connected to the offering. His son, Daniel, who recently resigned as a director, has sold shares in the deal but will also retain a small stake.

Philip Lempert, the editor of Supermarket Guru, an online food-industry publication, said that Fairway would face challenges in the transformation from a local chain to a national one. But he said that two things the company had going for it were “adventure and value,” a combination that appeals to younger generation of food shoppers.

“Millennials wake up every morning not wanting to eat the same food twice in their lifetime,” he said. “Fairway has the Bounty paper towels and Coke but also these small-batch, artisanal items that make it an adventure.”

The original store on Broadway has become a Manhattan institution. Like its Upper West Side neighborhood, it has a frumpy elegance. Navigating a shopping cart through its narrow aisles is a full-on contact sport, like driving a bumper car through a Middle Eastern souk.

But loyal customers find order in the chaos. Strategically placed employees, wearing “Do you have a food question today?” aprons, stand ready to help customers find Sicilian sea salt, dried prunes or a pork tenderloin. Piles of parsnips and broccoli rabe seem to be restocked as rapidly as shoppers can fill their baskets.

The store’s core customers are people like Alan D. Pekelner, who on Tuesday spent about $3 on a half-gallon of milk, an onion and two plum tomatoes. “I just needed some fill-in items for a salad,” he said.

Mr. Pekelner, 77, who lives by himself and practices law out of his apartment on West End Avenue, said he had been shopping at the Fairway for about 35 years and likes its variety and reasonable prices. But as competition has popped up in the neighborhood, he has found himself frequenting other stores, like Trader Joe’s, which opened just a few blocks down Broadway in 2010.

By the water in Red Hook, Fairway has a different character, with wide aisles that, compared with the original store, seem downright palatial. At 75,814 square feet, the store, which opened in 2006, is the biggest of Fairway’s New York outlets. (The original store is 59,468 square feet.)

Karline F. Moeller drives to the Fairway market from her home in the Dumbo section of Brooklyn. Ms. Moeller, 27, who manages artists like Maxwell Snow and Shelter Serra, said she appreciated the convenience and prices.

“Sometimes Whole Foods drives me crazy because it doesn’t have the commercial brands,” she said on Tuesday. “This place has everything.”

Around noon on Tuesday, Mordecai Rosenfeld, a writer and retired lawyer, was exploring the market on an outing with his friends, who marveled at the expansive aisles.

“We’re so used to the Fairway at Broadway and 74th, we couldn’t imagine it would be here,” said Mr. Rosenfeld, 83, who lives in Greenwich Village. “Where do they get their people from?”

Asked if he would consider investing in the I.P.O., Mr. Rosenfeld said he had one condition.

“If they throw in some olives with the shares, we’re going to buy them,” he said.