The ban extends to people who have been in South Africa, Botswana, Namibia, Zimbabwe, Lesotho, Mozambique, Eswatini or Nigeria in the past 14 days.
Delegates attending G20 meetings, which Indonesia chairs, will not be affected.
The restriction takes effect on Monday and will be evaluated every two weeks, senior ministers told a news conference.
"Omicron has spread to more countries, so to respond to these developments, today the government wants to carry out the following policies," coordinating minister Luhut Pandjaitan said.
Indonesian citizens entering Indonesia from the listed African countries and Hong Kong will also now have to quarantine in designated facilities for 14 days, Luhut said.
All other travellers entering the country will have to quarantine for seven days compared to three days previously, he added.
The variant - identified first in South Africa, but also detected in Europe and Asia - is potentially more contagious than previous variants, although experts do not know yet if it will cause more or less severe COVID-19 compared to other strains.