He said the UK government would make a recommendation to the British people on which way to vote in the referendum.
But he told MPs "it will be open to individual ministers to take a different, personal decision while remaining part of the government".
The referendum on whether the UK stays in the EU will be held before 2018.
A number of cabinet ministers are thought to favour an out vote, with Mr Cameron expected to campaign for Britain to remain in the EU, although he has said he rules nothing out if he does not get what he wants from his renegotiations.
If the PM had decided to insist on collective cabinet responsibility, he would have been forced to sack ministers who disagreed with him.
Mr Cameron told MPs: "Ultimately, it will be for the British people to decide this country's future by voting In or Out of a reformed European Union in the referendum that only we promised and that only a Conservative-majority government was able to deliver."
Asked by Labour MP Emma Reynolds why it was not possible for him to persuade his own ministers to back him, he said: "The entire government is signed up to the position of having a successful renegotiation and having a referendum and everybody backs that plan."
But he added: "There are people who have longstanding views about the European issue and... it's never been my intention to strongarm people into voting for a position that they don't agree with".
Analysis by the BBC's political editor Laura Kuenssberg
Much of the running here, and perhaps all along, has been made by Eurosceptics in the Conservative Party.
In the words of one minister "they are framing it all", and David Cameron's reversal of his position from 12 months ago when he ruled out a free vote has been forced by pressure from those who want to leave the EU.
Read Laura's full blog
"We don't yet know what the government's recommendation will be - we don't know when the deal will be done. I hope February but it could take considerably longer."
Labour leader Jeremy Corbyn said Mr Cameron had "never wanted to hold" a referendum and other European leaders could see that his negotiating demands were "a bluff, a fig leaf for Conservative Party politics".
The SNP's leader at Westminster, Angus Robertson, demanded a guarantee that the people of Scotland would not be "taken out of the EU against their will".
Mr Cameron said Scotland had voted to remain part of the UK.
Former Chancellor and veteran Europhile Ken Clarke told BBC Radio 4's The World at One Mr Cameron had been forced into a "most unfortunate" decision and any ministers that disagreed with the PM's position should resign and argue for withdrawal from the backbenches.
Former deputy PM Lord Heseltine - who last month warned of a Tory "civil war" if ministers were allowed to openly defy the prime minister and suggested Mr Cameron would be seen as a global "laughing stock" if he allowed it - declined to comment on the PM's decision.
But the move was welcomed by those campaigning to get Britain out of the EU.
Matthew Elliott, chief executive of Vote Leave, said: "The referendum could be as little as 170 days away, so ministers should be allowed to campaign openly as soon as the renegotiation is complete - and certainly no later than the end of the European Council in February.
"The British people deserve to hear where their elected representatives stand on this vitally important issue. We've had lots of useful meetings with government ministers and look forward to working with them much more closely now."
Brian Monteith, of Leave.EU, said: "We welcome the news that ministers will be allowed to campaign with their conscience in the referendum.
"However, this is not about them. It will be ordinary people such as nurses, taxi drivers and small business owners that need to have their voices heard in this debate."
UKIP leader Nigel Farage said the PM's decision was a short term solution to "hold together" the Conservative Party but as the referendum approached cabinet differences could become "irreconcilable."
He said David Cameron would be "surprised" at the number of Conservatives who will campaign with UKIP to leave the EU.
Will Straw, executive director of Britain Stronger In Europe, said: "We are confident that after the prime minister's successful renegotiation, the majority of Conservative ministers will continue to make the case that the benefits of being inside Europe... clearly outweigh the costs."
Alan Johnson, who chairs the Labour In For Britain campaign, said: "While the Tories are divided on Europe, Labour is clear that Britain's national interest is best served by campaigning for Britain to stay in the EU."
Liberal Democrat leader Tim Farron, who is campaigning for Britain to stay in the EU, accused Mr Cameron of "putting his own internal party strife above what's best for Britain".
"The government should take a collective position on this issue, and if ministers disagree with the prime minister they should resign."
Speaking before news of Mr Cameron's decision emerged, London Mayor Boris Johnson told LBC radio: "I think we've got to be prepared to walk away, but at the moment I am backing the prime minister to get a great deal for this country and for Europe."
He rejected the idea that Mr Cameron would have to stand down as prime minister if he lost the referendum and denied Tory MPs were at war over Europe.
"We're not. Glutinous harmony prevails. We are backing David Cameron. I think he's doing a brilliant job," he added.
Q&A: What Britain wants from Europe
Guide to the UK's planned in-out EU referendum
BBC News EU referendum special report
David Cameron is to allow ministers to campaign for either side in the referendum once a deal is reached on the UK's relationship with the EU.