How do I change the initial quantity of a product in woocommerce?

You can use the woocommerce_quantity_input_args filter:

function wpse_292293_quantity_input_default( $args, $product ) {
    $args['input_value'] = 2;

    return $args;
}
add_filter( 'woocommerce_quantity_input_args', 'wpse_292293_quantity_input_default', 10, 2 );

When the quantity input is output, it’s output with the woocommerce_quantity_input() function. This function accepts several arguments including the default value for the input. This filter lets you replace values in the arguments across all uses of the function.