Overview
This guide will walk you through creating your first Frappe environment using Bench. You’ll learn how to initialize a bench, create a site, install apps, and start development.Before starting, make sure you have installed Bench on your system.
Step 1: Initialize a Bench
A bench is a directory that contains the Frappe framework, apps, and sites.Create a new bench
Initialize a new bench instance:This command will:
- Create a
frappe-benchdirectory - Set up a Python virtual environment
- Clone the Frappe framework
- Install Python dependencies
- Setup basic configuration files
Command Options
Command Options
Step 2: Create Your First Site
Sites are individual Frappe instances with their own database and configuration.Create a new site
- MySQL root password: Your database root password
- Administrator password: Password for the Frappe Administrator user
Example Output
Example Output
Configure local DNS (Development only)
For local development, add your site to Or edit manually:Add this line:
/etc/hosts:Advanced Site Options
Step 3: Install Apps
Apps extend Frappe with additional functionality. Let’s install ERPNext as an example.Get the app
Download and setup an app in your bench:This clones the ERPNext repository from GitHub and installs its dependencies.
Get App from Different Sources
Get App from Different Sources
Install app on site
Install the app on your site:This process:
- Creates database tables for the app
- Runs migrations
- Installs app fixtures and demo data
- Builds and installs frontend assets
Example Output
Example Output
Common Apps
ERPNext
Complete ERP system for businesses
HRMS
Human Resource Management System
Payments
Payment gateway integrations
Custom App
Your own Frappe application
Step 4: Start Development Server
Launch all required services for development.Start the bench
- web: Gunicorn web server (port 8000)
- socketio: Real-time communication server
- watch: Watches and auto-builds frontend assets
- schedule: Background job scheduler
- worker: Background job workers (short, long, default)
Example Output
Example Output
Access your site
Open your browser and navigate to:Or use localhost:If you have multiple sites, specify the site in URL:
Login
Use these credentials:
- Username:
Administrator - Password: The password you set when creating the site
Development Server Options
Common Workflows
Creating Additional Sites
Managing Multiple Apps
Database Operations
Running Console
Troubleshooting
Site not loading in browser
Site not loading in browser
Check /etc/hosts file:Should show:Check if bench is running:
Port 8000 already in use
Port 8000 already in use
Find and kill the process using port 8000:Or use a different port:
Database connection errors
Database connection errors
Ensure MariaDB is running:Test connection:
Administrator password not working
Administrator password not working
Reset the administrator password:
Assets not loading
Assets not loading
Clear cache and rebuild:
Python package errors
Python package errors
Reinstall dependencies:Or for specific app:
Next Steps
Now that you have a working bench setup:Explore Commands
Learn about all available Bench commands
Production Setup
Deploy your bench to production with NGINX and SSL
Create Custom App
Build your own Frappe application
Configuration
Configure bench and site settings
Quick Reference
Essential Commands
For a complete command reference, visit the Commands section.