With Drupal Console

1
drupal site:mode dev

This creates/modifies sites/default/services.yml file so you might have to change the folder sites/default or the file services.yml permissions.

Manually

You can also do it manually:

1
cp sites/example.settings.local.php sites/default/settings.local.php

in sites/default/settings.local.php uncomment these lines:

1
2
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';

In sites/default/settings.php uncomment these lines:

1
2
3
if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

In sites/development.services.yml add these lines:

1
2
3
4
5
parameters:
  twig.config:
    debug: true
    auto_reload: true
    cache: false