Simplest way would be to use config.php for local, and use domain specific configs for live and staging remote servers. You don’t need copy the whole config into those domain based ones as they inherit config.php. Just add the specific parts you wish to change.
Are you using the built in php server (not recommended) or something like mamp or valet? Maybe you didnt set server to false as directed if you are not using the built in php server. basically for some reason, Kirby cannot tell it is running on localhost, so the config isnt getting used.