Use of the country's lese-majeste law has surged under the royalist junta that took power in a 2014 coup d'etat, with more than 100 people charged since the coup, according to legal monitoring group iLaw.
Tara, 61, whose last name was withheld by his lawyer, was arrested in 2015 for sharing online materials allegedly insulting to the monarchy.
He was charged with royal defamation and computer crime.
A Bangkok military court sentenced Tara to 18 years in jail for violating Article 112 of Thailand's criminal code, which says anyone who "defames, insults or threatens the king, the queen, the heir-apparent or the regent" will be punished with up to 15 years in prison, and the country's computer crime.
"He accepted the charge against him and has been in custody since 2015 so the court sentenced him to 20 years in prison, minus two years," Yaowalak Anuphan, head of the Thai Lawyers for Human Rights Centre and Tara's lawyer, told Reuters.
Tara cannot appeal his sentence, she said, because he was arrested while Thailand was under martial law.
Rights groups have accused the authorities in Thailand of intimidating critics through censorship and lawsuits.
The military government denies this and has said it acts to protect national security.
Last week Pravit Rojanaphruk, an award-winning Thai journalist, was accused of sedition over online comments critical of the junta.
He told Reuters that the charge created a "chilling effect" amid an ongoing government crackdown on critics.
Pravit was charged by police on Tuesday for posting comments on his Facebook page criticising military rule and the junta's slow response to flooding in the country.
"The Thai junta's dictatorial reach has expanded well beyond traditional sources to social media like Facebook," Brad Adams, Asia director at Human Rights Watch, said in a statement on Wednesday.
"These dubious charges for peaceful Facebook commentary should be dropped immediately," he said, referring to the charges against Pravit and two former government ministers who were charged last week with sedition and computer crime.
Strict lese-majeste laws protecting members of the royal family from insult limit what all news organisations, including Reuters, can report from Thailand.