This is how I’m trying to install erpnext on my vps running Ubuntu 22.04 LTS:
Add a new user
sudo adduser erpadmin
sudo usermod -aG sudo erpadmin
su - erpadmin
1. Update your system (Ubuntu)
sudo apt update && sudo apt -y full-upgrade
Now reboot:
sudo reboot
2. Install GIT
sudo apt-get install git
3. Install pythonc api
sudo apt-get install python3-dev
4. Install PIP and Setuptools for python
sudo apt-get install python3-setuptools python3-pip
5. Install virtual environment for python
sudo apt-get install virtualenv
6. Install MariaDB
sudo apt-get install software-properties-common
sudo apt install mariadb-server
7. Setup MariaDB’s root password and other settings
sudo mysql_secure_installation
$ Enter current password for root (enter for none): press enter here
$ Switch to unix_socket authentication [Y/n] n
$ Change the root password? [Y/n] y
$ New password: *enter your password here*
$ Re-enter new password: *enter your password here again*
$ Remove anonymous users? [Y/n] y
$ Disallow root login remotely? [Y/n] n
$ Remove test database and access to it? [Y/n] y
$ Reload privilege tables now? [Y/n] y
8. Install MYSQL C development library
sudo apt-get install libmysqlclient-dev
9. Edit MariaDB’s configuration file using nano (or vi whatever text editor you are comfortable with)
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add the following to the file:
[server]
user = mysql
pid-file = /run/mysqld/mysqld.pid
socket = /run/mysqld/mysqld.sock
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
bind-address = 127.0.0.1
query_cache_size = 16M
log_error = /var/log/mysql/error.log
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Now these find these lines in the file, it should be under # * Character sets
and comment them out using # :
# character-set-server = utf8mb4
# collation-server = utf8mb4_general_ci
Press Ctrl+S to save the edited file and Ctrl+X to exit.
Now restart MYSQL again:
sudo service mysql restart
10. Install Redis server
sudo apt-get install redis-server
11. Install Node.js 14.X
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 14.15.0
12. Install NPM and Yarn (package managers)
sudo apt-get install npm
sudo npm install -g yarn
13. Install wkhtmltopdf
sudo apt-get install xvfb libfontconfig wkhtmltopdf
14. Install Bench
sudo -H pip3 install frappe-bench
bench --version
15. Initialize Bench
bench init frappe-bench
16. Create your site for Bench and set it as the default site for Bench
cd frappe-bench/
bench new-site erp.mysite.com
bench use erp.mysite.com
17. Install Erpnext your Bench site
bench get-app erpnext
bench --site erp.mysite.com install-app erpnext
18. Start your Bench and migrate your site
bench start
bench migrate
Now everything works fine in development mode and I am able to login normally but when I try to switch to production mode, I run into multiple errors:
First I try normally switching to production mode using:
sudo bench setup production erpadmin
and it worked without any errors, then I ran:
bench restart
which returned:
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
So I thought of rebooting my vps and trying again and unfortunately it didn’t work so I tried manually rebooting the vps from my dashboard and re-running bench restart
and once again it threw up the same error.
Then I tried these following commands:
bench setup supervisor
sudo supervisorctl reread
sudo supervisorctl reload
sudo supervisorctl restart all
and I keeps throwing up the same frappe: ERROR (no such group)
error.
The site (my ip without the 8000 port) was showing this:
I finally rebooted my vps again ran bench restart
again and it threw up the same error but when I checked my site again:
I have been pulling my hair out trying to fix this production mode issue for the last week.
I am guessing this is a nginx config issue since the site is unable to pull some of the resources in the error logs as it seems?
HELP