Update your system:
sudo apt-get update && sudo apt-get upgrade
Install dependencies:
sudo apt-get install python3-dev python3-setuptools python3-pip python3-venv
sudo apt-get install mariadb-server mariadb-client libmysqlclient-dev
sudo apt-get install redis-server
sudo apt-get install xvfb libfontconfig wkhtmltopdf
Set up MariaDB:
sudo mysql_secure_installation
Create a new database and user:
CREATE DATABASE erpnext;
CREATE USER 'erpnextuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON erpnext.* TO 'erpnextuser'@'localhost';
FLUSH PRIVILEGES;
Install ERPNext:
sudo pip3 install frappe-bench
bench init erpnext && cd erpnext
bench get-app erpnext
bench new-site erpnext.local
bench install-app erpnext
bench start
---
- hosts: localhost
become: yes
tasks:
- name: Update and upgrade apt packages
apt:
update_cache: yes
upgrade: dist
- name: Install dependencies
apt:
name:
- python3-dev
- python3-setuptools
- python3-pip
- python3-venv
- mariadb-server
- mariadb-client
- libmysqlclient-dev
- redis-server
- xvfb
- libfontconfig
- wkhtmltopdf
state: present
- name: Secure MariaDB installation
expect:
command: mysql_secure_installation
responses:
"Enter current password for root (enter for none):": ""
"Set root password? [Y/n]": "Y"
"New password:": "your_root_password"
"Re-enter new password:": "your_root_password"
"Remove anonymous users? [Y/n]": "Y"
"Disallow root login remotely? [Y/n]": "Y"
"Remove test database and access to it? [Y/n]": "Y"
"Reload privilege tables now? [Y/n]": "Y"
- name: Create a new database
mysql_db:
name: erpnext
state: present
- name: Create a new database user
mysql_user:
name: erpnextuser
password: password
priv: 'erpnext.*:ALL'
host: localhost
state: present
- name: Install Frappe Bench
pip:
name: frappe-bench
- name: Initialize Frappe Bench
command: bench init erpnext
args:
chdir: /home/{{ ansible_user }}/
- name: Get ERPNext app
command: bench get-app erpnext
args:
chdir: /home/{{ ansible_user }}/erpnext
- name: Create a new site
command: bench new-site erpnext.local
args:
chdir: /home/{{ ansible_user }}/erpnext
- name: Install ERPNext app
command: bench install-app erpnext
args:
chdir: /home/{{ ansible_user }}/erpnext
- name: Start Bench
command: bench start
args:
chdir: /home/{{ ansible_user }}/erpnext