New York (CNN Business) About a month ago, Anthony Strong finally opened a dining room for family-style meals in his San Francisco restaurant, Prairie. He saved up for renovations and shuttered the restaurant for four days to complete construction and was excited to unveil it to customers.

"It was going to be amazing," Strong told CNN Business. "And it was amazing, for an entire week."

Soon after Strong opened the new space, San Francisco started enacting social distancing practices in an effort to stop the spread of the coronavirus pandemic . Restaurants were ordered to restrict their operations. Strong knew that his new concept — sharing meals with strangers — wouldn't work.

So he decided to start selling the food and ingredients he buys in bulk to individual customers, essentially transforming his restaurant into an independent grocery store. The idea was a hit.

"We're blowing through product," he said. "It's been amazing to see people from the neighborhood that we knew as diners coming in," he added. "They used to geek out on dishes off of our charcoal grills, and now they're geeking out on the fact that we have the only stocked pasta shelves in the city."

Strong is not the only restaurateur who has started selling grocery ingredients to customers.

Across the country, cafes and restaurants are scrambling to keep their businesses afloat . Restaurants that relied on dine-in customers are rapidly coming up with ways to hold onto customers who are no longer allowed into dining rooms.

Delivery is one option, but it's expensive — businesses that use third-party services like Grubhub generally have to pay them a fee, which could eat into margins that are already razor thin.

Selling groceries is a way to avoid that problem. They sell items they already sell, in a different form. Opening up temporary grocery stores helps bump up the number of supermarkets in the country, which could ease crowding or delivery bottlenecks. It's also a way to try to support struggling suppliers.

Beyond delivery

Tucker Silk Mill in Easton, Pennsylvania, doesn't want to rely on delivery.

Many restaurants had to lean into delivery during this time. But for Strong, avoiding delivery was important. He didn't want to be beholden to those third-party services. For him and others, delivery was never a good option.

Tucker Silk Mill, a cafe in Easton, Pennsylvania, until recently billed itself as a place for people to gather. "We completely abandoned [the] delivery model to begin with," said owner Jason Hoy. With traditional delivery off the table, Hoy started to sell groceries online, with the option for pickup in stores.

"What we've got is a model that we can control completely," he said, noting that once they started selling groceries, "our business exploded."

Others are setting up in-house grocery stores to make use of excess space.

Marc Glosserman owns a few Hill Country barbecue joints in New York City and Washington, DC. They're large, up to about 13,000 square feet per store, and encourage customers to eat on the premises.

"They're not built for just delivery and pickup only," he said. Glosserman decided to use some of that extra space to set up a general store and sell excess inventory out of the flagship location in Manhattan. When people come in to pick up meals, they can also nab essentials like toilet paper or potatoes.

More grocery stores

As fears surrounding coronavirus transmission in grocery stores mount, bespoke grocery locations may become attractions.

Kevin Lillis operates Jaxon, a beer garden in downtown Dallas. He said that local customers have limited grocery options.

"There isn't a lot available to them, and it's best for them to not be going to a grocery store," Lillis said. Jaxon seats 465 customers, and takeout and delivery is generally a small portion of the business. Deliveries won't offset the loss from in-store sales, he said.

So Jaxon is rolling out grocery services to customers, and planning to sell bags for a flat rate of about $60 apiece. Each bag is filled with six eggs, butter, cheddar cheese, black-eyed peas, wheat bread, cilantro, kale, potatoes, lemon, limes, bacon, chicken and more.

"Those are the things we thought people would need the most," said Lillis, noting that customers can swap out items if they want.

Hill Country, in New York City, is selling groceries to customers.

Even larger chains are getting in on the trend.

Over 30 Denny's locations in Oregon and California are now selling groceries — including paper goods, cheese, bread, raw and deli meat and fresh and frozen fruit and vegetables — in their parking lots. Customers can order online or from their cars, and employees bring the packages to them.

"This new service allows customers to get the food and supplies they need without compromising social distancing protocols or having to enter high-contact spaces," the company said in a statement.

Panera Bread is also expanding into groceries , selling items like bagels, bread, gallons of milk, yogurt and fresh produce. "From limited choices on grocery shelves to the growing need to limit the number of trips outside of the home, it is an incredibly stressful time when it comes to putting wholesome food on the table," said Niren Chaudhary, Panera CEO, in a statement, adding that Panera Grocery can help "provide better access to essential items that are increasingly harder to come by."

Reallocating supply

Selling groceries is also way to help restaurant suppliers, many of which are struggling themselves.

"Our suppliers are in dire need of being supported," said chef and restaurateur Fabio Trabocchi. Of his six restaurants in Washington, DC, four are closed. Two, Fiola Mare and Sfoglina Pasta House, are open for delivery, takeout and groceries.

Trabocchi said his suppliers saw demand plummet when food service providers started closing their doors. And while some have started selling directly to consumers, others are struggling to transform their business models so rapidly.

Prairie's Strong said "it's been really important to me to keep supporting all of our vendors." His suppliers sell to restaurants, and some can't pivot to retail because they haven't set up those accounts.

The new grocery stores can also bypass the supply chain bottlenecks afflicting major retailers.

Groceries sold by Sfoglina, in Washington, D.C.

One produce supplier told Strong he was worried that he wouldn't be able to sell avocados that had been going to food service providers. Through his grocery business, Strong has been able to buy some of those excess products and sell them to customers.

The ad-hoc nature of ordering supplies applies to pricing and packaging, as well.

Generally, the restaurants-turned-supermarkets have been adding a modest margin to the cost of the items. "There's not a standard markup on those items," said Hill Country's Glosserman. "We're pricing them so they move."

Strong doesn't have a weights and measures license, which is issued to grocers to help ensure that they are selling the right amount of product. So instead of selling chicken by the pound, he's selling it by the bird. He's also divvying up 50-pound bags of flour into plastic bags and giving an approximate weight to customers.

The operations are evolving day by day. But some locations are preparing for a more permanent shift. Tucker Sill Mill in Pennsylvania has ordered new fridges and is installing shelves for the grocery business, said Hoy.