Skip to main content

Overview

The bench start command starts all the services required for Frappe development including the web server, socketio, redis queue workers, and scheduler. This is the primary command used during local development.

Syntax

bench start [OPTIONS]

Options

--no-dev
boolean
default:"false"
Disable development mode. By default, bench start runs in development mode with auto-reload enabled.
--no-prefix
boolean
default:"false"
Hide process names from the bench start log output. Makes logs cleaner but harder to identify which process generated which log.
bench start --no-prefix
--concurrency
string
default:"None"
Set the number of workers for specific processes. Alias: -c
bench start --concurrency "worker=4"
--procfile
string
default:"None"
Specify a custom Procfile location. Alias: -p
bench start --procfile ./custom_Procfile
--man
string
default:"None"
Specify a custom process manager (e.g., honcho, foreman). Alias: -m
bench start --man foreman

Usage Examples

Basic Start

Start all development processes:
bench start
This starts:
  • web: Frappe web server
  • socketio: Real-time communication server
  • watch: Asset watcher for automatic rebuilds
  • schedule: Background job scheduler
  • worker_short: Short background jobs
  • worker_long: Long background jobs
  • worker_default: Default background jobs

Production Mode

Start without development features:
bench start --no-dev

Clean Logs

Start without process name prefixes:
bench start --no-prefix

Custom Concurrency

Increase worker processes for better performance:
bench start --concurrency "worker=6"

Custom Procfile

Use a custom process configuration:
bench start --procfile ./Procfile.dev

What Processes Start

When you run bench start, the following processes are typically started (based on your Procfile):

web

The main web server (Werkzeug in dev mode):
13:45:23 web.1    | * Running on http://0.0.0.0:8000

socketio

Real-time communication server:
13:45:23 socketio.1 | listening on *:9000

watch

Automatically rebuilds assets when files change:
13:45:25 watch.1 | Watching for changes...

schedule

Runs scheduled tasks:
13:45:23 schedule.1 | Started scheduler

workers

Background job processors:
13:45:24 worker_short.1 | Started worker: short
13:45:24 worker_long.1  | Started worker: long
13:45:24 worker_default.1 | Started worker: default

Common Patterns

Development Workflow

Typical development session:
cd ~/frappe-bench
bench start
# Keep this terminal open
# Open browser to http://localhost:8000

Background Execution

Run bench start in the background:
bench start > bench_logs.txt 2>&1 &
Or use tmux/screen:
tmux new -s bench
bench start
# Ctrl+B, then D to detach

Multiple Benches

Run multiple benches on different ports by editing the Procfile:
# Edit Procfile to change ports
web: bench serve --port 8001
socketio: bench serve-socketio --port 9001

bench start

Development Mode Features

When running in development mode (default):
  • Auto-reload: Python code changes trigger automatic reloads
  • Asset watching: JS/CSS changes are automatically rebuilt
  • Verbose logging: Detailed logs for debugging
  • Debug mode: Enhanced error pages with stack traces

Stopping Bench

To stop all processes:
# In the terminal where bench is running:
Ctrl + C
Or if running in background:
killall -9 node python

Troubleshooting

Port Already in Use

If you see an error about ports being in use:
# Find and kill processes using the port
lsof -ti:8000 | xargs kill -9
lsof -ti:9000 | xargs kill -9

Redis Connection Errors

Ensure Redis is running:
sudo service redis-server start
# or
redis-server

Worker Not Processing Jobs

Check if workers are running:
bench doctor
Restart with more verbosity:
bench start --verbose

Asset Build Issues

If assets aren’t building, rebuild manually:
# In another terminal
bench build

Production Deployment

bench start is intended for development only. For production, use:
  • Supervisor for process management
  • Nginx as a reverse proxy
  • Production Procfile with optimized settings
Set up production:
sudo bench setup production [user]
Then manage with:
sudo supervisorctl restart all

Performance Optimization

Increase Workers

For better background job processing:
bench start --concurrency "worker_short=4,worker_long=2,worker_default=4"

Disable Unused Services

Edit Procfile to comment out services you don’t need:
web: bench serve --port 8000
# socketio: bench serve-socketio --port 9000
watch: bench watch

Build docs developers (and LLMs) love