Police said no one was hurt, but one TV station and some witnesses said a soldier was lightly injured by flying glass.
The small bomb exploded at about 2am (0000GMT) on a perimeter wall of the Fakhreddine army barracks in the city’s Ramlet el-Baida neighbouhood, police said.
Several hours earlier, a newspaper alerted authorities after its offices received a telephoned threat about an explosion targeting a military installation.
Th explosion caused cracks in the wall and shattered several windows.
Ambulances and fire engines rushed to the scene while police and army units sealed off the area and began an investigation.
Lebanon has suffered 14 explosions in the past year, the worst being the 14 February 2005 blast that killed Rafiq al-Hariri, former prime minister, and 20 other people.
The last major explosion was a car bombing on 12 December in a Beirut suburb that killed anti-Syrian newspaper editor and legislator Gibran Tueni.