France had already shut down restaurants and bars, closed schools and put ski resorts off limits, but Macron said measures unprecedented in peacetime were needed as the number of infected people doubled every three days and deaths spiralled higher.
In a sombre address to the nation, the president said that from Tuesday midday (1100 GMT) people should stay at home unless it was to buy groceries, travel to work, exercise or for medical care.
More on Covid-19
Anyone flouting the restrictions, in place for at least the next two weeks, would be punished.
Coronavirus pandemic: Complete coverage
“I know what I am asking of you is unprecedented but circumstances demand it,” Macron said.
“We’re not up against another army or another nation. But the enemy is right there: invisible, elusive, but it is making progress.”
Coronavirus pandemic: Latest updates
He said tougher action was needed after too many people ignored earlier warnings and mingled in parks and on street corners over the weekend, risking their own health and the wellbeing of others.
In France the coronavirus has killed 148 people and infected more than 6,600.
Under the new measures, soldiers would help transport the sick to hospitals with spare capacity and a military hospital with 30 intensive care beds would be set up in the eastern region of Alsace, where one of the largest infection clusters has broken out.
Macron said he was postponing the second round of local elections on Sunday. Because the government’s sole focus needed to be fighting the pandemic, he said he was suspending his reform agenda, starting with his overhaul of the pension system.
The government would, when necessary, legislate by decree to fight the coronavirus, he said.
Coronavirus infections and fatalities in France and Spain have been surging at a pace just days behind that of Italy, the epicentre of the outbreak in Europe where hospitals in the worst-hit northern regions are stretched to breaking point.
Seeking to offer further reassurance to businesses, Macron said the government would guarantee 300 billion euros worth of loans. The loan guarantee plan would be submitted to parliament in coming weeks and would be retroactive, a finance ministry source said.
Rent and utility bills owed by small companies would also be suspended to help them weather the economic storm, he added.
“No French company, whatever its size, will be exposed to the risk of collapse,” Macron said.