Uganda was grouped with Namibia, Zambia and Ivory Coast when the 2018 African Nations Championship (CHAN) draw was made in Rabat Friday.
Uganda will be desperate to at least reach the quarter-finals after three first-round exits in a row, while the best showing from Zambia was third at the maiden tournament in 2009.
Ivory Coast came third last year behind champions the Democratic Republic of Congo and runners-up Mali.
Namibia are the other first-time participants after shocking Zimbabwe in a qualifier despite fielding a rusty squad because a power struggle cancelled domestic football.
Nigeria were grouped with former title-holders Libya, Rwanda and Equatorial Guinea.
The Nigerians are making a third consecutive appearance in the biennial tournament for home-based footballers, which Morocco will stage between January 12 and February 4.