I was looking at Europe in regard to Portugal.
The nearest it came to real troubles post-Napoleon was when the Allies wanted the Azores as base for the 2nd Battle of the Atlantic.
In case of Portugal, a minimum amount of deterrence (merely enough military to be acknowledged as a sovereign nation) did work.

Colonialism in itself was always a failure that did not benefit more than a tiny share of the population. The only European overseas adventures that really paid off were discoveries (which brought the potato to the Old World, for example) and trade outposts.
Even the great Spanish booty of gold and silver in the 16th century did no more than to cause inflation and neglect of domestic economy for domestic needs.