Those who violate the ban could face a fine of up to 15,000 kroner ($1,320) or, failing payment, 10 days in prison, prosecution authorities said.
Many Norwegians have in recent weeks fled to their country houses, often chalets in the mountains, in the hopes of escaping the virus thanks to their relative isolation. Some have defied authorities' recent appeals to return to their primary residences.
The government had for several days been threatening to introduce a ban if people did not heed authorities' calls, and finally made good on its threat on Thursday.
“It's a decision that, in the end, I had hoped we wouldn't have to take but we will ban stays outside (people's) residential municipality,” Health Minister Bent Hoie said.
Small rural communities “do not have, neither today nor in the weeks to come, the capacity to take care of chalet owners in addition to their own inhabitants,” he told reporters.
Some exceptions will be allowed, in particular for those in good health who have a sick family member who needs to self-isolate in their primary residence.
Norway said on Thursday it had detected 1,552 cases of the new coronavirus, and six deaths.