Cocoa futures also climbed.
The Thomson Reuters-Jefferies CRB index, a global benchmark for commodities made up of 19 markets, inched up from Thursday's seven-week low as oil rose on signs that business morale in Germany was improving. Major stock markets also climbed.
Arabica coffee futures trading on ICE Futures US rose for the third straight day, after hitting their lowest level in more than 2-1/2 years earlier this week, at $1.3760 per lb. Dealers said the long-term downtrend in arabica coffee prices remained intact as the market continues to struggle to absorb excess supply.
A six-hour strike by port workers in the world's biggest producer of coffee and sugar spurred short-covering, helping to lift the markets, dealers said.
The strike was called to protest a Brazilian government plan to overhaul regulations and put more than 150 terminals in the hands of the private sector.
Brazilian port unions called off a plan to hold a six-hour strike next Tuesday after meeting with officials to discuss the government's plans, the port minister said on Friday.
"If I were caught short in these markets, my inclination would be, with potential labor unrest, coming into a weekend, paring their short positions is very much a viable option," said Sterling Smith, futures specialist for Citigroup in Chicago.
Speculators are heavily short both markets, while both face plentiful supplies, a bearish factor.
May arabica coffee futures on ICE rose 2.05 cents, or 1.4 percent, to settle at $1.4380 per lb.
"We remain below all the medium- to longer-term moving averages, and the volume and open interest (trends) are confirming the (downward) move, so I would expect the consolidation to be temporary," said Sucden Finiancial analyst Jack Pollard.
Retail coffee prices have fallen recently, although the decline has been much more modest than the downtrend that began in May 2011. Major US roaster Kraft Foods Group Inc followed the maker of Folgers coffee on Thursday and cut the price of its flagship coffee brand Maxwell House.
Robusta coffee futures on Liffe also rose, boosted by strong demand, with May closing up $18, or 0.9 percent, at $2,087 a tonne.
Robustas from top producer Vietnam changed hands at smaller discounts to London futures this week on rising demand from trading houses, while strong demand from local roasters put a premium on prices in Indonesia, dealers said.
Certified coffee stocks held in NYSE Liffe nominated warehouses rose to 113,090 tonnes as of Feb. 18 from 102,410 tonnes on Feb. 4, exchange data showed.
EXCESS SUGAR
Raw sugar futures on ICE were also higher, but remained in a long-term downtrend as excess supplies continued to cap rallies.
March raw sugar futures on ICE closed 0.12 cent higher, or 0.7 percent, at 18.24 cents per lb. The contract fell to 17.87 cents last week, the lowest level for the front month since August 2010.
"The only thing that can drive prices higher from here would be maybe macro sentiment. We are not expecting this to come from fundamentals," said Andrey Kryuchenkov, analyst at VTB Capital.
May white sugar on Liffe rose $7.50, or 1.5 percent, to end at $505.50 a tonne.
Cocoa futures on ICE were higher, with May settling up $6 at $2,139 a tonne, while May cocoa futures on Liffe ended 6 pounds higher at 1,434 pounds a tonne.
Dealers said forward selling, particularly by Ghana, was preventing stronger gains. Valid cocoa stocks in NYSE Liffe's nominated warehouses rose to 57,250 tonnes at Feb. 18 from 42,920 tonnes on Feb. 4, exchange data showed.