Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install ERPNext on Ubuntu 24.04 Step-by-Step Guide

How to Install ERPNext on Ubuntu 24.04 Step-by-Step Guide

ERPNext is a comprehensive open-source Enterprise Resource Planning (ERP) system that helps businesses streamline their operations, manage accounting, HR, manufacturing, and more from a single platform. Installing ERPNext on Ubuntu 24.04 allows you to set up a robust, scalable, and customizable ERP system on a Linux server, ideal for small to medium-sized enterprises or developers wanting to experiment with ERPNext. Before starting, ensure your server meets the minimum requirements, has a clean Ubuntu 24.04 installation, and that you have root or sudo access.

What You’ll Need

  • Ubuntu 24.04 server or desktop with a clean installation
  • Root or sudo privileges
  • At least 8 GB RAM (16 GB recommended for production)
  • Minimum 50 GB disk space
  • Domain name (optional but recommended)
  • Basic knowledge of Linux terminal commands
  • Internet connection with stable bandwidth

Step-by-Step

  1. Update your system packages: Open a terminal and run:
    sudo apt update && sudo apt upgrade -y

    This ensures all existing packages are up to date, reducing compatibility issues later.

  2. Install required dependencies: Install essential packages with:
    sudo apt install -y git python3-pip python3-venv nodejs npm redis-server curl

    This installs Git for cloning repositories, Python dependencies, Node.js for front-end assets, Redis for caching, and curl for downloading files.

  3. Set up Python environment: Create a dedicated user for ERPNext (recommended for security):
    sudo adduser erpnext --gecos "ERPNext User" --disabled-password
    

    Switch to the new user:

    sudo -i -u erpnext
  4. Clone the ERPNext bench repository: As the erpnext user, run:
    git clone https://github.com/frappe/bench.git ~/bench-repo
    cd ~/bench-repo
    

    This repository contains the tools needed to manage ERPNext instances.

  5. Install Bench CLI: Still as the erpnext user, run:
    pip3 install --user --upgrade pip
    pip3 install --user bench

    Add ~/.local/bin to your PATH if needed:

    export PATH=$PATH:~/.local/bin
  6. Create a new bench instance: Initialize a new ERPNext site with:
    bench init frappe-bench --frappe-branch version-13

    Replace ‘version-13’ with the desired ERPNext version. Navigate into the directory:

    cd frappe-bench
  7. Create a new site and install ERPNext: Run:
    bench new-site yourdomain.com

    Follow prompts to set administrator password and database credentials. Then, install ERPNext app:

    bench get-app erpnext --branch version-13
    bench --site yourdomain.com install-app erpnext
  8. Set up a production environment: Install supervisor and nginx:
    sudo apt install -y supervisor nginx

    Configure supervisor to manage ERPNext workers and set up nginx as a reverse proxy for access via your domain.

  9. Start ERPNext services: Run:
    bench setup production yourdomain.com
    sudo supervisorctl reread
    sudo supervisorctl update
    sudo supervisorctl restart all

    This will launch ERPNext in a production-ready environment accessible via your domain or server IP.

  10. Access your ERPNext instance: Open a browser and navigate to http://yourdomain.com or your server IP. Log in with the administrator credentials you set earlier.

Common Mistakes

  • Failing to update system packages before starting, leading to dependency issues.
  • Not creating a dedicated user, which can cause permission problems or security risks.
  • Using incompatible ERPNext or Frappe branches; always verify branch compatibility.
  • Skipping the setup of nginx or supervisor, resulting in ERPNext not running properly or being inaccessible.
  • Not configuring DNS or SSL for production, which can compromise security and accessibility.

Tips

  • Always back up your data before performing major updates or migrations.
  • Use a domain name and SSL certificate (via Let’s Encrypt) for production to ensure secure access.
  • Monitor server resources and logs regularly to troubleshoot performance issues.
  • Document your setup process for easier maintenance and future upgrades.
  • Join ERPNext community forums for support and best practices.

Troubleshooting

If ERPNext does not start or behaves unexpectedly, consider the following steps:

  • Check logs: Review logs located in ~/frappe-bench/logs for errors related to supervisor, nginx, or ERPNext itself.
  • Verify services: Ensure all ERPNext services are running:
    sudo supervisorctl status
  • Rebuild assets: Sometimes, clearing and rebuilding assets helps:
    bench build
  • Restart services: Restart the bench services:
    bench restart
  • Check domain and DNS: Make sure your domain points correctly to your server IP and that SSL certificates are valid if used.
  • Update ERPNext: Run:
    bench update --upgrade

    to get the latest fixes and features.

If problems persist, consult the ERPNext community forums or official documentation for specific issues.

Frequently Asked Questions

1. Can I install ERPNext on a desktop Ubuntu 24.04 or only on servers?

While technically possible on a desktop, it’s recommended to install on a dedicated server environment for better stability, security, and performance.

2. Is ERPNext installation on Ubuntu 24.04 secure?

Security depends on proper configuration, including setting up firewalls, SSL certificates, and regular updates. Follow best security practices during setup.

3. How do I update ERPNext after installation?

Navigate to your bench directory and run bench update --upgrade. Always back up before upgrading.

4. Can I run multiple ERPNext sites on one server?

Yes, using bench, you can create multiple sites with separate configurations, but ensure your server has adequate resources.

5. What are common post-installation issues?

Common issues include service startup failures, DNS or SSL misconfigurations, and permission errors. Logs are your best troubleshooting tool.

Related

How to Install ERPNext on Ubuntu 24.04 Step-by-Step Guide
Scroll to top