Introducing a new way to review your PRs.

Read the announcement

frappe / frappe_docker

Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development

View on GitHub

15 documents · Updated Nov 23, 2026

docs / development-installer-and-app-configuration

Development installer and app configuration

The development installer creates a local Frappe bench and a site that can run inside the development workspace. It uses an example app list to choose extra Frappe applications, then connects the new site to the local database and Redis services so the environment is ready for development.

Provisioning role

The installer is the bridge between the development workspace and a usable Frappe site. It turns repository configuration into a bench, applies the service addresses that the local containers use, and creates one site with the selected applications.

The workspace described by devcontainer-example/devcontainer.json supplies the container context and forwards the web, realtime, and asset-watcher ports. The installer supplies the Frappe-specific state inside that context. See Development environment provisioning for the wider setup flow and Development container workspace for the workspace layer.

Provisioning inputs

The installer accepts a small set of inputs that define the bench location, site name, Frappe source, runtime versions, database type, and site administrator password. The defaults target a bench named frappe-bench, a site named development.localhost, the Frappe version-16 branch, and MariaDB. -j or --apps-json changes the app list used during bench creation. (development/installer.py• L36-116)

These inputs separate the stable local workflow from choices that vary by engineer or branch. A custom app list can therefore change the applications in the site without changing the installer flow. The selected database type must also match the database service available to the local environment.

The top-level example.env file is a separate example for container and service configuration. It can set the application version, database and Redis endpoints, and data locations, but it does not replace the installer app list. Use Configuration and environment inputs for the wider environment contract. (example.env• L1-24)

References: development/installer.py• L36-116 devcontainer-example/devcontainer.json• L1-22 example.env• L1-24

Bench and service setup

The bench is the local Frappe workspace that holds the framework, selected applications, site data, and runtime environment. The installer creates it only when it does not already exist. If it finds the bench, it keeps the existing bench and proceeds to site creation instead of rebuilding the framework. (development/installer.py• L119-123)

Framework and application sources

During first-time setup, the installer asks bench init to fetch Frappe from the configured repository and branch. It passes the app configuration file as the source for additional applications. This makes the Frappe version and the application set part of the same initial bench definition. (development/installer.py• L124-145)

The default development/apps-example.json selects ERPNext from its version-16 branch. Each entry supplies a repository URL and branch. The file is an example input, so a local setup can point it at another application or branch while keeping the same provisioning model. (development/apps-example.json• L1-6)

References: development/installer.py• L119-145 development/apps-example.json• L1-6

After bench creation, the installer records the names and addresses that the bench uses to reach its supporting services. The local Compose environment provides MariaDB or PostgreSQL plus separate Redis services for cache and queue work. (devcontainer-example/docker-compose.yml• L1-20, devcontainer-example/docker-compose.yml• L37-55)

The bench uses redis-cache:6379 for cache work and redis-queue:6379 for queue work. It also points the legacy Socket.IO Redis setting to the queue service so older expectations continue to work. The installer points browser work to the system Chromium binary and enables developer mode for the site. (development/installer.py• L146-205)

The broader container setup can instead provide external database or Redis endpoints through example.env. Those values affect the service network used by the container stack. They do not change which applications the development installer fetches. (example.env• L8-19)

References: development/installer.py• L146-205 devcontainer-example/docker-compose.yml• L1-20 devcontainer-example/docker-compose.yml• L37-55 example.env• L8-19

Application selection

Application selection has two linked stages. The app configuration chooses what the bench should fetch, and site creation installs the fetched applications into the new site.

The default selection is shown below.

SourceSelected applicationVersion source
development/apps-example.jsonERPNextversion-16 branch of its repository

Bench application set

The app list is read during initial bench setup. This gives the bench the framework and the extra application code before a site is created. If the bench already exists, changing the JSON file does not rebuild that bench; the engineer must account for the existing bench state before expecting a new app selection to take effect. (development/installer.py• L119-145)

References: development/installer.py• L119-145 development/apps-example.json• L1-6

Site application set

When the installer creates the site, it treats the frappe framework as present by default and adds every other application directory found in the bench. The resulting site receives the same application set that the bench made available. (development/installer.py• L211-247)

This relationship means the app JSON controls what can be installed, while the bench contents control what is installed for that site. The site name must end in .localhost when using the documented default pattern so local host routing can resolve it. (development/installer.py• L56-61)

References: development/installer.py• L56-61 development/installer.py• L211-247

Site creation

Site creation turns the prepared bench into a running local Frappe target. The installer selects the database host from the requested database type, creates the site with the configured administrator password, and adds the non-framework applications.

The local database choices map to the service names in the Compose environment:

Database choiceLocal host used by the siteRequired local service
mariadbmariadbMariaDB service
Other supported choice, such as postgrespostgresqlPostgreSQL service enabled in Compose

Database connection

For MariaDB, the installer uses the mariadb service and sets the global database host to that name. For another database choice, it uses postgresql and expects that service to be enabled. This keeps the site connection aligned with container-network service names rather than host-local addresses. (development/installer.py• L211-242, devcontainer-example/docker-compose.yml• L1-20)

The example Compose file enables MariaDB and leaves PostgreSQL commented out. A PostgreSQL-based setup therefore requires the service and its persistent volume to be enabled before site creation. (devcontainer-example/docker-compose.yml• L1-20, devcontainer-example/docker-compose.yml• L83-86)

References: development/installer.py• L211-242 devcontainer-example/docker-compose.yml• L1-20 devcontainer-example/docker-compose.yml• L83-86

Site readiness

The installer passes the site administrator password to bench new-site and appends one install flag for each non-frappe app in the bench. A successful run therefore leaves a site with its database connection and application set established in one step. (development/installer.py• L211-247)

The local development tools then use the bench site as their working target. The example debug configuration serves web traffic on port 8000 and starts the realtime and worker processes that support normal development activity. (development/…/launch.json• L6-75)

References: development/installer.py• L211-247 development/…/launch.json• L6-75

Provisioning flow

The flow starts with installer options and an app configuration file. It ends with a site that uses the local service network and has the configured applications installed.

This diagram shows how installer choices and the app list become a bench, then become a site connected to the local services.

flowchart LR
    A[Installer options] --> B[Bench initialization]
    C[apps-example.json] --> B
    B --> D[Bench with Frappe and selected apps]
    D --> E[Database and Redis settings]
    E --> F[New local site]
    F --> G[Development web, realtime, and worker processes]

The key boundary is between bench initialization and site creation. The first stage fetches the framework and application sources. The second stage uses the resulting bench contents to choose what the site receives.

References: development/installer.py• L29-34 development/installer.py• L119-145 development/installer.py• L146-205 development/installer.py• L211-247 development/…/launch.json• L6-75

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the database names in development/installer.py aligned with the service names in devcontainer-example/docker-compose.yml.
  • When changing the app list format or its default path, update both the installer input contract and the example app file.
  • When changing the bench or site defaults, check the workspace debug paths and local host naming assumptions.
  • When adding a service dependency, update both the bench-level connection settings and the Compose service definition.
  • When changing database, Redis, or data-location values in example.env, check the service endpoints and mounts used by the local container stack.
  • When changing the browser or developer-mode settings, check the local development tools that consume the provisioned bench.

Important failure modes

TriggerConsequenceGuard
The requested database service is not enabled in Compose.Site creation cannot connect to its database host.Enable the matching service before running site creation.
The bench already exists with a different app set.The current app JSON does not rebuild or replace the existing bench.Use a deliberate bench lifecycle when changing the initial application set.
An app directory other than frappe is incomplete or not a valid app.The installer still asks the site to install it and site creation can fail.Keep the bench app directories and app source entries valid.
External database or Redis values in example.env do not point to reachable services.The container stack cannot reach its configured backing services.Set external endpoints only when those services are available on the container network.
Default sample credentials are used outside a private local environment.The site and database have weak, known credentials.Replace the example passwords for any shared or exposed environment.

Key files

FileWhy to read it
development/installer.pyDefines the local provisioning inputs, bench setup, service links, database choice, and site creation flow.
development/apps-example.jsonShows the input shape used to select an application repository and branch.
example.envShows the broader example values for application version, backing services, data locations, and local deployment defaults.
devcontainer-example/docker-compose.ymlDefines the database and Redis service names that the installer uses for local connections.
devcontainer-example/devcontainer.jsonShows the workspace context and development ports that consume the provisioned site.
development/…/launch.jsonShows how the provisioned bench is used for web, realtime, and worker development processes.