Installing ERPNext on a Linux VPS
ERPNext is a popular open-source Enterprise Resource Planning (ERP) application that can be installed on your own Linux VPS. Here's a comprehensive guide to get you started:
Prerequisites:
- A Linux VPS with Ubuntu 18.04 or 20.04 (other distributions may require adjustments)
- Root or sudo privileges
- Basic understanding of the command line
Installation Steps:
-
Update System Packages:
Bashsudo apt update
-
Install Required Dependencies:
ERPNext requires several dependencies to function properly. Install them using the following command:
Bashsudo apt install -y git python3 python3-pip python3-dev libpq-dev libmariadb-dev libxml2-dev libjpeg-dev libssl-dev build-essential
-
Install Node.js and npm:
ERPNext uses Node.js for some functionalities. Install it using a Node Version Manager (recommended) like nvm:
Refer to official Node Version Manager documentation for installation instructions
Once nvm is installed, use it to install the desired Node.js version (e.g., Node.js 16):
Bashnvm install 16
Then, activate the installed Node.js version:
Bashnvm use 16
Finally, install npm (Node Package Manager):
Bashnpm install -g npm
-
Install Yarn (Optional but Recommended):
Yarn is a package manager for JavaScript that can improve installation efficiency. Install it globally using npm:
Bashnpm install -g yarn
-
Create a System User (Optional):
It's recommended to create a separate system user for running ERPNext for better security. You can skip this step if comfortable using the root user.
Bashsudo adduser erpnext
Set a strong password for the new user.
-
Clone the Frappe Bench Repository:
Frappe Bench is a command-line tool used to install and manage ERPNext applications. Clone the repository to your server:
Bashsudo su - erpnext # Switch to the erpnext user (if created) git clone https://github.com/frappe/frappe-bench.git
-
Install Frappe Bench:
Navigate to the downloaded
frappe-bench
directory and install the required Python libraries:Bashcd frappe-bench python3 -m pip install -r requirements.txt
-
Initialize Frappe Bench:
Initialize a new Frappe Bench instance in your desired directory:
Bashbench init frappe-erpnext
Replace
frappe-erpnext
with your preferred directory name for the ERPNext installation. -
Create a New Site:
Use the
bench
command to create a new site for your ERPNext instance:Bashbench new-site [site-name] --domain [your-domain.com] --db-name [database-name] --db-password [strong-password] --admin-password [strong-password]
Replace
[site-name]
with your desired site name,[your-domain.com]
with your actual domain name (if using a virtual host),[database-name]
with a desired name for the ERPNext database, and set strong passwords for the database and administrator account. -
Install ERPNext App:
Use the bench
command to install the ERPNext application within your created site:
bench --site [site-name] install-app erpnext
Replace [site-name]
with the name you used in step 9.
- (Optional) Install Additional Apps:
ERPNext has several additional apps that extend its functionalities. You can install them similarly using the bench
command:
bench --site [site-name] install-app [app-name]
Replace [app-name]
with the specific app you want to install (e.g., hrms
for the HR & Payroll app).
- Set Up Supervisor (Optional):
Supervisor is a process management tool that can help ensure ERPNext keeps running even if it crashes or encounters errors. Refer to your hosting provider's documentation or search