David Cameron has told ministers to treat each other "with appropriate respect and courtesy" if they are on opposing sides in the EU referendum.
The PM said the government had to remain a "a united, harmonious, mutually respectful team".
He has written to ministers setting out how rules allowing them to campaign for either side will apply.
The "wholly exceptional" arrangement will apply once his negotiations with other EU leaders are complete.
Mr Cameron hopes a deal will be reached at next month's EU summit, and the UK government will then make a recommendation to the British public on which way to vote.
The prime minister says he hopes this will be to remain in a reformed EU, but has consistently said he "rules nothing out" if his demands are refused.
Analysis by Laura Kuenssberg, BBC political editor
How do you stop a polite conversation about politics, even with your nearest and dearest, descending into a slanging match?
The only failsafe answer of course is not to talk about politics at all.
But it's a very real question that the prime minister faces right now. He says ministers who want to campaign to leave the EU will be able to do so in the runup to the vote.
But on this subject, that has so divided the Conservatives in the past, how can he stop what will be an energetic debate in the party doing lasting damage?
Mr Cameron has agreed to suspend the normal rules of collective responsibility, meaning ministers will be entitled to disagree with the government's stance on the issue.
A number of cabinet ministers are thought to favour an out vote.
In a letter to all ministers, the PM said the arrangement would only apply to the question of whether the UK remains in the EU, and that "all other EU or EU-related business" is still the subject of the normal rules, so everyone in government will have to agree.
The special rules will only apply once negotiations are complete - until then ministers should "say or do nothing that will undermine the government's negotiating position", the PM said.
Mr Cameron said the arrangement would apply to ministers who disagree with the government "because of long-standing and sincerely held beliefs".
Civil servants will be expected to back the government's position until the traditional "purdah" period applies, and special advisers will be entitled to support ministers opposing the government, "provided this does not draw on official or departmental resources" and takes place in their own time.
The prime minister told ministers they would still be responsible for governing the country and "serving the public who elected us", adding: "This can only be done effectively if we remain, despite differences on this one issue, a united, harmonious, mutually respectful team".