When you use a development environment similar to the production, you can’t use the app_dev.php as given.

  • With vagrant your front IP could be
  • With docker you can define a front IP as

So open app_dev.php and change the following code

if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['', '::1', '', ''], true)
    || PHP_SAPI === 'cli-server')
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');

Keep in mind, always use private IP and don’t include this file during deployment to your production