Auto enable/install plugin through config
The short answer is no. The long answer is sortof, if you’re running Craft 3.

Since plugins are technically modules in Craft 3, you should be able to bootstrap a plugin onto the application just like any other module.

To do that, update config/app.php with these modules and bootstrap sub-arrays:



return [
    'modules' =&gt; [
        'contact-form' =&gt; function() {
            $plugin = Craft::$app-&gt;plugins-&gt;createPlugin('contact-form');
            $plugin-&gt;setSettings([
                'toEmail' =&gt; 'foo@bar.baz',
            ]);
            return $plugin;
        }
    ],

    'bootstrap' =&gt; [
        'contact-form',
    ],
];


Using Contact Form as an example. For a different plugin, replace all of the 'contact-form' strings with the right plugin handle, and change the settings array to whatever the plugin is expecting. (You can find which settings keys the plugin supports by checking its Settings model – usually either src/Settings.php or src/models/Settings.php.)

Some caveats off the top of my head, though:


Craft won’t know that the plugin is installed, so it will still look like an uninstalled plugin in Settings → Plugins.
You won’t be able to edit the plugin’s settings in the Control Panel; only from config/app.php.
You won’t be able to update the plugin from the Control Panel; only via composer update.
If the plugin has an install migration, you will need to manually duplicate it as content migrations. And whenever you update the plugin, you’ll need to check if it added any new migrations, and manually duplicate those as content migrations as well. (Any migrations that were there at the time you first installed the plugin, besides the Install migration, can be ignored.)


EDIT

If you just want to be able to install a plugin programmatically, but don’t mind if the plugin ends up getting a row in the plugins DB table, that’s easy. Just create a new content migration, with the following safeUp() function:

public function safeUp()
{
    Craft::$app-&gt;plugins-&gt;installPlugin('plugin-handle');
}


Then you just need to run the migration on each of your environments. You can either do that from Utilities → Migrations in the Control Panel, or by running the following CLI command:

./craft migrate/up


Maybe worth noting that you can also install plugins directly from the terminal, using this command:

./craft install/plugin &lt;plugin-handle&gt;