Skip to content

Instantly share code, notes, and snippets.

@ascorbic-acid
Last active September 16, 2024 18:02
Show Gist options
  • Save ascorbic-acid/450b40c384c6cd06f6ec997f732260a3 to your computer and use it in GitHub Desktop.
Save ascorbic-acid/450b40c384c6cd06f6ec997f732260a3 to your computer and use it in GitHub Desktop.
Install ERPNext v14 or v15 on Ubuntu 22.04 Production or Develop

Install ERPNext v14 or v15 on Ubuntu 22.04 Production or Develop

feel free to edit the parameters to suite your needs
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install software-properties-common \
nginx wget zip unzip git curl certbot python3-pip \
python3-dev python3-venv redis-server mariadb-server \
mariadb-client xvfb libfontconfig xfonts-75dpi \
fontconfig libxrender1

get wkhtmltopdf qt patched

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb

config mariadb

sudo nano /etc/mysql/my.cnf

and add the following at the bottom then save

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_buffer_pool_size = 2048M # select your best value

[mysql]
default-character-set = utf8mb4

now lets restart mariadb

sudo service mariadb restart
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc; nvm install 20

add node & npm link to /usr/bin to avoid supervisor.conf not having node entry and therefore socketio io not working

sudo ln -s $(which node) /usr/bin/node
sudo ln -s $(which npm) /usr/bin/npm
npm install -g yarn

Configure mariadb for the first time

sudo mysql_secure_installation

Install Bench CLI

sudo pip3 install frappe-bench

Create new frappe bench env (here i choose v15 and name it erp15)

bench init erp15 --version version-15 --verbose --install-app erpnext
cd erp15 && bench get-app payments --branch version-15; bench get-app hrms --branch version-15

Create our first Site

bench new-site my-site-name.local --install-app erpnext

fix permissions issue in Ubuntu 22.04, where page loads with missing styles (only run this command if you got that issue)

sudo chmod 755 /home/$(echo $USER)

We now have ready Frappe Dev Env. To setup Production Env Continue Below Steps.

sudo bench setup production $USER
sudo sed -i '6i chown='"$USER"':'"$USER"'' /etc/supervisor/supervisord.conf
bench config dns_multitenant on
sudo service supervisor restart
sudo bench setup production $USER

Enable scheduler

bench --site my-site-name.local scheduler enable
bench --site my-site-name.local scheduler resume
bench restart

DONE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment