Bench Architecture

Bench is a command-line utility that helps you install apps, manage multiple sites and update Frappe based apps on *nix based systems (macOS, CentOS, Debian, Ubuntu, etc) for development and production. Bench will also create nginx and supervisor config files, setup backups and much more.

Bench Architecture Bench Architecture

For installation, check this guide

Directory structure

When you install bench, you will have a directory structure similar to

├── apps
│   ├── frappe
├── config
├── env
├── logs
├── Procfile
└── sites
    ├── apps.txt
    ├── assets
    ├── common_site_config.json
    └── site1.local
        ├── private
        ├── public
        └── site_config.json


A Frappe app is a python package that use the Frappe framework. Frappe apps live in a directory called apps. As you can see, there is an app named frappe, since frappe is an app which acts as the framework. A Frappe app should have an entry in apps.txt.


Frappe is a multitenant platform and each tenant is called a site. Sites exist in a directory called sites, assumed as the current working directory when running a bench command.

Every site contains a private and public directory which stores private and public files respectively. common_site_config.json is a configuration file common to all sites. site_config.json is a configuration file specific to each site and will override options from common_site_config.json.

Virtual Environment

Every frappe-bench directory is a python virtual environment. It holds the python packages required by frappe apps.


Processes are defined in a file called Procfile. This is only for developement mode.

redis_cache: redis-server config/redis_cache.conf
redis_socketio: redis-server config/redis_socketio.conf
redis_queue: redis-server config/redis_queue.conf
web: bench serve --port 8000

socketio: /usr/bin/node apps/frappe/socketio.js

watch: bench watch

schedule: bench schedule
worker_short: bench worker --queue short --quiet
worker_long: bench worker --queue long --quiet
worker_default: bench worker --queue default --quiet

Let's see what each process is used for.


Redis used for in-memory caching.


Redis used as a pub/sub between web and socketio processes for realtime communication.


Redis used for managing background jobs queuing.


Python web server based on Werkzeug.


Node server for a socketio connection with the browser for realtime communication.


Node server for bundling JS/CSS assets using Rollup. It will also rebuild files as they change.


Job Scheduler using Python RQ.


This worker has a short timeout (300).


This worker has a long timeout (1500).


This worker has a default timeout (300).