This guide provides step-by-step instructions for installing ERPNext on an Ubuntu 22.04 server.
- Ubuntu 22.04 Server: A clean Ubuntu 22.04 server instance.
- Root or sudo access: You'll need root or sudo privileges to install software.
- Internet connection: For downloading packages.
- Python 3.10+
- Node.js 18+ (LTS)
- Redis 6+
- MariaDB 10.6+
- yarn 1.22+
- pip 23+
- wkhtmltopdf (patched qt)
- cron
- NGINX
First, update your system and install essential tools.
sudo apt update && sudo apt upgrade -y
sudo apt install git curl wget software-properties-common -y
Configuring the firewall before starting the bench is highly recommended.
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 8000
sudo ufw enable
sudo ufw status
sudo apt-get install dirmngr
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirrors.xtom.com/mariadb/repo/10.11/ubuntu jammy main'
sudo apt update
sudo apt install mariadb-server -y
sudo mysql_secure_installation
Follow the prompts to set a root password and secure your MariaDB installation.
sudo apt install libmariadb-dev -y
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add or modify the following lines under [mysqld]
:
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
Add or modify the following lines under [client-mariadb]
:
default-character-set = utf8mb4
sudo systemctl restart mariadb
sudo apt install redis-server -y
sudo systemctl enable redis
sudo systemctl start redis
Verify Redis is running:
systemctl status redis
Open the Redis configuration file:
sudo vim /etc/redis/redis.conf
Modify these settings:
supervised systemd
maxmemory 256mb
maxmemory-policy allkeys-lru
Save and exit Vim (ESC, :wq, then Enter).
Restart Redis to apply changes:
sudo systemctl restart redis
bench doctor
If Redis is misconfigured, errors related to queueing or caching may appear.
bench setup redis
bench restart
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs -y
sudo npm install -g yarn
Ubuntu 22.04 comes with Python 3.10 pre-installed. Ensure pip is updated.
sudo apt install python3-dev python3-venv -y
python3 -m pip install --upgrade pip
sudo apt install xvfb libfontconfig wkhtmltopdf -y
sudo python3 -m pip install frappe-bench
bench init frappe-bench --frappe-branch version-14
cd frappe-bench
bench new-site yoursite.com
Replace yoursite.com
with your desired site name.
bench get-app erpnext --branch version-14
bench --site yoursite.com install-app erpnext
bench --site yoursite.com set-admin-password yourpassword
bench --site yoursite.com migrate
Replace yourpassword
with a strong password.
bench start
You can now access ERPNext in your browser at http://your_server_ip:8000
.
sudo adduser erpnext-user
sudo usermod -aG sudo erpnext-user
su - erpnext-user
Repeat steps 8-11 inside the new user's home directory.
sudo bench setup production erpnext-user
sudo bench restart
sudo bench setup nginx
sudo systemctl reload nginx
sudo systemctl restart supervisor
Point your domain name to your server's IP address.
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yoursite.com
Follow the prompts to configure HTTPS.
bench config dns_multitenant off
bench new-site site2.com
bench set-nginx-port site2.com 82
bench setup nginx
sudo systemctl reload nginx
sudo systemctl restart supervisor
- Replace placeholders like
yoursite.com
,yourpassword
, andyour_server_ip
with your actual values. - Always use strong passwords.
- Keep your system and ERPNext installation updated.
- Always backup your data before making changes.
- When troubleshooting, use commands like
bench --site yoursite.com doctor
, and check the NGINX and Supervisor logs. - To update the database of the browsers list, use:
inside the
npx browserslist@latest --update-db yarn upgrade caniuse-lite browserslist
frappe-bench
folder.
This comprehensive guide should help you successfully install and configure ERPNext on your Ubuntu 22.04 server. Remember to adapt the steps to your specific environment.