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 -yConfiguring 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 statussudo 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 updatesudo apt install mariadb-server -ysudo mysql_secure_installationFollow the prompts to set a root password and secure your MariaDB installation.
sudo apt install libmariadb-dev -ysudo nano /etc/mysql/mariadb.conf.d/50-server.cnfAdd or modify the following lines under [mysqld]:
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ciAdd or modify the following lines under [client-mariadb]:
default-character-set = utf8mb4sudo systemctl restart mariadbsudo apt install redis-server -ysudo systemctl enable redis
sudo systemctl start redisVerify Redis is running:
systemctl status redisOpen the Redis configuration file:
sudo vim /etc/redis/redis.confModify these settings:
supervised systemd
maxmemory 256mb
maxmemory-policy allkeys-lruSave and exit Vim (ESC, :wq, then Enter).
Restart Redis to apply changes:
sudo systemctl restart redisbench doctorIf Redis is misconfigured, errors related to queueing or caching may appear.
bench setup redis
bench restartcurl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs -ysudo npm install -g yarnUbuntu 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 pipsudo apt install xvfb libfontconfig wkhtmltopdf -ysudo python3 -m pip install frappe-benchbench init frappe-bench --frappe-branch version-14
cd frappe-benchbench new-site yoursite.comReplace yoursite.com with your desired site name.
bench get-app erpnext --branch version-14
bench --site yoursite.com install-app erpnextbench --site yoursite.com set-admin-password yourpassword
bench --site yoursite.com migrateReplace yourpassword with a strong password.
bench startYou 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-userRepeat steps 8-11 inside the new user's home directory.
sudo bench setup production erpnext-usersudo bench restartsudo bench setup nginx
sudo systemctl reload nginxsudo systemctl restart supervisorPoint your domain name to your server's IP address.
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yoursite.comFollow the prompts to configure HTTPS.
bench config dns_multitenant offbench new-site site2.combench set-nginx-port site2.com 82bench setup nginx
sudo systemctl reload nginxsudo systemctl restart supervisor- Replace placeholders like
yoursite.com,yourpassword, andyour_server_ipwith 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-benchfolder.
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.