The 80-metre wind turbines churning the skies above Guantánamo Bay are visible from the air long before touchdown on this US-controlled tip of Cuba. Navy press releases went out when the four towers were erected, hailing them as a symbol of its great green ambition.

But on a visit to Guantánamo Bay, undertaken with the permission of the US navy and under the constant supervision of an official escort, we were detained by soldiers guarding the prison camp just for trying to find a good angle for photographing the structures.

Unlike the 171 men still being held at the notorious prison, we, two reporters and our escort, were detained for just 30 minutes. But the experience offered a useful lesson in how a relic of the war on terror is getting in the way of the Pentagon's efforts to transform America's military.

When green meets Gitmo – the offshore prison camp – sensitive issues surrounding the high-security facility tend to win out. The prison camp is one of the biggest consumers of electricity and water on the base – and it is also one of the last in line to go green.

The navy is looking to halve its use of fossil fuels, on ship and on shore, by 2020, and to take up to half of its 100 or so bases completely off the grid, requiring them to make all their own power from wind turbines, solar arrays, or locally grown algae.

"We've been running full out on this. The other services are all doing interesting and exciting things, but I would say that I think we got a head start on them," said Jackalyne Pfannenstiel, assistant secretary of the navy for energy.

There is probably no other installation in the world where this makes as much economic sense as in Guantánamo.

Because of its location as a hostile outpost on the south-east tip of Cuba, the base is forced to import all of its equipment on barges from Florida. Unlike bases on friendly terrain, Guantánamo cannot just hook up to the grid. It has to bring in all of its power, as diesel. It also has to make all of its own fresh water, after the supply lines from Cuba were cut in the mid-1960s, from a desalination plant drawing from the bay. All of this is expensive.

The navy spends about $100,000 (£65,000) a day on diesel to run the generators that supply power to Guantánamo. Each unit of electricity costs four times as much as it would back in the US, which gives the navy even more incentive to save on energy.

The base has ambitions to be ahead of the average small American town on energy efficiency, as well as other navy bases "I would say they are doing very well," said Pfannenstiel.

Guantánamo's commander, Captain Kirk Hibbert, insists that Guantánamo can cut its use of diesel in half. "I absolutely believe we can get down to the secretary's requirement," he said.

Work crews are completing the installation of the base's first solar array, which will generate power for the base's new gym, and possibly feed into the electrical grid.

There are discussions about adding two bigger solar arrays, of 4MW and 7MW and Pfannenstiel said Guantánamo would be a good test base for new technologies that would generate power from its 27-acre landfill site. And there are email conversations about a Nasa proposal to grow a floating field of algae in a membrane bag on waste discharged into Guantánamo Bay.

The base is in the process of swapping old diesel generators for more efficient models at its power station, and upgrading to more efficient equipment at the desalination plant. It has started installing smart meters in 150 buildings.

The base is also replacing the old-fashioned floodlights along the 17.5-mile Cactus Curtain, the line separating the base from Cuban territory, with solar-powered LED lights.

Last July, the base began converting its service fleet to vehicles powered by electricity and solar panels mounted on the roof.

Guantánamo is also trying to alter human behaviour towards energy use, installing smart meters and sending out the first mock electricity bills to navy personnel in order to get them to think about their electricity use.

The exercise, which began in October, has produced some uncomfortable revelations, said Ambroshia Jefferson-Smith, who works in the navy HR department on the base.

Her bill for the single-storey ranch-style house she shares with her 15-year-old son was $1,021.79 – about seven times as much as she would pay back home in Mississippi. Even more galling, the accompanying printout unfavourably compared her consumption to that of more energy-efficient neighbours.

"When you see the numbers, oh my god, that feeling you get in the pit of your stomach," she said. "It's like coming home when you have been on holiday and getting that big credit card bill. You don't see anything tangible there, and you realise you have consumed a lot of electricity and water."

Jefferson-Smith decided it was time to make sure all five of her televisions were switched off before she left the house, and to turn down the air conditioning every morning before she left for work.

Other changes are afoot. The base got its first two-man team of bicycle-riding traffic cops in February 2011, the first such patrols in the navy. "I don't necessarily think I need to see an MAA [master-at-arms] sitting in a vehicle at an intersection with the air conditioner running waiting for someone to run a red light," said Hibbert.

However, not all of the experiments have worked. A local initiative to produce fuel from used cooking oil, with residents encouraged to put their used vegetable oil out for kerbside collection, was abandoned after a few years, as a fire hazard.

The wind turbines were supposed to supply about a quarter of the electricity needed at Guantánamo. But the turbines' performance failed to live up to projections, partly because the base population has expanded.

On a good day, the turbines only provide about 5% of Guantánamo's power, even though they save the base $2m a year.

Unfortunately, there is no escaping the limits set by the prison camp on how green Guantánamo can go.

The detention centre, with a known prisoner population of 171, most of whom are housed in the complex of single occupancy cells of Camp 6, consumes 28% of Guantánamo Bay's electricity, according to figures supplied by the US navy.

The base has a population of 5,700 including troops, civilian employees, contractors and their families, and the guards of the joint task force.

That does not include Camp Justice, the war court built on an abandoned airstrip and the 100 or so tents for observers and journalists that now sit unused – even though the air-conditioning is left on.

The prison camp also uses about a third of the 1m US gallons a day of water consumed at Guantánamo each day.

And yet the prison camp is largely off limits so far as the new green regime goes.

Because of security considerations, an energy audit underway at the base did not extend to the detention centre, said Arthur Torley, who oversees facilities on the base.

Representatives from the joint task force overseeing the meeting come to base energy meetings, but they have yet to sign on to energy-saving measures such as solar-powered security lights.

And according to Torley, it will be near impossible for Guantánamo to close in on its goal of cutting oil use in half – unless the prison camp does its share. The most he could hope for was cutting Guantánamo's use of oil by about a third and that still falls short of the navy target.

"With the technology coming I think we can do that," Torley said. But he added it remained up to the prison: "I don't think we can reach that without them coming aboard," he said.