We don’t officially support that kind of a setup, however, you are free to try it out. But the latency between ERPNext and the Database itself would be a dealbreaker, because it would slow things down significantly.
@pdvyas wrote: There is site configuration option db_host (like db_username and db_password). Ideally, you would want the whole bench to use a common db host, so there’s a command bench set-mariadb-host that sets this value in common_site_config.json.
You can run bench set-mariadb-host after moving the database to another server and the system will use the new db host. Or you can skip bench setup in the installation script and run bench set-mariadb-host before you install the first site.
@zenny this actually could be a helpful step in docker-izing the bench. Seems like a nice low-hanging-fruit to just set the host to another docker container. I guess it isn’t a different ‘server’, but routing to docker and to a different server is not mutually exclusive.