Guides 11792 Published by

The guide walks a user through setting up an open‑source ERP system—specifically ERPNext—on an Ubuntu 20.04 server, covering prerequisites and basic updates first. It then installs MariaDB with security hardening, adds the Frappe bench tool via pip, and configures the shell path so bench commands can be run easily. Next, a new bench instance is bootstrapped with the latest code, optional MySQL skipping for machines with enough RAM, followed by creating an ERPNext site tied to a chosen hostname or localhost. Finally, the app is deployed, services started, and production considerations such as HTTPS, cron jobs, and log monitoring are highlighted to complete the setup.



How to Install ERPNext on Ubuntu 20.04

If you’re looking to run an open‑source ERP system right on your own server, this quick guide shows how to get ERPNext up and running on Ubuntu 20.04. It covers the bare minimum packages, a sane MariaDB setup, Redis, Node.js, and the bench bootstrap that makes everything work together.

1. Get ready: the prerequisites
  • Make sure you’re logged in as a user with sudo rights.
  • Update your system so you’re not pulling from stale repos:
sudo apt update && sudo apt upgrade -y

The upgrade will patch known bugs that might otherwise trip up the later install steps.

2. Install MariaDB and secure it

ERPNext depends on MySQL‑compatible storage, so we’ll use MariaDB because it ships with Ubuntu 20.04.

sudo apt install mariadb-server -y
sudo mysql_secure_installation

During mysql_secure_installation set a strong root password, remove anonymous users, disallow remote root logins, and delete the test database. These steps are trivial but avoid headaches later when you try to create a new ERPNext user.

3. Add the Frappe repository and install bench

The easiest way to keep your ERPNext installation up‑to‑date is via the bench CLI from the Frappe team.

sudo apt install python3-pip -y
pip3 install frappe-bench --user

Add the bench binary path to your shell profile so you can run it without typing the full path:

echo 'export PATH=$PATH:$(python3 -c "import site; print(site.USER_BASE)")/bin' >> ~/.profile
source ~/.profile
4. Bootstrap a new bench instance

Create a fresh directory for your ERPNext stack and bootstrap it. This pulls the latest Frappe & ERPNext code, installs Node.js and Yarn (which bench needs), and sets up virtual environments.

mkdir ~/erpnext-bench && cd ~/erpnext-bench
bench init erpnext-bench --frappe-path https://github.com/frappe/bench.git --python python3.8

If you’re on a machine with more than 4 GB RAM, consider adding --with-mysql and --mysql-user root flags to skip the MySQL installation that bench would otherwise try.

5. Create an ERPNext site

Now tell bench to spin up your first site, providing it with a domain or IP you’ll use later for HTTPS.

cd ~/erpnext-bench/bench-sessions
bench new-site erp.example.com --mariadb-root-password YOUR_ROOT_PASS --admin-password admin123

Replace erp.example.com with the hostname you plan to point at this machine. If you’re only testing locally, just use localhost.

6. Deploy ERPNext and start services
bench get-app erpnext https://github.com/frappe/erpnext.git --branch version-13
bench --site erp.example.com install-app erpnext

Then launch the stack:

bench start

Your ERPNext instance will now be listening on http://localhost:8000. Open that URL in a browser and log in with the admin credentials you set earlier.

7. Make it production‑ready
  • Enable HTTPS – Use Certbot or another ACME client to get Let’s Encrypt certs.
  • Set up cron jobs – bench setup worker ensures background tasks run.
  • Monitor logs – Keep an eye on /home/username/erpnext-bench/logs/*.log.

I’ve seen people hit the dreaded “socket timeout” error when installing via pip on older Ubuntu releases. It’s usually because the default Python 3 version is missing some dependencies that bench expects. That’s why we explicitly install python3-pip and use the latest stable Python from Ubuntu 20.04.

And there you have it: a working ERPNext installation on Ubuntu 20.04, ready for real data, custom modules, or a full‑blown business system.