Installing Frappe Framework v15 in Ubuntu: Including Production Setup

Guide to Install Frappe v15 in Ubuntu 22.04 LTS

 · 2 min read

Guide to Install Frappe Framework version 15 in Ubuntu 22.04 LTS


Follow these steps to ensure a successful installation of Frappe Version 15 on your Ubuntu 22.04 LTS system.


1. Prepare System Dependencies:


Install essential software for managing repositories:

sudo apt install software-properties-common


2. Python Installation:

Add the deadsnakes PPA for Python:

sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update


Install Python 3.11:

sudo apt install python3.11

Check if it is installed properly

python3.11 --version


Get the full Python 3.11 package:

sudo apt install python3.11-full


Install additional development tools:

sudo apt-get install python3-dev python3-setuptools python3-pip python3.11-venv


3. Database Setup (MariaDB):

Install MariaDB server:

sudo apt install mariadb-server


Secure your MariaDB installation:

sudo mysql_secure_installation


Install necessary MySQL database development files:

sudo apt-get install libmysqlclient-dev


Configure MariaDB settings:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf


use this in the 50-server.cnf 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


Restart MariaDB:

sudo service mysql restart


4. Redis Installation:

Install Redis server:

sudo apt-get install redis-server

5. Node.js and Yarn Setup:

Install Node Version Manager (nvm):

sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile

Install Node.js 18.X

nvm install 18


Install Yarn:

sudo apt-get install npm
sudo npm install -g yarn


6. wkhtmltopdf installation

Install wkhtmltopdf dependencies:

sudo apt-get install xvfb libfontconfig wkhtmltopdf


[Optional]: Setting Up Production Environment

To isolate the Frappe setup in a dedicated user environment:

[Optional]:Create a New User:

sudo adduser frappe-user
sudo usermod -aG sudo frappe-user
su - frappe-user

You'll switch to the newly created user "frappe-user" to perform the following steps.


7. Frappe Installation:

Install Frappe Bench using pip3:

sudo -H pip3 install frappe-bench

Check the installed Bench version:

bench --version


8. Initialize Frappe Bench and Install Frappe Version 15:

Initialize the Frappe Bench with Python 3.11:

bench init frappe-bench --frappe-branch version-15 --python python3.11


After completing the installation, navigate to the frappe-bench directory and create sites and apps..


[Optional]Setup Production:

Configure Frappe Bench for production use:

sudo bench setup production frappe-user
bench restart

Open a web browser and navigate to the server's IP address to access the production instance.


Fix for supervisor

bench setup socketio
bench setup supervisor
bench setup redis
sudo supervisorctl reload


bench restart


Fix for css

sudo chmod -R o+rx /home/frappe-user

Aikyam Fellows Blog

Learn more about Aikyam Fellows


Jinso Raj

Fellow at t4glabs

No comments yet.

Add a comment
Ctrl+Enter to add comment