- Start the project in a dev container
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode. We need to tell the container to use node version 18.
nvm use 18
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode.
bench init --skip-redis-config-generation frappe-bench
cd frappe-benchWe need to tell bench to use the right containers instead of localhost. Run the following commands inside the container (Use the same redis instance for cache, queue and socketio in development mode):
bench set-config -g db_host mariadb
bench set-config -g redis_cache redis://redis:6379
bench set-config -g redis_queue redis://redis:6379
bench set-config -g redis_socketio redis://redis:6379Before we can make any changes like create DocType, etc, we need to enable developer mode
bench set-config -g developer_mode true
bench startYou can create a new site with the following command:
bench new-site sitename --no-mariadb-socketsitename MUST end with .localhost for trying deployments locally.
for example:
bench new-site development.localhost --no-mariadb-socketThe same command can be run non-interactively as well:
bench new-site development.localhost --mariadb-root-password 123 --admin-password admin --no-mariadb-socketFor more info go through the Frappe Tutorial
To develop a new app, the last step will be setting the site into developer mode. Documentation is available at this link.
bench --site development.localhost set-config developer_mode 1
bench --site development.localhost clear-cacheTo install an app we need to fetch it from the appropriate git repo, then install in on the appropriate site:
You can check VSCode container remote extension documentation regarding git credential sharing.
To install custom app
# --branch is optional, use it to point to branch on custom app repository
bench get-app --branch version-12 https://github.com/myusername/myapp
bench --site development.localhost install-app myappAt the time of this writing, the Payments app has been factored out of the Version 14 ERPNext app and is now a separate app. ERPNext will not install it.
bench get-app --branch version-14 --resolve-deps erpnext
bench --site development.localhost install-app erpnextTo install ERPNext (from the version-13 branch):
bench get-app --branch version-13 erpnext
bench --site development.localhost install-app erpnextNote: Both frappe and erpnext must be on branch with same name. e.g. version-14