Though Santa Rita’s energy system is connected to California’s power grid, if that grid goes down due to a storm, earthquake, or another disaster, the jail can operate autonomously by tapping its solar panels, fuel cells and wind turbines and storing the electricity in the battery packs. In energy geek parlance, that’s called “islanding.”

Once the province of the Defense Department seeking secure power supplies for military bases or companies operating in remote locales, microgrids are going mainstream with some 400 in operation in the United States, according to Jigar Shah, founder of solar company SunEdison and a manager with renewable energy investment firm Clean Feet Investors.

Navigant Consulting predicts microgrids will generate nearly 6,000 megawatts in the U.S. by 2020. That’s enough electricity to power about 5 million homes.

“Electricity prices are 50 percent higher than four years ago,” he said. “Colleges and corporate campuses say we have a geographical entity here we can take off grid and save money.”

Interest in microgrids spiked after Superstorm Sandy last year took down much of the New York power grid, underscoring the fragility of an aging transmission system as climate change accelerates the frequency and severity of storms and hurricanes. A series of independent mini-grids would be much more likely to survive such disasters. “A system that relies on 130 million wooden poles is simply not up to the weather challenges of the current era,” said David Crane, chief executive of NRG Energy, one of the U.S.’ largest independent power producers.

While energy storage systems like batteries remain expensive, plunging prices for solar panels and generous subsidies for fuel cells in states like California have prompted companies to go green to save some green. And that’s bad news for utilities that find themselves competing against their own customers to generate electricity while remaining on the hook for the cost of maintaining the power grid.

“The threat is absolutely there,” Josh Gerber, manager of smart grid operations for San Diego Gas & Electric, one of California’s three big investor-owned utilities, said a green business conference in San Francisco in October.

In fact, the threat was sitting a floor beneath his feet. As part of the conference, a temporary microgrid was constructed to supply electricity to the exhibit hall. “The power system is changing from a large central systems to something near to you that you can actually control and manage,” said Sunil Cherian, chief executive of Spirae, the company that provided the software and control systems for the microgrid. “Just take a look at microgrid that was built here over a weekend in a parking lot.”

* Thanks to Twitter user @WegoWise for this phrase.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.