Full details of the deal, signed by Russia's Vladimir Putin and Indonesia's Joko Widodo, were not immediately available.
"We have agreed to widen contacts between defense ministries and security agencies," Putin said at joint briefing with Widodo.
Indonesia's president said Russia and Indonesia also agreed on exchanges of intelligence information.
Earlier on Wednesday, the head of Russia's arms export agency Alexander Fomin said that Russia would like to produce military munitions in Indonesia, including shells.
He added that Indonesia was interested in Russian submarines and jets, "however, Russia has rivals, such as United States and China".
On Tuesday, Kremlin aide Yuri Ushakov said Russia would sign deals with Indonesia to supply unspecified arms and for ammunition to be manufactured under licence.
Russia, the world's second-largest arms exporter after the United States, plans to sell arms worth $14 billion this year.
Russia's total portfolio of arms orders currently stands at more than $50 billion.