As climate change does its thing to America, what it is going to do to the nation’s food supply is still an open question. Will California’s Central Valley, which grows a third of the produce eaten in the U.S., wither into a vegetable ghost town? Will other locations pick up the slack? Or will agriculture just take a look at the harsher droughts, crazier storms, and prolific insects that the future has in store and move indoors?

It’s this indoor farming future that Allison Kopf, founder and CEO of the agricultural technology startup Agrilyst, is curious about. In an indoor farm, water doesn’t inconveniently evaporate. LED lights can lengthen the hours of sunlight so plants can grow faster. CO2 levels can be tweaked. Even as the weather outside goes haywire, plants farmed indoors can live out an optimized version of the weather that they coevolved with — the weather of the past. The best weather of the past. Or, as Kopf calls it, a “weather-independent environment.”

Reader support makes our work possible. Donate today to keep our site free. All donations DOUBLED!

Kopf’s journey to greenhouse tech was an unexpected one. She majored in physics and in 2009 became the project manager for Team California in the solar decathlon, a biannual competition held by the U.S. Department of Energy. Team California designed and built a house that took advantage of the local climate, but also had a control system, built from scratch, that could monitor the house’s energy and water consumption, along with other vitals, from an iPhone app.

“We will shape the environmental future of this world,” Kopf said, in a speech at the final decathlon competition in Washington, D.C. “And we will make every building under the sun, [be] powered by the sun!”

Grist thanks its sponsors. Become one.

Team California placed a perfectly respectable third. Kopf was looking forward to a future in solar tech. But just as her work with the decathlon ended in 2010, the solar industry hit the skids — a casualty of a trade war between the U.S. and China.

Then she met Paul Lightfoot, a Wall Street lawyer turned restaurant reservation software magnate (his startup, Foodline, tanked in 2001) turned CEO of AL Systems (a retail supply chain software company). Lightfoot had just had a midlife crisis and decided that he wanted to “combine his career in supply chain management with his passion for bringing food to people that tastes better, is healthier, and is better for the environment.”

The result: He was the newly minted CEO of BrightFarms, an urban farming and education nonprofit that had morphed into a for-profit greenhouse consultant. Lightfoot had a vision: He wanted to build his own greenhouses, instead of just consulting on other people’s. He also wanted to build a lot of them. That would take a lot of money. But Lightfoot had a plan to copy a financing technique that was common to the solar industry, but rare elsewhere: the Power Purchase Agreements (PPA).

In solar, a PPA works this way: You’re a homeowner, or an elementary school, or what have you. You’re approached by a company that says, “Hey. If you agree to buy your electricity from me for a certain amount of time, I’ll put in some solar panels nearby and run a power line out to you.” In areas where PPAs are legal, they’ve led to a whole lot of solar installations, fast. Lightfoot had a feeling that with his retail connections and experience, he was in a unique position to do the same thing with grocery stores. He would get financing; the grocery stores would secure a reliably priced flow of hydroponic herbs and baby lettuce. Everyone would win.

Grist thanks its sponsors. Become one.

Except that winning was a complicated process. BrightFarms wanted to build close to cities that had consumers who felt they deserved baby lettuce every day of the year — and had the paychecks to make that happen. No problem, right? The decline of American manufacturing meant that every major salad-buying city had a financially stressed, formerly industrial neighborhood that was looking to host a company that a) would bring jobs and b) wouldn’t be able to pull up stakes and leave as easily as manufacturing had.

Most farming was located way, way outside of cities for a reason. There were zoning restrictions. Urban areas had weird taxes that the country had never even heard of. One BrightFarms site, a park on the outskirts of Washington, D.C., had to be abandoned after a year and a half and $700,000 of planning when BrightFarms realized it was too polluted to clean up.

But indoor farming was on the upswing, for other companies as well as BrightFarms, which now has locations in Bucks County, Pa., Kansas City, Mo., and Rochelle, Ill. Today, every formerly industrial town has an indoor agriculture startup or three — there’s Urban Till (Chicago), AeroFarms (Newark), Koppert Cress (Cutchoge, N.Y.), and RecoveryPark Farms (Detroit), to name a few. The desert nation of Qatar recently announced that with the help of a hydroponics venture named Zulal Oasis, it would be growing 70 percent of its food indoors, within the country’s borders, in less than a decade.

Five years ago, says Kopf, “the industry wasn’t as sexy as it is now.” She spent her four years at BrightFarms wrangling real estate and government regulations — working on local zoning and tax exemptions, trying to get some love for indoor farming and non-commodity crops into the farm bill, and generally working against the tide of decades of agricultural policy: “Our country is built on commodity crops,” she says, “It heavily incentivizes production of crops that aren’t used to feed humans.”

Kopf also noticed something else. She couldn’t understand why BrightFarms and other farms like it were so operationally inefficient, considering the technology that she knew was available. Readouts from high-tech sensors were taken down by hand, written into notebooks and rarely looked at again. Problems, when they developed, were farmed out to consultants. There were only a few types of sensors used in the greenhouse industry, and while it wouldn’t exactly be a walk in the park to develop software that could pull data from them all and analyze it in a centralized location, Kopf knew that it could be done. The recent surge of research into the “internet of things” also made things possible that had been impossible a decade ago.

Hell, she didn’t have to stop with sensors. Energy bills for greenhouses ran into the thousands of dollars — but what if they had access to software that helped them buy electricity at off-peak hours, when it was cheaper? What if everything — the fans, the vents, lighting or shade, the water — could be crunched together with the data from the networked sensors, and then controlled and monitored from a central location? What if the data, anonymously aggregated, could be used to design new greenhouses?

Kopf went to Lightfoot, and told him that she was leaving to start a greenhouse software company — or, as she put it, “Hey. I’m going to do this. You should be our first customer.” She found a programmer and cofounder, a Google engineer named Jason Camp, through a family friend. Agrilyst launched in spring of 2015. By autumn of 2015, the duo had beat out 1,000 other companies and were standing onstage as one of 25 finalists at the TechCrunch Disrupt startup competition in San Francisco. Much to their surprise, they won.

Agrilyst had built the kind of highly specialized, industry-specific software that Kopf did not expect the tech community to get excited about. But unlike a lot of startups, they were generating revenue already — they already had six commercial greenhouses as beta customers that were paying $1,000 a month per acre for the software. Also: While they were not the only ag-related startup to make it to the top 25, the two others were both specific to pot, a much more high-margin form of agriculture (Agrilyst is happy to work with pot operations, but doesn’t specifically cater to them). And there was an urgency to Kopf’s pitch that stood out — particularly when she mentioned a statistic taken from the Food & Agriculture Organization at the U.N., about how we need to increase food production 70 percent by 2050 to feed all the people who are already here, and all the new people being born.

Which is true. The world’s population hit 7 billion in 2011. Odds are good that we’ll arrive at 8 billion around 2024. But ending hunger is about more than just growing more food: It’s also about distributing the food we already grow more fairly, eating lower on the food chain, and cutting down on food that is spoiled or wasted. Each of these could have just as much of an effect as boosting production.

It’s also doubtful whether indoor agriculture can ever be more energy-efficient than just regular farming – even if renewable energy is involved. Farming is already fuel-intensive, but as my colleague Nathanael Johnson put it last year, writing about the Aerofarms startup in Newark:

Indoor farms have some major inefficiencies, too. Instead of using sunlight and rain, they have to use electricity to power LEDs and water pumps. Instead of simply cultivating a field, they require a huge up-front investment in machinery. Indoor farms are exciting, because they are a radical departure from traditional techniques, but that also makes them risky. The innovators are trying to improve an age-old process by replacing a free, naturally occurring system with a mechanical one — it’s like trying to improve humans by building synthetic hearts.

It’s also worth pointing out that, while this urban ag boom has good intentions, and often involves some donation of produce to the local community, it is not so much about feeding the world as it is about bringing salad to people who feel that they deserve it in the dead of winter, but feel guilty about having it trucked to them all the way from California.

I say this with the utmost lack of judgment, as someone who, while Superstorm Nemo bore down on Boston, walked home from the market guiltily cradling a bag of arugula. I know that my ancestors lived all winter on turnips and potatoes (and, let’s be honest, probably booze). They survived. I would survive, too. I would probably be so desperate for salad by the end of winter that I would risk my own baby for it, like the parents in Rapunzel. But then, as Joseph Campbell pointed out, fairytales have some truth to them.

Even if Agrilyst — or a company like it — revolutionizes the world of indoor farming, it is not going to end world hunger, except in extremely inhospitable places where outdoor agriculture is simply impossible. It is possible that it could elevate salad production to a new level of factory farm efficiency, in much the same way that moving chickens indoors and putting them under 15 hours of light every single day makes them lay a hell of a lot more eggs.

But still, even in a best-case scenario, it could take more energy to grow a plant indoors at the temperature that it likes than just to grow it in a more hospitable climate and ship the result cross country. (Or just to change our eating habits altogether.) Like desalination plants or snow-making operations, indoor farming is all about mechanizing a formerly natural process to mitigate the effects of climate change, instead of going after the causes.

For all my reservations about it, indoor agriculture is — as Johnson put it — exciting. The science is interesting. Last I checked, we used a lot of energy to make a lot of things I think are a big waste of carbon, like fancy sweatpants, frozen waffles, and the upcoming Batman vs. Superman: Dawn of Justice. America is going to blow its collective electrons, unabashedly, on all of these things; why not blow them on a salad?

In Europe, some indoor farming operations have figured out how to make use of the waste energy produced by other factory operations. The largest tomato greenhouse in England, for example, uses both heat and CO2 from a nearby sugar refinery that would otherwise dissipate into the air.

So, sure, a massive shift to indoor farming from the great outdoors is unlikely to make the ag industry less carbon-intensive, and might even make it more so. But taking our existing greenhouse industry and making it more efficient? That’s legitimately worth getting excited about.