As the jihadist group lost ground, he said, there were signs it was shifting to attacks abroad, the BBC has reported.
"The possibility of a lone actor or a small cell that kills people is real," he said, adding that networks in the U.S. could be activated.
Mr. Obama was giving an update to reporters after a Pentagon meeting.
Separately, he strongly denied that a $400 million (GBP 305 million) cash payment to Iran was a ransom for the release of American prisoners in January.
The White House provided extensive comments on the issue on Wednesday.
Speaking after the meeting with top military and national security officials on Thursday, Mr. Obama said IS was "not invincible".
"In fact, they are inevitably going to be defeated," the president said, predicting that the jihadist group would lose its self-proclaimed capital of Raqqa in Syria, in addition to their stronghold of Mosul in Iraq.
Read alsoISIS planning 'dirty bomb' terror attack on Rio Olympics – mediaMr. Obama also said that IS "has not had a major successful offensive operation in Syria or Iraq in a full year".
While the militant group has been pegged back in those countries, it has carried out or claimed several high-profile attacks this year, such as in Iraq, France, Germany, Bangladesh and several other countries.
President Obama said it was important not to give in to fear.
"Isil can't defeat the United States of America or our NATO partners," he said, using an alternative acronym for IS.
But he warned the U.S. could defeat itself if its leaders made "bad decisions" – like indiscriminately killing civilians or introducing religious tests on who could enter the country.
"Those kinds of strategies can end up backfiring because in order for us to ultimately win this fight we cannot frame this as a clash of civilizations between the West and Islam," he said.
"That plays exactly into the hands of Isil and the perverse interpretations of Islam that they are putting forward."
The U.S. recently stepped up its efforts against IS, bombing one of the group's strongholds in Libya on Monday after a request by the UN-backed government.
Western powers have become increasingly concerned at IS's growing presence in Libya.