In a televised address, Keita said the government will enforce a curfew between 21:00 to 05:00, from Thursday, and close land borders in response to the virus.
Freight will still be allowed into the West African state, he said, and markets will remain open.
Earlier on Wednesday, Malian authorities recorded the country's first coronavirus infections, in two nationals who had recently arrived from France.
Experts fear the country is particularly exposed to an outbreak because of its jihadist conflict, which first broke out in the north in 2012 and has since engulfed the centre.
Thousands of soldiers and civilians have died in the conflict, and swathes of Mali's territory remain outside state control.
Despite the coronavirus risk, Keita said that a long-delayed parliamentary election -- whose first round is planned for Sunday -- will go ahead, although in "scrupulous respect" of health measures.
"The government will do everything in its power to ensure that this is so," he said.
Holding parliamentary elections was a key recommendation from crisis talks in December, which aimed at exploring non-military solutions to the country's worsening violence.
Mali's current crop of MPs was elected in 2013, in a ballot won by Keita's Rally for Mali party.
Parliamentary elections were meant to take place again in late 2018 following Keita's re-election.
But the poll was postponed several times, with the authorities citing a strike by judges or worsening security.