Two of the civilians are Spaniards, according to the website of local newspaper A Semana.
The barracks housed soldiers protecting a hilltop communications hub and the civilians were working on repairs there, media reported.
The government placed security forces on red alert at the international airport in Praia, the capital, and at the island's ports after the apparent attack, the online service of Expresso das Ilhas said.
A policeman came across the bodies around midday, Cape Verde Television said. It said police later found an abandoned car containing eight Kalashnikovs and ammunition.
Also Read
Authorities in Cape Verde, which is classified as a developing nation, have received praise and financial aid from international bodies for their commitment to democracy and economic development.
However, the country has recently been fighting international drug rings attempting to smuggle cocaine into the country. Police last week seized 280 kilograms of cocaine from a yacht, and officials have linked two recent armed attacks against public figures to that battle.
A new government took office last Friday after winning a March election and vowed zero tolerance in the fight against crime.