Bench is a command-line utility that helps you to install, update, and manage multiple sites for Frappe/ERPNext applications on *nix systems for development and production.
For instructions on how to install Frappe/ERPNext, please refer to https://github.com/frappe/frappe_docker
Note: Apart from bench init
, all other bench commands are expected to be run in the respective bench directory.
-
Create a new bench:
$ bench init [bench-name]
-
Add a site under current bench:
$ bench new-site [site-name]
-
Optional: If the database for the site does not reside on localhost or listens on a custom port, you can use the flags
--db-host
to set a custom host and/or--db-port
to set a custom port.$ bench new-site [site-name] --db-host [custom-db-host-ip] --db-port [custom-db-port]
-
-
Download and add applications to bench:
$ bench get-app [app-name] [app-link]
-
Install apps on a particular site
$ bench --site [site-name] install-app [app-name]
-
Start bench (only for development)
$ bench start
-
Show bench help:
$ bench --help
For more in-depth information on commands and their usage, follow Commands and Usage. As for a consolidated list of bench commands, check out Bench Usage.
If you wish to extend the capabilities of bench with your own custom Frappe Application, you may follow Adding Custom Bench Commands.
Bench Manager is a GUI frontend for Bench with the same functionalties. You can install it by executing the following command:
$ bench setup manager
-
Note: This will create a new site to setup Bench Manager, if you want to set it up on an existing site, run the following commands:
$ bench get-app https://github.com/frappe/bench_manager.git $ bench --site <sitename> install-app bench_manager
- Configuring HTTPS
- Using Let's Encrypt to setup HTTPS
- Diagnosing the Scheduler
- Change Hostname
- Manual Setup
- Setup Production
- Setup Multitenancy
- Stopping Production
For an exhaustive list of guides, check out Bench Guides.
For an exhaustive list of resources, check out Bench Resources.
To contribute and develop on the bench CLI tool, clone this repo and create an editable install. In editable mode, you may get the following warning everytime you run a bench command:
WARN: bench is installed in editable mode!
This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
$ git clone https://github.com/frappe/bench ~/bench-repo
$ pip3 install -e ~/bench-repo
$ bench src
/Users/frappe/bench-repo
To clear up the editable install and switch to a stable version of bench, uninstall via pip and delete the corresponding egg file from the python path.
# Delete bench installed in editable install
$ rm -r $(find ~ -name '*.egg-info')
$ pip3 uninstall frappe-bench
# Install latest released version of bench
$ pip3 install -U frappe-bench
To confirm the switch, check the output of bench src
. It should change from something like $HOME/bench-repo
to /usr/local/lib/python3.6/dist-packages
and stop the editable install warnings from getting triggered at every command.
This repository has been released under the GNU GPLv3 License.