Intro and goal: ERPNext on Ubuntu 22.04 for Proxmox
This is a complete installation that I'll be doing on Ubuntu 22.04. I'm running Proxmox. I'll be converting this to a template and I'll be sharing this with you so that you can simply import it into your Proxmox environment and complete ERPNext. We'll be working with all the applications that you need. I'll be installing the HR application also. So let me start this machine now. Open 22.04 which is running right now. I need to enable the SSH.
Enable SSH and update the system
Nano /etc/ssh/sshd_config. So I'll be changing the configuration here. If you go down here, PermitRootLogin, here I'll be doing PermitRootLogin and this will be yes. And that's it, and I'll be restarting this service now. sudo systemctl restart sshd. I'm now logged in. So first things first we need to make sure that it is updated, so we'll do sudo apt-get update and apt-get upgrade and it will be with yes extension. We need to make sure that everything is up to date first of all, restarting the servers.
Install base dependencies and system libraries
We will be installing all the required packages here. So first of all sudo apt-get install it is Python 3 and it is the dev environment of the Python 3 and then Python 3.11. Also I'll be installing nginx and then I'll be installing the Python 3 setup tools also and Python 3 pip and then I'll be installing python3-utilities utils and then I'll be also installing software-properties-common and then I'll be installing xvfb library for font config and then I'll be installing wkhtmltopdf and then libmysqlclient-dev and -dev. For all I will be using -y so that it will not ask my permission. So it is libfontconfig in fact these all packages are installed so it's good to reboot it once, once you have installed these packages so that it doesn't give any problem. So we'll just wait for this restart to complete.
Python virtualenv, Node.js, Redis, Cron and Git
So now we'll be installing python virtual environment, so we'll be doing sudo apt-get install python3.11-venv. So this is python virtual environment. All right, so virtual environment is installed. Install one more package which is sudo apt-get install python-is-python3 and -y. We need to ensure that the python version is correct and Python 3 version is correct, so we'll be checking Python 3. We'll be installing nodejs. I'll copy this complete command here and we'll go here back and we'll install this. So I'll share the link of this also in the description where you can install nodejs here. So we have installed this nodejs using the dep package nodejs libraries and we'll be checking the node version. Node version, so it is 20.10. Now we'll be installing Redis server apt-get install nodejs and redis-server so both will be installing now. We'll also be installing two more packages which is cron and git, so we'll be installing apt-get install cron git -y. So cron is already installed, git will be installed here. All right, so node version. So we'll be installing the yarn now using npm, so npm install -g yarn to install the updated version of this. All right, so we'll check the npm version now it is 10.2.4. It should be greater than 9. In fact now we'll be installing MariaDB here.
apt-get install mariadb-server mariadb-client -y. Once it is installed all right so the server is installed. If we see here MariaDB it is installed here. Now we'll be doing mysql_secure_installation and enter the root password; nothing is right now. Change the root password, new password here. If I check mysql -u root -p, all right, so we are able to log in to the MariaDB server. In MariaDB we need to make few changes here, so we will go here cd /etc/mysql cd mariadb.conf.d and here we have this particular server configuration so we'll be updating this sudo nano 50-server.cnf. So we'll be changing this configuration here and we'll add few lines here. I'll just show you that I'll be typing it down here in the description also you will find that this one is fine but here we need to instead of general we need to change it to Unicode. So this will be unicode. This configuration was for mysqld. We can add the configuration of mysql also here so we'll be just typing in here and save the configuration. Now we can restart the MariaDB to make sure that everything is working fine, so we'll do systemctl restart mariadb. If anything is wrong it will not start; if everything is fine it will work and I'll check the status of this also. Now all right so MariaDB is active and running right.
Create non-root user and prepare bench directory
Now we need to add the user. Of course we have created everything under root; it is not a good idea to use root for ERPNext so we can use any other name. So I'll be using my name for this purpose. So I'll be using useradd -m -s /bin/bash and it will be amjed. Now the user has been added. So I'll be using passwd and new password I'll be entering and here the password is updated successfully. Now I'll be using usermod -aG sudo amjed. I've been added to the sudo group here. Now I'll be moving to my new users. Now I'll be setting the path of the users. We'll be moving to .bashrc. Here at the end of this anywhere I can add path of the bin location so I'll be adding it here and close this. And yes. All right so we have done this. Now I'll be creating a directory called bench inside /opt folder. I'll be creating the folder called bench: mkdir /opt/bench. All right so bench folder is created here. I'll be giving the rights on this folder, changing the directory. I'll be running the commands inside directory /opt/bench and here yarn and node-sass. All right so it is done now. So yarn version, so it is 1.22.21. This is the latest version right now which is available. Everything is fine.
Install Bench and initialize Frappe framework
On this particular user we'll be installing pip3 install frappe-bench. Bench is installed now, using the bench command now and we'll be creating bench: bench init frappe-bench and what we'll be installing here we'll be getting the branch also for frappe bench branch and it will be version 15. It is setting up the python environment. Bench frappe has been initiated now but if I start bench, bench start error Procfile does not exist. We'll go to cd frappe-bench. bench start. So it will start it and we to accept the connections I can run this. Here so right now nothing is there because there is no site associated with it.
Create site, install ERPNext and HRMS apps, and run the site
Now we will be creating a new site here: bench new-site erp.syncbricks.com. MySQL root password. It is installing Frappe. Now all right so we'll be setting the administrator password now and reenter the administrator password. So the Frappe site has been created. Of course but right now the apps are not installed so I'll be getting the apps here. I'll be getting bench get-app erpnext and it will be branch version will be branch version 15. We also get another app which will be bench get-app; it will be hrms and again for hrms it will be branch version 15. So it is cloning the app. Now installing HRMS. So we got these both applications, one was HRMS and another was ERPNext. Now it is time to install these applications to the site. So I'll be going to bench --site and site was erp.syncbricks.com install-app erpnext. So this app will be installed on site. I'll be installing now the HRMS, so same command we'll be using with the install-app, it will be hrms this time. So we'll wait for this also to complete; it will take some time. So it has been installed now. So I'll be doing bench start. It is ready to accept the connections. So I'll be just going here. So this is using the default site here. I'll be setting it first bench use erp.syncbricks.com so default site will be set and now I'll be doing bench start. The ERP will be loading. All right so here our ERPNext 15 has been successfully installed. All the modules related to HR, so recruitment, employee lifecycle, all of that is installed here. And if I go here to Help > About you can see ERPNext version 15.5, Frappe Framework version 15.4 and Frappe HR version 15.5. These are all installed right now.