Directory listing is generated by Apache module mod_autoindex, to disable this module:
a2dismod autoindex -f
systemctl restart apache2
If you don’t have root access, another way to disable directory index in Apache is to simply create a blank index.php or index.html file inside the directory:
touch index.php
Or add the following in your .htaccess file:
Options -Indexes