The 44-year-old man was found guilty of kidnapping and extortion charges over the May 2010 attack off Oman on the chemical tanker Marida Marguerite which had 22 crew aboard.
The hostages were only released in December of that year after a $5 million (€3.6million) ransom was paid by the German shipping company that owns the Marshall Islands-flagged vessel.
The pirate commander was arrested in May 2013 when he applied for refugee status in Germany, using false papers. He was identified by his fingerprints, and later by witnesses flown in by the court from India.
The man, who was not named, has one week to appeal the sentence, which was short of the maximum 15-year-term, but more than the seven years demanded by
During the hostage ordeal, the mostly Indian crew suffered "cruel treatment, torture and mock executions," said a statement by the court in northwestern city of Osnabrück.
The captain was threatened with a bullet fired next to his head, the chief engineer was handcuffed and suspended by a pipe, and some crew had their genitals tied with cable binders, the court said.
Prosecutors could not prove that the defendant was head of the entire operation, but they were able to convince the court that he had at least tolerated the torture of the hostages.
He had also guarded the captives with an automatic rifle, made key decisions on board, including on sharing the ransom, and was one of the last pirates to leave the ship, the court said.
The trial was only Germany's second against Somali pirates. A Hamburg court in October 2012 jailed 10 pirates who had hijacked a freighter to terms of between two and seven years jail.
After a spike of pirate attacks at the start of the last decade, cases have diminished off the Horn of Africa, deterred by an international deployment of warships to patrol the coast.
The number of pirate attacks, according to the EU Naval Force Somalia, fell from a peak of 176 in 2011 to seven in 2013. This year there have so far been two attacks, and a vessel with 50 hostages remains in pirate hands.