We all know that we should be including as many fresh vegetables as possible in our diets, but the fact is that the energy and environmental costs of growing and then transporting vegetables from the farm to the supermarket can stack up pretty high.

Now one German company has come up with an interesting way of tackling the problem, designing miniature farm units that are so small and self-contained, they can be installed at the end of a conventional supermarket aisle.

Kräutergarten, meaning "herb garden", is the brainchild of vertical farming startup Infarm, which is rolling out these mini farms as part of an experimental pilot with Metro Group, a German retail chain.

"Pretty much any type of greenhouse needs scale to be economic and efficient," Infarm co-founder Guy Galonska told Adele Peters at Fast Company. "In our case, the technology we developed is kind of a building-block approach, and this building block reaches efficiencies that are much higher… It works at a very small scale, just a few square metres. So it makes a lot of sense in your neighbourhood supermarket scale."

Like other vertical farm approaches we've seen in the US and the UK, Infarm's systems take advantage of things like year-round production, low water usage, and pesticide-free techniques to deliver a low-cost, low-impact means of farming greens.

In the modular, configurable units, greens and herbs literally grow in one spot until they're ready for picking. Unlike other greenhouse systems, seedlings and more mature plants aren't moved around at all, meaning the boxes need to make clever use of every available millimetre of space inside.

Right now, only one of these farms is operating in a special supermarket designed for chefs and wholesale customers, but the company intends to begin mass-manufacturing units for mainstream outlets before the end of the year. Aside from the energy savings and environmental benefits of cutting out veggie transport from farms to where they're sold, Infarm says it also makes for a revitalised way of looking at the food you buy.

"We got many interesting responses from chefs who saw vegetables they know – because they use them every day – but they'd never seen the plants at 15 days old," says Galonska. "It really engages people. You're used to having kind of a boring experience in the grocery store. You come and get your things. Here you see a farm – it's a piece of farm in the supermarket."

The pilot unit is focusing on herbs and specialty greens including mizuna and wasabi mustard greens, but Infarm says the same boxes could easily grow produce such as eggplants, tomatoes, and chili peppers. In conjunction with an app that lets customers order the vegetables they want to buy, it's a pretty unique alternative to perusing the stock on offer down at your local grocer.

"We call this farming as a service," says Galonska. "It's similar to the software world… where we sell the technology at relatively low prices, and then provide all the supplies and additional services, like the software, for example."

Infarm hopes all kinds of supermarkets will look at installing the mini farms, and if the idea takes off, it could help transform the assumption that vertical farming and other approaches to urban agriculture aren't a robust alternative to today's high-yield but high-impact agricultural practices.

"[I]f you look forward five, 10 years from now, you see the rate of technology that is expanding, evolving. We definitely see how vertical farming can supply many other things such as rice, soybeans, certain types of fruits," says Galonska. "Will it replace completely all traditional agriculture? It will take some time. But Mars, for example, will be vertical farming only."