President Obama ordered federal agencies Thursday to more than double their use of electricity produced by renewable resources, a directive that requires them to make solar, wind and hydro power 20 percent of the government’s energy portfolio by 2020.

Federal facilities can install renewable energy projects or purchase electricity from them, according to Obama’s presidential memorandum , which is much tougher than a 2005 congressional directive for agencies to use renewable energy for 7.5 percent of their electricity needs by 2013. A White House spokeswoman said the government is on track to meet that goal.

“The federal government must lead by example” in fighting climate change and transitioning to a clean-energy economy, Obama wrote.

The administration is committed to reducing greenhouse-gas emissions by 17 percent over 2005 levels by 2020 to combat climate change. Power plants are the leading contributor of heat-trapping gases such as carbon dioxide.

Environmental groups cheered the decision. “Safe, clean energy sources like wind and solar are already providing millions of jobs and powering millions of American homes and businesses,” Sierra Club Executive Director Michael Brune said in a statement. “They also have the potential to power 100 percent of our economy.”

Laura Sheehan, senior vice president of communications for the American Coalition for Clean Coal Electricity, said the target might be reachable using “the virtually limitless funds” of the federal government but would be too expensive for the rest of the country.

“We support an ‘all of the above’ energy portfolio that makes sense, but shoe-horning renewable technologies that cannot deliver the baseload electricity this country needs does no one any good and puts the American economy at risk, ” she said in a statement.

Obama noted in his order that federal agencies have reduced their annual greenhouse-gas emissions by 15 percent during his administration, the equivalent of removing 1.5 million cars from the road.

Some large federal facilities already have made the move to renewables. The 44-building Denver Federal Center in Lakewood, Colo., for instance, has built a solar park that provides about 1.6 million kilowatt hours of energy each year, the White House said.