Frappe Production Setup in AWS

Blog Intro

 · 2 min read

Update and Upgrade Packages


sudo apt-get update -y
sudo apt-get upgrade -y


Create a new user – (bench user)


sudo adduser frappe
sudo usermod -aG sudo frappe
sudo su frappe
cd /home/frappe


Install Required Packages


Install GIT

sudo apt-get install git


Install Python

sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils


Install Python Virtual Environment

sudo apt-get install python3.10-venv


Install Software Properties Common

sudo apt-get install software-properties-common


Install MariaDB

sudo apt install mariadb-server mariadb-client


Install Redis Server

sudo apt-get install redis-server


Install other packages

sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev


Configure MYSQL Server

sudo mysql_secure_installation


When you run this command, the server will show the following prompts. Please follow the steps as shown below to complete the setup correctly.

  1. Enter current password for root: (Enter your SSH root user password)
  2. Switch to unix_socket authentication [Y/n]: Y
  3. Change the root password? [Y/n]: Y

  It will ask you to set new MySQL root password at this step. This can be different from the SSH root user password.

  1. Remove anonymous users? [Y/n] Y
  2. Disallow root login remotely? [Y/n]: N
  3. Remove test database and access to it? [Y/n]: Y
  4. Reload privilege tables now? [Y/n]: Y


Edit MYSQL default config file

sudo nano /etc/mysql/my.cnf


Add the following block of code exactly as is:

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4


Restart the MYSQL Server

sudo service mysql restart


Install CURL

sudo apt install curl


Install Node

# 1. Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# 2. Load NVM (for current shell session)
source ~/.bashrc    # or source ~/.profile, depending on your shell

# 3. Install Node.js 18
nvm install 18

# 4. Set default Node version (so it loads automatically)
nvm use v18.20.8
nvm alias default v18.20.8

# 5. Verify
node -v
npm -v


Install NPM

sudo apt-get install npm


Install Yarn

sudo npm install -g yarn


Install Frappe Bench

sudo pip3 install frappe-bench


Initialize Frappe Bench

bench init --frappe-branch version-15 frappe-bench


Switch directories into the Frappe Bench directory

cd frappe-bench


Change user directory permissions

chmod -R o+rx /home/frappe


Create a New Site

bench new-site [site-name]


Setting ERPNext for Production


Enable Scheduler

bench --site [site-name] enable-scheduler


Disable maintenance mode

bench --site [site-name] set-maintenance-mode off


Setup production config

sudo bench setup production frappe


Setup NGINX to apply the changes

bench setup nginx


Restart Supervisor and Launch Production Mode

sudo supervisorctl restart all
sudo bench setup production frappe

No comments yet.

Add a comment
Ctrl+Enter to add comment