Create a new Frappe site with database setup and configuration
Creates a new Frappe site with database setup, admin user configuration, and optional app installation. Use this when setting up development or production environments for Frappe/ERPNext applications.
/plugin marketplace add Venkateshvenki404224/frappe-apps-manager/plugin install frappe-apps-manager@frappe-marketplaceCreate a new Frappe site with proper database configuration, admin user setup, and initial app installation.
sites/common_site_config.json fileAsk the user for the following information:
mysite.local, dev.example.com)
Before creating the site:
sites/ directoryExecute the site creation command with appropriate flags:
bench new-site [site-name] \
--admin-password [password] \
--mariadb-root-password [root-password] \
[--db-name [custom-db-name]] \
[--install-app erpnext] \
[--verbose]
Options to consider:
--db-name: Custom database name if specified--db-type postgres: If using PostgreSQL instead of MariaDB--install-app: Install specific apps during creation--verbose: Show detailed output--source_sql: Import from SQL file (for cloning)After creation, verify:
sites/[site-name]/sites/[site-name]/site_config.jsonsites/[site-name]/private/backups/sites/[site-name]/public/files/Test site accessibility:
bench --site [site-name] console
Ask if user wants to install additional apps:
bench --site [site-name] list-appsapps/ directoryFor each app to install:
bench --site [site-name] install-app [app-name]
Offer to configure common settings:
Email Settings:
Site Settings:
Developer Mode:
bench --site [site-name] set-config developer_mode 1
bench --site [site-name] clear-cache
Ask if this should be the default site:
bench use [site-name]
This allows running bench commands without --site flag.
Provide guidance on next steps:
Access the Site:
bench start
Then visit: http://[site-name]:8000 (or configured port)
Login credentials:
Administrator[admin-password]Common Operations:
bench --site [site-name] infobench --site [site-name] backupbench --site [site-name] reinstallbench drop-site [site-name]Troubleshooting:
redis-cli pingbench --site [site-name] mariadbcat sites/[site-name]/site_config.jsontail -f logs/web.error.logProvide helpful information:
Multi-tenancy:
DNS/Hosts Configuration:
For local development, add to /etc/hosts:
127.0.0.1 mysite.local
Production Considerations:
Useful Commands:
bench --site all list-appsbench --site [site-name] consolebench --site [site-name] migratebench --site [site-name] clear-cachebench --site [site-name] set-config [key] [value]"Could not connect to database"
"Site already exists"
bench drop-site [site-name]"Redis connection failed"
sudo systemctl start redis-servercommon_site_config.json"Permission denied"
Official Frappe Documentation:
Core Frappe Commands:
bench new-site: Create new site - https://frappeframework.com/docs/user/en/bench/reference/bench-cli#new-sitebench use: Set default site - https://frappeframework.com/docs/user/en/bench/reference/bench-cli#usebench drop-site: Delete site - https://frappeframework.com/docs/user/en/bench/reference/bench-cli#drop-siteWhen creating a new site, you may want to install these core apps:
1. frappe (Required)
2. erpnext (Optional)
--install-app erpnextbench --site [site-name] install-app erpnext3. hrms (Optional)
bench --site [site-name] install-app hrms4. payments (Optional)
bench --site [site-name] install-app payments5. healthcare (Optional)
bench --site [site-name] install-app healthcareChecking Available Apps:
# List all apps in bench
ls apps/
# List apps installed on specific site
bench --site [site-name] list-apps
# Check app version
bench version