Cannot write into config directory error after moving from DDNS to A record

I installed nextcloud correctly and had it up and running with the following config.php file:

<?php $CONFIG = array ( 'htaccess.RewriteBase' => '/', 'memcache.local' => '\\OC\\Memcache\\APCu', 'apps_paths' => array ( 0 => array ( 'path' => '/var/www/html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), 'upgrade.disable-web' => true, 'instanceid' => 'ocv1a8gn1chr', 'passwordsalt' => 'h2vRFLDtPCC/JQtNngFf5U7z1/DWFf', 'secret' => 'FB02Cqc2NBC51R6DXWjkfgdagHtUrhlGMDL1ZyU+NmiSjj6O', 'trusted_domains' => array ( 0 => 'kumo9.asuscomm.com', ), 'datadirectory' => '/var/www/html/data', 'dbtype' => 'mysql', 'version' => '31.0.0.18', 'overwrite.cli.url' => 'http://kumo9.asuscomm.com', 'dbname' => 'nextcloud', 'dbhost' => 'nextcloud-db', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud_user', 'dbpassword' => 'nextcloud_pass', 'installed' => true, 'twofactor_enforced' => 'true', 'twofactor_enforced_groups' => array ( 0 => 'admin', ), 'twofactor_enforced_excluded_groups' => array ( ), ); I then decided to change from using my home router's DDNS (kumo9.asuscomm.com) to an A record that points from my domain registrar to my router. I created a backup of the original config (config.php.bak) Here is the updated config.php file with the changes I made for cloud.kumo9.net: <?php $CONFIG = array ( 'htaccess.RewriteBase' => '/', 'memcache.local' => '\\OC\\Memcache\\APCu', 'apps_paths' => array ( 0 => array ( 'path' => '/var/www/html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), 'upgrade.disable-web' => true, 'instanceid' => 'ocv1a8gn1chr', 'passwordsalt' => 'h2vRFLDtPCC/JQtNngFf5U7z1/DWFf', 'secret' => 'FB02Cqc2NBC51R6DXWjkfgdagHtUrhlGMDL1ZyU+NmiSjj6O', 'trusted_domains' => array ( 0 => 'cloud.kumo9.net', ), 'datadirectory' => '/var/www/html/data', 'dbtype' => 'mysql', 'version' => '31.0.0.18', 'overwrite.cli.url' => 'http://cloud.kumo9.net', 'dbname' => 'nextcloud', 'dbhost' => 'nextcloud-db', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud_user', 'dbpassword' => 'nextcloud_pass', 'installed' => true, 'twofactor_enforced' => 'true', 'twofactor_enforced_groups' => array ( 0 => 'admin', ), 'twofactor_enforced_excluded_groups' => array ( ), ); I applied these changes and restarted the nextcloud container. I'm still able to reach the nextcloud container from the web but I'm presented with the error: "Cannot write into "config" directory" If you need to make a change such as this, what is the correct procedure to accomplish this? I must be missing something. If anyone has the time to take a peek, I'd much appreciate the time and effort. Thanks guys!

I was able to fix the issue by changing the permissions for the config directory from root to ‘www-data’.