Overview
This page provides a complete reference of all available bench commands, organized by functional group. Each command includes a brief description and link to detailed documentation where available.Apart from
bench init, all other bench commands should be run from within the bench directory.Initialization & Application Management
Commands for creating and managing bench instances and applications.bench init
Initialize a new bench instance in the specified path.--version,--frappe-branch- Clone a particular branch of frappe--python- Path to Python executable (default: python3)--apps_path- Path to JSON file with apps to install after init--frappe-path- Path to frappe repo--clone-from- Copy repos from path--no-procfile- Do not create a Procfile--no-backups- Do not set up automatic periodic backups--skip-redis-config-generation- Skip redis config generation--skip-assets- Do not build assets--install-app- Install particular app after initialization--dev- Enable developer mode and install development dependencies
bench drop
Remove a bench instance (only works on empty benches).bench new-app
Create a new Frappe application under the apps folder.--no-git- Do not initialize git repository (Frappe v14+)
bench get-app
Clone an app from the internet or filesystem and set it up in your bench.--branch- Branch to checkout--overwrite- Overwrite existing app--skip-assets- Do not build assets--soft-link- Create soft link instead of clone--init-bench- Initialize bench if not in one--resolve-deps- Resolve dependencies before installing--cache-key- Cache get-app artifacts (only first 10 chars used)--compress-artifacts- Gzip artifacts for caching
bench remove-app
Completely remove app from bench and re-build assets if not installed on any site.bench rm, bench remove
Options:
--no-backup- Do not backup app before removing--force- Force remove app
bench exclude-app
Exclude app from updating.bench include-app
Include app for updating.bench pip
Run pip commands in bench virtual environment.bench validate-dependencies
Validate that all requirements specified in frappe-dependencies are met.Update Commands
Commands for updating bench, apps, and sites.bench update
Performs an update operation on current bench. Without flags, it will backup, pull, setup requirements, build, run patches and restart bench.--pull- Pull updates for all apps in bench--apps- Specify apps to update--patch- Run migrations for all sites--build- Build JS and CSS assets--requirements- Update requirements--restart-supervisor- Restart supervisor processes after update--restart-systemd- Restart systemd units after update--no-backup- Don’t backup sites before update (not recommended)--force- Force major version upgrades--reset- Hard reset git branches to new states
bench retry-upgrade
Retry a failed upgrade.bench switch-to-branch
Switch all apps (or specified apps) to a specified branch.--upgrade- Run bench update after switching
bench switch-to-develop
Switch frappe and erpnext to develop branch.Development Commands
Commands for development and debugging.bench start
Start Frappe development processes (uses Procfile).--no-dev- Disable development mode--no-prefix- Hide process name from log--concurrency,-c- Number of workers for each process--procfile,-p- Path to custom Procfile--man,-m- Process manager of choice
bench restart
Restart supervisor processes or systemd units.--web- Restart only web workers--supervisor- Restart supervisor processes--systemd- Restart systemd units
bench src
Print bench source folder path.bench find
Find benches recursively from a location.Configuration Commands
Commands for managing bench configuration.bench config
Change bench configuration settings.restart_supervisor_on_update
Enable/disable auto restart of supervisor processes.restart_systemd_on_update
Enable/disable auto restart of systemd units.dns_multitenant
Enable/disable bench multitenancy.serve_default_site
Configure nginx to serve the default site on port 80.rebase_on_pull
Rebase repositories on pulling.http_timeout
Set HTTP timeout in seconds.set-common-config
Set values in common_site_config.json.remove-common-config
Remove keys from common_site_config.json.bench set-nginx-port
Set NGINX port for a site.bench set-ssl-certificate
Set SSL certificate path for a site.bench set-ssl-key
Set SSL certificate private key path for a site.bench set-url-root
Set URL root for a site.bench set-mariadb-host
Set MariaDB host for bench.bench set-redis-cache-host
Set Redis cache host for bench.bench set-redis-queue-host
Set Redis queue host for bench.bench set-redis-socketio-host
Set Redis socketio host for bench.Setup Commands
Commands for setting up and configuring bench environments.bench setup
Setup command group for enabling Frappe environment.production
Setup Frappe production environment for specific user.--yes- Yes to regeneration of config files
nginx
Generate configuration files for NGINX.--logging- Logging type: none, site, or combined (default: combined)--log_format- Specify log format for nginx--yes- Yes to regeneration
reload-nginx
Check NGINX config file and reload service.supervisor
Generate configuration for supervisor.--user- User to run supervisor as--yes- Yes to regeneration--skip-redis- Skip redis configuration--skip-supervisord- Skip supervisord configuration
systemd
Generate configuration for systemd.--user- User to run services as--yes- Yes to regeneration--stop- Stop bench services--create-symlinks- Create symlinks--delete-symlinks- Delete symlinks
redis
Generate configuration for Redis.procfile
Generate Procfile for bench start.requirements
Setup Python and Node dependencies.--node- Update only Node packages--python- Update only Python packages--dev- Install optional development dependencies
env
Setup Python virtual environment for bench.--python- Path to Python executable
config
Generate or overwrite sites/common_site_config.json.sudoers
Add commands to sudoers list for execution without password.fonts
Add Frappe fonts to system.backups
Add cronjob for bench backups.lets-encrypt
Setup Let’s Encrypt SSL for site.--custom-domain- Custom domain--custom-server- Custom ACME server URL-n,--non-interactive- Run non-interactively
wildcard-ssl
Setup wildcard SSL certificate for multi-tenant bench.--email- Email for certificate notifications--custom-server- Custom ACME server URL--exclude-base-domain- SSL not applicable for base domain
add-domain
Add a custom domain to a particular site.--site- Site name--ssl-certificate- Absolute path to SSL certificate--ssl-certificate-key- Absolute path to SSL certificate key
remove-domain
Remove custom domain from a site.sync-domains
Check if there is a change in domains and update the domains list.manager
Setup bench-manager.local site with bench_manager app.--port- Port to run bench manager (default: 23624)--domain- Domain for bench manager--yes- Yes to regeneration
firewall
Setup firewall for system.--ssh_port- SSH port to keep open--force- Force setup without confirmation
ssh-port
Set SSH port for system.--force- Force change without confirmation
fail2ban
Setup fail2ban intrusion prevention.--maxretry- Number of retries before ban (default: 6)--bantime- Ban duration in seconds (default: 600)--findtime- Time window in seconds (default: 600)
role
Install dependencies via ansible roles.--admin_emails- Admin email addresses--mysql_root_password- MySQL root password--container- Running in container
Install Commands
Commands for installing system dependencies.bench install
Install system dependencies for setting up Frappe environment.prerequisites
Install pre-requisite libraries and tools (bzip2, htop, screen, vim, Redis, etc.).mariadb
Install and setup MariaDB.--mysql_root_password- MariaDB root password--version- MariaDB version (default: 10.3)
nodejs
Install Node.js.nginx
Install NGINX.--user- Setup sudoers for user
supervisor
Install supervisor.--user- Setup sudoers for user
wkhtmltopdf
Install wkhtmltopdf v0.12.3 for Linux.psutil
Install psutil via pip.fail2ban
Install fail2ban.--maxretry- Number of retries--bantime- Ban duration--findtime- Time window
Git Commands
Commands for managing git remotes.bench remote-set-url
Set app remote URL.bench remote-reset-url
Reset app remote URL to Frappe official.bench remote-urls
Show apps remote URLs.Utility Commands
Miscellaneous utility commands.bench download-translations
Download latest translations.bench renew-lets-encrypt
Renew Let’s Encrypt certificate.bench backup-all-sites
Backup all sites in current bench.bench disable-production
Disable production environment for the bench.bench migrate-env
Migrate virtual environment to desired Python version.--no-backup- Skip backup of current environment
bench app-cache
View or remove items from bench get-app cache.--clear- Remove all items--remove-app- Remove items matching app name--remove-key- Remove items matching cache key
Global Options
Options available for all bench commands.--version- Show bench version--help- Show help message-v,--verbose- Verbose output--use-feature- Use experimental feature
Custom Commands
Bench also loads custom commands from installed Frappe applications. These commands appear alongside built-in commands. See: Custom CommandsRelated Resources
Environment Variables
Environment variables used by bench
Configuration Files
Configuration file reference
Custom Commands
Create your own commands
CLI Basics
Learn bench CLI basics