How to safely enable Server Scripts in ERPNext Docker setup?

Hi, I’m using ERPNext v15 installed via Docker (frappe_docker) on a VPS. I want to enable Server Scripts but don’t want to break the site again.

My setup:

  • ERPNext v15.x / Frappe v15.x
  • Installed via frappe_docker
  • Hosted on VPS with SSH access (root)
  • Using docker-compose, with containers like:
    erpnext-python, erpnext-redis, erpnext-nginx, erpnext-site-creator, etc.

What I want:

I need to enable Server Scripts (allow_server_script: 1) and possibly developer_mode, but I’m not sure where exactly to set it in Docker:

  • Insite_config.json inside the container?
  • Or in common_site_config.json?
  • Or as env variables in compose.yaml?

Previous issue:

Last time I tried editing config manually, the site broke and I had to rebuild everything. I want the correct and safe method for enabling server scripts in Docker.

Request:

  • Where to set the configs properly?
  • Do I need to restart containers after?
  • Safe steps to avoid breaking the site?

Thanks in advance!

The recommended process for modifying the configuration would be to use bench set-config which will set the desired variable in the site_config.json. As noted in the doc, “-g” will set it globally in tte common_site_config.json, if desired.

If you are using docker compose, that would be “docker compose exec backend bench --site {site} set-config …” in place of “bench --site {site} set-config”.

If you’re setting a variable that you would normally want to restart bench afterward, the best equivalent to that would be to restart the project, however you normally do that (docker compose down, docker compose up, if you are using docker compose).

I can’t speak to enabling server scripts specifically, though. If that breaks your site, there’s something else going on that’s most likely not docker related. In that case, you should back up your site, restore it to a local development setup and troubleshoot your process there to remove unrelated variables like VPS, docker, etc.