The order gave internet service providers until August 24 to comply.
Somalia’s government-led forces have captured an al Shabaab stronghold on the Indian Ocean coast.
President Hassan Sheikh Mohamud said on Sunday that the death toll could rise.
Al Shabaab seeks to overthrow the Western-backed central government and implement a strict interpretation of Islamic law.
The security source in the region said several follow-up operations were going on after al Qaeda-linked al Shabaab militants overran the camp the previous day.
Security experts say the move may worsen the crisis in Somalia