Whole Foods, the once hippy-dippy Austin outfit that has since turned into a $13 billion juggernaut pitching organic and socially-conscious groceries, has taken a huge step further on the environmental sustainability front.

On Tuesday, the company reached an agreement with NRG Energy and SolarCity to install as many as 84 to 100 solar rooftop installations on its stores. Not only does this investment offset Whole Foods’ reliance on local grid power, but it is also expected to launch Whole Foods into the top 25 corporate solar power generators in the U.S., a list currently topped by Walmart and the warehouse management firm Prologis.

According to NRG, photovoltaic solar panel systems will be installed on roofs at Whole Foods’ stores and distribution centers across nine U.S. states. While the exact locations have not been determined, all of the companies involved in this deal say that many of the new solar installations will be in New York, New Jersey and Connecticut. SolarCity will design the various installations and will sell electricity to Whole Foods at a discount. The first projects are targeted to begin this spring.

The Whole Foods partnership is a shot in the arm for SolarCity, which has struggled of late. Last summer its stock was trading at a year-high of over $60 a share, then it took a roller coaster ride before rising to $57 in December. Since then, the stock has nosedived, but it surged over 11 percent on Tuesday to just over $25.

In January the company laid off 550 workers in Nevada after state utility regulators approved a reduction in the rate paid to solar customers for generating more power than they can use. Last month, an enthusiastic letter to shareholders revealed that the company installed fewer megawatts worth of solar power last year than it had originally forecast. Those setbacks overshadowed some of the more interesting investments SolarCity made across the U.S., including a manufacturing plant in the rust belt city of Buffalo, New York.

This agreement also helps Whole Foods score some public-relations points on the renewables front. Although the company has long claimed it is both a renewable power innovator and advocate of harnessing energy from the sun, the reality is that the vast majority of stores relied on conventional grid power. Meanwhile, other retail chains, including Target, Costco, Kohl’s, Ikea, Macy’s, and even Bed Bath and Beyond, have all outpaced Whole Foods when it comes to solar power generation. These new solar rooftop systems should catapult the company in front of several of those retailers.

Whole Foods needs to get back on track and stay true to its sustainability street cred, but the company has been thrown off by a series of embarrassments in recent months. Some of its stores in Texas and Virginia got caught in the middle of those states’ open-carry gun laws. The company also found itself embroiled in several social media controversies. Last summer, Whole Foods was ridiculed for its $6 “asparagus water” product, only to retort that those bottles of water with asparagus springs were really “vegetable broth.” A snapshot of pre-peeled oranges encased in plastic also generated plenty of scorn for what many said was privileged, or hipster, excess.

Now that Whole Foods has become serious about clean energy, this massive retailer can put its money where its mouth is and show that it is serious about being a responsible and sustainable company — which, despite its products, it does a poor job of communicating to its customers and stakeholders.

Image credit: Whole Foods