Born to an aristocratic family in Martignano in Salento, then part of the Kingdom of Naples. His father was Carlo Antonio Palmieri, 3rd marquess of Martignano. He studied in Lecce before moving to Naples where he embraced a military career in 1734. He rose to the position of lieutenant coronel. He fought the Austrians at Messina in 1734 and at the Battle of Velletri in 1744. While in Naples he also studied philosophy and economy under Antonio Genovesi, locally one of the most important interpreter of European Age of Enlightenment writers, while also learning Latin, French and German. In 1752 he was appointed lieutenant colonel. In 1761 he published his "Critical Reflexions on the Art of War", which gained him critical acclaim. The book was even praised by Frederick II, king of Prussia.