Introduction & Initial System Update
Hello and welcome to Decoding. My name is Abe Matthew, and in this video lecture, we will see how to install Frappe Bench and ERPNext application in Ubuntu 22.04. Ubuntu 22.04 is the latest Ubuntu release and it has numerous new features and long term support. Let's see how to install our Frappe Bench in Ubuntu 22.04.
Here I have an installation guide and I'm following this guide to install the prerequisites and Frappe Bench in Ubuntu. This is my guide and you can see the link in the description. Let's open the terminal and start the installation.
My terminal is ready and let's set it to always on top. Before starting the installation, let's update the system. We can run sudo apt-get update command to update the system. It will ask for the password. Let's enter the password.
I'm also upgrading the system. You can use this command: sudo apt-get upgrade. Some upgradations are there, let's enter 'y'.
Installing Python and Core Dependencies
Now the system is upgraded and we can start the prerequisites installation. For installing Frappe Bench we need Python 3.6 or higher version. Let's check the Python version in Ubuntu.
Let me clear this. And we can check the Python version using this command: python3 -V. And here we can see Python 3.10.4 is available in this system by default.
Let's start with the step 1 installation, and I'm installing git into the system. Now the git is installed. I'm installing Python 3 environment. Press 'y' and enter to continue.
Let's clear this. Next we need Python 3 setup tools and Python package manager. Let's install those applications using this command. Press 'y' to continue.
Installing and Securing MariaDB
Next I am installing virtual environment using this command: sudo apt-get install virtualenv. 'y' and enter to continue. Let's clear this.
Another important prerequisite is MariaDB. Frappe uses MariaDB as the default database, so let's install MariaDB using these commands. I am running this command one by one. 'y' and enter to continue.
Next, we need to set up a root password for MariaDB. So for setting up that password, we can run this sudo mysql_secure_installation command. Now we need to enter some data into some fields. And the first one is to enter the root password of MariaDB. We didn't set up any root password, so I'm just pressing Enter. Then, switch to unix_socket authentication? Press 'y' and enter. Here we can change the MariaDB root password, so I am selecting 'y' and enter. Now we can add our new password here. I'm adding one password, then enter. It will ask to re-enter the password again, and re-enter it again. Then press 'y'. Then again plus 'y'. Again plus 'y'. I am not changing anything in configuration. Then this, press 'y' and enter. Now we successfully created the root user password in MariaDB.
Configuring MariaDB Character Set
Next, we need to install MySQL database development files. We can install it running this command. Let's run this command and press 'y' and enter to continue. Let's clear this.
Next, we need to add some configuration changes in the MariaDB configuration file. We can open MariaDB configuration file using this command, sudo nano then the file path. And this is our MariaDB configuration file. We need to add some configuration in server. Let's add this in server. We can use Ctrl+Shift+V to paste that configuration. Let's align this using Shift and Tab.
Next, we need to add some configuration in mysqld. Let's copy this and paste it under mysqld. Can align using Shift+Tab. Now let's comment some lines here. We have already set up this collation-server and character-set-server, so let's comment this using hash. Now just add this mysql configuration down here.
We can save this using Ctrl+S and exit using Ctrl+X. Now we successfully configured this MariaDB configuration file.
Restarting MySQL & Installing Redis
Let's restart the MySQL service using this command: sudo service mysql restart. Now our MySQL is restarted. Next, we need to install Redis server. Press 'y' and enter to continue. Let's clear this.
Installing Node.js, npm, and wkhtmltopdf
Frappe framework requires Node.js higher than 14 version. So let's install Node.js 14.15.0 using this command. I am running this command one by one. First, we need to install curl.
Here I am using NVM to install Node.js. So first install NVM using this command. We can install Node.js using NVM and this command will install Node.js version 14.15.0. Let's run this command. Now we successfully installed Node.js 14.
Let's install package manager for Node.js. 'y' and enter to continue. We are using HTML to PDF converter to convert HTML content to PDF. So for that purpose, let's install wkhtmltopdf converter. 'y' and enter to continue the installation.
Installing Frappe Bench
Let's install Frappe Bench using this command: sudo pip3 install frappe-bench. This will install Frappe Bench into our Ubuntu 22.04 system. Here we can see one warning, we can neglect that warning.
Let's check the bench version using this command, bench version, and this will show the installed bench version. Here I have installed bench version 5.8.1, and which is the latest available bench version. Let's clear this.
Initializing the Bench and Creating a Site
Now we can create a Frappe project. So let's initialize a new bench using this command: bench init frappe-bench. Now we successfully initialized our Frappe Bench. Let's move to Frappe Bench using this command: cd then the Frappe bench name. Now I'm in Frappe Bench. We can see the different files and directories available in Frappe Bench.
We can start the bench using the command bench start. This will start the bench services. And we can open our web application using this link. Now we found a 'Not Found' error. This is because we didn't create any site for this application. Let's create a new site. I am creating a new site called decodi.com. Then enter. Let's enter the MySQL root password. Let's add an administrator password here. Re-enter the password again. Now we successfully created our first site.
Let's go back to the previous terminal and we can stop the bench using Ctrl+C command. Then I'm starting it again using bench start. We can still see a 'Not Found' error and it is because we have not set up this site as the default site. We can set up that site as default using this command: bench use then site name. Then enter. Migrate the bench using the command bench migrate. Now the migration started.
Logging In and Installing ERPNext
Let's go back and restart the bench again using bench start command. Let's restart this page again and here we can see the login page of Frappe. We can login as administrator, so let's enter the username as 'administrator'. And let's enter the password which we set up while creating the site. Let's save this.
And here we can see the setup has started. So before completing the setup wizard, we need to install ERPNext application. So let's install ERPNext application into our site. We can install ERPNext using this command: bench get-app erpnext. And here I am not using version 13, I am using the latest ERPNext which is present in development branch. So let's copy this and paste it in the Frappe Bench terminal.
Now the installation is completed. Let's install this into our site. Let's migrate the bench. Shows 'bench is not started'. Let's go back and start the bench using command bench start. Migrate it again. Go to the web application page and reload the page.
Completing the ERPNext Setup Wizard
Now here we can see a version release message. Here we can see the setup start for ERPNext. Let's select English and click on Next. I'm from India so I'm selecting India here, and Time Zone is Indian Time when currency is Indian Rupee. Click on Next.
Then my full name, DecodEe. Then let's add an email address: [email protected]. I'm adding a password here. Click on Next. Let's save this. Here, I'm using this bench for development purposes, so I'm selecting all domains. Click on Next. Let's add company name, Decoding. Abbreviation: DE. Click on Next.
And here I'm adding Software, Jobs. Then my bank name is ICICI. Chart of Accounts: India Chart of Accounts. And the financial year begins on April 1st. Complete Setup. And now here we can see the workspace of ERPNext. Click on About, and here we can see the ERPNext version 13 development is installed here, and also Frappe version 14 is installed in this site. Let's close this.
Enabling Developer Mode and Creating a New App
Now we can start development by configuring the development mode in site. So let's open the terminal and run the command bench set-config developer_mode 1. Now the site is in developing mode and we can start development. Let's clear this.
Next, I am going to create a new application in this bench. And we can create a new application using this command: bench new-app then app name. I'm adding a demo-app here. I'm not changing the app title. Let's add some description: Demo App. Publisher: Decoding. Then email: [email protected]. Icon: default one. Color: default color. License: MIT license. Now our app is created.
Installing the Custom App and Conclusion
Let's install this app into our site. bench install-app demo-app. Try bench migrate. Let's go to our previous tab and start the bench using bench start command, because when we create a new application the bench will automatically stop, so we need to restart the bench using bench start command. Minimize this terminal and refresh this page.
Open Help and click on About. Now here we can see demo-app version 0.0.1 is installed into our site. I hope that now you are able to install Frappe framework in Ubuntu 22.04. Let's wind up this video lecture and see you soon. Bye.