UbuntuUbuntu Based

How To Install ERPNext on Ubuntu 24.04 LTS

Install ERPNext on Ubuntu 24.04

ERPNext stands as one of the most powerful open-source Enterprise Resource Planning (ERP) solutions available today. This comprehensive business management software integrates accounting, inventory management, customer relationship management (CRM), human resource management (HRM), and project management into a single, unified platform. Unlike expensive proprietary alternatives such as SAP or Oracle, ERPNext offers businesses of all sizes access to enterprise-grade functionality without the hefty licensing fees.

Ubuntu 24.04 LTS provides the perfect foundation for ERPNext deployment. This long-term support release offers exceptional stability, robust security features, and extended support lifecycle that makes it ideal for business-critical applications. The LTS designation ensures five years of security updates and maintenance, providing peace of mind for production environments.

This detailed installation guide will walk you through every step of setting up ERPNext on Ubuntu 24.04 LTS. Whether you’re a seasoned system administrator or someone new to Linux server management, these instructions provide clear, actionable steps with comprehensive troubleshooting guidance. By following this tutorial, you’ll have a fully functional ERPNext installation ready for production use.

The installation process typically takes 2-3 hours for beginners and 45-60 minutes for experienced administrators. You’ll learn not only how to install ERPNext but also how to optimize it for performance, secure it for production use, and maintain it for long-term reliability.

Prerequisites and System Requirements

Hardware Requirements

ERPNext performance depends heavily on adequate system resources. Minimum requirements include 4GB RAM, 40GB storage space, and 2 CPU cores. However, these specifications are suitable only for testing or very small implementations with fewer than 10 concurrent users.

Recommended specifications for production environments include 8GB RAM, 80GB SSD storage, and 4 CPU cores. These specs comfortably support 50-100 concurrent users with good response times. For larger organizations, consider 16GB+ RAM and NVMe SSD storage for optimal performance.

Network connectivity requirements include stable internet access for initial installation and ongoing updates. Plan for approximately 2-3GB of data downloads during the installation process. If you’re setting up ERPNext for multiple locations, ensure adequate bandwidth between sites.

Storage planning is crucial for long-term success. ERPNext databases grow significantly over time, especially with document attachments, transaction history, and backup files. Consider implementing automated backup strategies and monitoring disk usage regularly.

Software Prerequisites

Begin with a fresh Ubuntu 24.04 LTS server installation. While ERPNext can coexist with other applications, a dedicated server eliminates potential conflicts and simplifies maintenance. Ensure you have root access or a user account with sudo privileges.

SSH access is essential for remote server management. Configure key-based authentication for enhanced security rather than relying on password authentication. This practice significantly reduces security risks and streamlines server access.

Domain name configuration, while optional for testing, becomes crucial for production deployments. ERPNext generates absolute URLs for various functions, making proper domain setup important for email notifications, API access, and user experience.

SSL certificate planning should begin early in the process. Modern browsers require HTTPS for many features, and ERPNext includes sensitive business data that demands encrypted connections. Consider Let’s Encrypt for free SSL certificates or commercial certificates for enterprise environments.

Technical Dependencies Overview

ERPNext requires specific software versions for optimal compatibility. Python 3.11 or higher is mandatory, with Ubuntu 24.04 including Python 3.12 by default. The installation process leverages Python’s virtual environment capabilities to isolate ERPNext dependencies from system packages.

Node.js 18 or higher powers ERPNext’s modern frontend components and build processes. The official Ubuntu repositories may contain older Node.js versions, requiring third-party repositories for current releases. Yarn package manager provides faster, more reliable dependency resolution compared to npm.

Database requirements offer flexibility between MariaDB 10.3+ and PostgreSQL. MariaDB remains the most popular choice due to extensive community documentation and proven stability with ERPNext workloads. Redis 5+ handles caching and real-time features, significantly improving application responsiveness.

NGINX serves as the production web server, providing reverse proxy functionality, SSL termination, and static file serving. Additional tools including Git, wkhtmltopdf, and various development libraries complete the technical stack required for full ERPNext functionality.

Initial System Setup

Connecting to Your Ubuntu Server

Establish SSH connection to your Ubuntu 24.04 server using your preferred terminal application. For security, avoid root login and instead use a regular user account with sudo privileges:

ssh username@your-server-ip

If you haven’t configured SSH keys, do so immediately after first login. Generate keys on your local machine and copy the public key to the server:

ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
ssh-copy-id username@your-server-ip

Verify your connection and confirm you can execute commands with sudo privileges:

sudo whoami

System Updates and Upgrades

Update package repositories to ensure access to the latest software versions:

sudo apt update

Upgrade existing packages to patch security vulnerabilities and improve system stability:

sudo apt upgrade -y

The upgrade process may require several minutes depending on the number of available updates. If kernel updates are installed, reboot the system to ensure new kernels load properly:

sudo reboot

After reboot, verify system version and architecture compatibility:

lsb_release -a
uname -m

Creating Dedicated ERPNext User

Security best practices require running ERPNext under a dedicated user account rather than root. Create the frappe user account:

sudo adduser frappe

Add the new user to the sudo group for administrative privileges:

sudo usermod -aG sudo frappe

Switch to the frappe user account for all subsequent installation steps:

su - frappe

Verify you’re operating under the correct user account and have sudo access:

whoami
sudo whoami

Timezone and Locale Configuration

Proper timezone configuration ensures accurate timestamps in ERPNext transactions and reports. Set your server timezone using timedatectl:

sudo timedatectl set-timezone Asia/Jakarta

Replace “Asia/Jakarta” with your appropriate timezone. List available timezones:

timedatectl list-timezones

Verify timezone setting and system clock accuracy:

timedatectl status
date

Configure system locale settings to prevent character encoding issues:

sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8

Installing Core Dependencies

Python Development Environment

Install Python development packages and compilation tools required for ERPNext:

sudo apt install -y python3-dev python3-pip python3-venv python3-setuptools python3-wheel

Install build essentials for compiling Python packages with native extensions:

sudo apt install -y build-essential libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libwebp-dev libfreetype6-dev liblcms2-dev libopenjp2-7-dev libtiff5-dev tk-dev tcl-dev

Verify Python installation and version compatibility:

python3 --version
pip3 --version

Ubuntu 24.04 includes Python 3.12, which provides excellent compatibility with ERPNext v15. Create and test a virtual environment to ensure proper isolation:

python3 -m venv test_env
source test_env/bin/activate
deactivate
rm -rf test_env

Node.js and Package Managers

Install Node.js using the NodeSource repository for the latest stable version. Add the repository GPG key and source:

curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

Update package repositories and install Node.js:

sudo apt update
sudo apt install -y nodejs

Install Yarn package manager globally for improved dependency management:

sudo npm install -g yarn

Verify Node.js and Yarn installations:

node --version
npm --version
yarn --version

Node.js version 18 or higher is required, with version 20 providing optimal compatibility and performance for ERPNext applications.

Essential System Libraries

Install additional development libraries and utilities required by ERPNext:

sudo apt install -y git curl wget software-properties-common apt-transport-https ca-certificates gnupg lsb-release

Install wkhtmltopdf for PDF generation functionality:

sudo apt install -y wkhtmltopdf

Install additional compression and image processing libraries:

sudo apt install -y libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev xz-utils libffi-dev liblzma-dev

Verify critical tools are properly installed:

git --version
curl --version
wkhtmltopdf --version

Database Installation and Configuration

MariaDB Server Setup

Install MariaDB server and client packages:

sudo apt install -y mariadb-server mariadb-client

Start and enable MariaDB service for automatic startup:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the security installation script to remove default insecure settings:

sudo mysql_secure_installation

During the security setup, respond to prompts as follows:

  • Set root password: Yes (create a strong password)
  • Remove anonymous users: Yes
  • Disallow root login remotely: Yes
  • Remove test database: Yes
  • Reload privilege tables: Yes

Configure MariaDB for optimal ERPNext performance by editing the configuration file:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Add these optimizations under the [mysqld] section:

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
max_connections = 200
innodb_buffer_pool_size = 1G
innodb_log_file_size = 128M
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT

Restart MariaDB to apply configuration changes:

sudo systemctl restart mariadb

Database User and Permissions

Access MariaDB as root to create the ERPNext database user:

sudo mysql -u root -p

Create a dedicated database user with appropriate privileges:

CREATE USER 'frappe'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON *.* TO 'frappe'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Test database connectivity with the new user:

mysql -u frappe -p -e "SHOW DATABASES;"

Redis Server Configuration

Install and configure Redis server for caching and real-time features:

sudo apt install -y redis-server

Start and enable Redis service:

sudo systemctl start redis-server
sudo systemctl enable redis-server

Test Redis functionality:

redis-cli ping

You should receive “PONG” response indicating Redis is working correctly. Configure Redis for ERPNext by editing the configuration:

sudo nano /etc/redis/redis.conf

Ensure these settings are configured:

maxmemory 256mb
maxmemory-policy allkeys-lru

Restart Redis to apply changes:

sudo systemctl restart redis-server

Installing Frappe Bench

Understanding Frappe Bench

Frappe Bench serves as the development and deployment tool for ERPNext applications. It manages multiple sites, handles database migrations, and provides development utilities. Understanding bench commands is crucial for ongoing ERPNext administration.

The bench system supports multi-tenancy, allowing multiple ERPNext sites on a single server instance. This capability proves valuable for hosting companies or organizations managing multiple business units.

Installing Bench Dependencies

Install Frappe Bench using pip3:

pip3 install --user frappe-bench

Add the local pip binary directory to your PATH:

echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Verify bench installation:

bench --version

If you encounter command not found errors, ensure the PATH is correctly configured and restart your terminal session.

Initializing Frappe Bench Environment

Create a new bench instance in the home directory:

cd ~
bench init frappe-bench --frappe-branch version-15

This process downloads Frappe framework and creates the necessary directory structure. The initialization takes several minutes as it downloads and installs dependencies.

Navigate to the bench directory and examine the structure:

cd frappe-bench
ls -la

The directory contains apps, sites, and various configuration files. Understanding this structure helps with troubleshooting and customization.

Start bench to verify the installation:

bench start

Stop the development server with Ctrl+C after verifying all processes start without errors.

Installing ERPNext Application

Downloading ERPNext

Download ERPNext application using bench get-app command:

bench get-app --branch version-15 erpnext

This downloads ERPNext version 15, the current stable release. The download process includes all necessary files and dependencies.

Verify ERPNext is available in the apps directory:

ls apps/

You should see both frappe and erpnext directories listed.

Installing Additional Apps

Install HRMS (Human Resource Management System) for complete HR functionality:

bench get-app --branch version-15 hrms

Install Payments app for integrated payment processing:

bench get-app --branch version-15 payments

These additional apps extend ERPNext capabilities and are commonly required in production environments.

Creating ERPNext Site

Create a new site for your ERPNext installation:

bench new-site site1.local --admin-password admin_password_here --mariadb-root-password your_mariadb_root_password

Replace “site1.local” with your actual domain name and use strong passwords for security. The site creation process includes database initialization and basic configuration.

Install ERPNext and additional apps to the new site:

bench --site site1.local install-app erpnext
bench --site site1.local install-app hrms
bench --site site1.local install-app payments

Set the default site to avoid specifying site name in future commands:

bench use site1.local

Initial Configuration and Testing

Starting Development Server

Start the ERPNext development server:

bench start

The command starts multiple processes including web server, worker processes, and scheduler. Monitor the output for error messages or warnings.

Access ERPNext through your web browser at http://your-server-ip:8000. If accessing remotely, ensure firewall rules allow port 8000 traffic.

Install ERPNext on Ubuntu 24.04 LTS

Basic ERPNext Setup

Complete the ERPNext setup wizard by navigating through these steps:

  1. Welcome Screen: Click “Let’s Get Started”
  2. Region Settings: Select your country and timezone
  3. User Details: Create the first user account
  4. Organization Details: Enter company information
  5. Domain Selection: Choose relevant business domains
  6. Brand Settings: Upload logo and customize appearance

Test core functionality by creating sample records:

  • Create a customer record
  • Add an item to inventory
  • Generate a quotation
  • Process a sales order

Troubleshooting Common Issues

Permission Errors: If you encounter permission-related errors, ensure proper ownership:

sudo chown -R frappe:frappe ~/frappe-bench

Database Connection Issues: Verify MariaDB service status and user privileges:

sudo systemctl status mariadb
mysql -u frappe -p -e "SELECT USER();"

Port Conflicts: If port 8000 is unavailable, configure alternative ports in site_config.json:

nano sites/site1.local/site_config.json

Add port configuration:

{
 "db_name": "site1_local",
 "db_password": "password",
 "developer_mode": 1,
 "port": 8001
}

Log Analysis: Monitor bench logs for detailed error information:

tail -f logs/bench.log

Production Environment Setup

NGINX Web Server Configuration

Install NGINX for production deployment:

sudo apt install -y nginx

Generate NGINX configuration for ERPNext:

sudo bench setup nginx

Enable the generated site configuration:

sudo ln -s /home/frappe/frappe-bench/config/nginx.conf /etc/nginx/sites-available/frappe-bench
sudo ln -s /etc/nginx/sites-available/frappe-bench /etc/nginx/sites-enabled/frappe-bench

Test NGINX configuration syntax:

sudo nginx -t

Remove default NGINX site and restart:

sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx

SSL Certificate Configuration

Install Certbot for Let’s Encrypt SSL certificates:

sudo apt install -y certbot python3-certbot-nginx

Obtain SSL certificate for your domain:

sudo certbot --nginx -d yourdomain.com

Configure automatic certificate renewal:

sudo crontab -e

Add renewal job:

0 12 * * * /usr/bin/certbot renew --quiet

Supervisor Process Management

Install Supervisor for process management:

sudo apt install -y supervisor

Generate Supervisor configuration:

sudo bench setup supervisor

Enable and start Supervisor services:

sudo ln -s /home/frappe/frappe-bench/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf
sudo supervisorctl reread
sudo supervisorctl update

Verify ERPNext processes are running:

sudo supervisorctl status

Security Hardening

Configure UFW firewall:

sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 'Nginx Full'

Install and configure fail2ban:

sudo apt install -y fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

Disable unnecessary services and remove unused packages:

sudo apt autoremove -y
sudo apt autoclean

Maintenance and Optimization

Regular Maintenance Tasks

Create automated backup scripts for database and files:

#!/bin/bash
cd /home/frappe/frappe-bench
bench --site all backup --with-files
find ~/frappe-bench/sites/*/private/backups -name "*.sql.gz" -mtime +7 -delete

Schedule backups using cron:

crontab -e

Add daily backup job:

0 2 * * * /path/to/backup_script.sh

Monitor system resources and ERPNext performance:

htop
sudo iotop
bench doctor

Update ERPNext regularly:

cd frappe-bench
bench update

Performance Optimization

Optimize database queries and indexes:

bench --site site1.local optimize-database

Configure Redis memory limits and eviction policies:

sudo nano /etc/redis/redis.conf

Monitor application performance:

bench --site site1.local execute frappe.utils.bench_helper.show_config

Implement database query caching and optimize slow queries using MariaDB’s slow query log.

Congratulations! You have successfully installed ERPNext. Thanks for using this tutorial for installing ERPNext on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official ERPNext website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button