Egypt is hoping a new electronic ticketing system will help keep fans safe and prevent crowd trouble as security tightens ahead of the African Cup of Nations kick off on Friday.

Tickets have only been available for sale online and the buyer has to enter their national ID or passport number, a system that allows authorities to vet and track fans, as well as limiting black-market sales.

After the Nations Cup the system will also be rolled out for Egypt's domestic league, said Mohamed Fadl, the tournament's director.

In recent years, many Egyptian league games have been played behind closed doors or with restricted attendance after stadiums and supporters groups became flashpoints for violence and political dissent. There were dozens of deaths at stadiums in Port Said in 2012 and Cairo in 2015.

"The fan ID and the online ticketing are security measures," Fadl told Reuters. "It is to avoid the black market, to build a new system for Egyptians, to push the fans to return to the stadium."

The Nations Cup, expanded to 24 teams for the first time, will be played in Cairo, Alexandria, Suez and Ismailia.

Dozens of police officers and armoured vehicles were deployed around Cairo stadium this week, with strict security checks for people trying to enter.

Egypt slid into political turmoil after a 2011 uprising, and security forces have been battling an Islamist insurgency focused in the north of the Sinai Peninsula.

In recent months there have been several security incidents including two roadside blasts targeting tourists in Giza, across the Nile from central Cairo, but the country has not suffered large-scale attacks since late 2017.

Security in general is tight, following a far-reaching crackdown on political dissent under President Abdel Fattah al-Sisi.

"It is different I think," Fadl said, comparing the current situation to the years that followed the uprising.

"Security and surveillance cameras of the highest quality are all around the stadium."

Fadl said he was hoping for 90% attendance during the tournament. Egypt's three group games sold out after authorities reduced the price of the cheapest tickets to 150 Egyptian pounds ($9) from 200 pounds.

In a country where many ordinary people have been struggling with rising living costs, some say ticket prices are still too high.

One such fan, Ahmad Bayoumi, complained that the process for registering online was also tricky.

"It is really expensive and I really like watching (the matches) here at the cafe," he said. "The cafe has its own atmosphere."