Frappe Installation Steps v16 production Ubuntu

Frappe v16 Native Installation

update

# apt update

add user frappe

# adduser frappe

adding user frappe to sudo

# usermod -aG sudo frappe

switch to user frappe

# su - frappe

install dependencies

sudo apt install -y git redis-server mariadb-server mariadb-client libmariadb-dev libmariadb-dev-compat pkg-config xvfb libfontconfig cron curl build-essential gcc certbot python3-certbot-nginx -y

Install pip

sudo apt install python3-pip

setting mariadb password

sudo mariadb-secure-installation

configure mariadb by adding the parameters

sudo vim /etc/mysql/my.cnf
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4

restart the mariadb server

sudo systemctl restart mariadb

install dependency

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

sudo apt install -f -y

Install Node

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

source ~/.bashrc

Install NVM

nvm install 24
nvm use 24
node -v

Install YARN

npm install -g yarn
npm install -g npm@11.7.0

Install UV

curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc

Set Python Version

uv python install 3.14 --default

Check version

python --version

Install Frappe-Bench

uv tool install frappe-bench
bench --version

initiate the bench

mkdir ~/frappe

cd ~/frappe

bench init --frappe-branch version-16 frappe-bench

navigate to the bench directory

cd frappe-bench

Change user directory permissions

chmod -R o+rx /home/frappe/
bench setup procfile

Activate the env

source env/bin/activate

Install Ansible

pip3 install ansible

Install honcho for manager

pip install honcho

Create a new site

bench new-site erpnext.yoursite.in

get app erpnext (use same frappe version if mismatch cause error)

bench get-app --branch v16.0.0 https://github.com/frappe/erpnext.git

start bench

bench start

Create a New terminal and login the same server for below steps

su - frappe
cd frappe

cd frappe-bench

source env/bin/activate
bench --site erpnext.yoursite.in install-app erpnext

set the app in production mode

enable the scheduler

$ bench --site erpnext.yoursite.in enable-scheduler

Disable maintenance mode

$ bench --site erpnext.yoursite.in set-maintenance-mode off

set the path

$ bench setup env --python PATH="$PATH"

set sudo access to the user in venv

$ sudo -E env PATH="$PATH" bench setup sudoers $(whoami)

Setup production config

$ sudo -E env PATH="$PATH" bench setup production frappe

reload the nginx

$ sudo systemctl reload nginx

Setup NGINX to apply the changes

$ bench setup nginx

Restart Supervisor and Launch Production Mode

$ sudo supervisorctl restart all
$ sudo -E env PATH="$PATH" bench setup production frappe
$ sudo systemctl reload nginx

set lets encrypt ssl for the application

$ sudo certbot --nginx

https://erpnext.yoursite.in

Stop the bench on old tab , Restart Supervisor and Launch Production Mode

$ sudo supervisorctl restart all
2 Likes

Hi !

I have a problem in this stage :

sudo -E env PATH="$PATH" bench setup production frappe
[sudo] password for frappe: 
Setting Up prerequisites...
$ sudo /home/frappe/.local/share/uv/tools/frappe-bench/bin/python -m pip install ansible
/home/frappe/.local/share/uv/tools/frappe-bench/bin/python: No module named pip
ERROR: sudo /home/frappe/.local/share/uv/tools/frappe-bench/bin/python -m pip install ansible
subprocess.CalledProcessError: Command 'sudo /home/frappe/.local/share/uv/tools/frappe-bench/bin/python -m pip install ansible' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/frappe/.local/bin/bench", line 10, in <module>
    sys.exit(cli())
             ~~~^^
  File "/home/frappe/.local/share/uv/tools/frappe-bench/lib/python3.14/site-packages/bench/cli.py", line 132, in cli
    bench_command()
    ~~~~~~~~~~~~~^^
  File "/home/frappe/.local/share/uv/tools/frappe-bench/lib/python3.14/site-packages/bench/commands/setup.py", line 110, in setup_production
    setup_production(user=user, yes=yes)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/.local/share/uv/tools/frappe-bench/lib/python3.14/site-packages/bench/config/production_setup.py", line 37, in setup_production
    setup_production_prerequisites()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/frappe/.local/share/uv/tools/frappe-bench/lib/python3.14/site-packages/bench/config/production_setup.py", line 26, in setup_production_prerequisites
    exec_cmd(f"sudo {sys.executable} -m pip install ansible")
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/.local/share/uv/tools/frappe-bench/lib/python3.14/site-packages/bench/utils/__init__.py", line 193, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: sudo /home/frappe/.local/share/uv/tools/frappe-bench/bin/python -m pip install ansible


Any Ideas ?

Thanks a lot for your work !

its an python pip issue first install pip on without env ``sudo apt install python3-pip```

Hi !

its an python pip issue first install pip on without env ``sudo apt install python3-pip```

This was already done…

I am using ubuntu24 Server… what version do you use ?

See, Ubuntu 24
cat /etc/os-release
PRETTY_NAME=“Ubuntu 24.04.3 LTS”
NAME=“Ubuntu”
VERSION_ID=“24.04”
VERSION=“24.04.3 LTS (Noble Numbat)”
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/”
SUPPORT_URL=“https://help.ubuntu.com/”
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/”
PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy”
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

same..

my PATH Variable on user frappe :

PATH=/home/frappe/.local/bin:/home/frappe/.local/bin:/home/frappe/.nvm/versions/node/v24.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/us
r/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

frappe@frappe:~/frappe/frappe-bench$ echo $PATH
/home/frappe/.local/bin:/home/frappe/.local/bin:/home/frappe/.nvm/versions/node/v24.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Same.. interesting.

Okay.. now it seems to work.

I updated bench to the brand new version.. and follow your updated steps.

EXITING ! SHINY ! THANKS A LOT ! I HAVE NOW A RUNNING VM !!!

When can we expect the Docker installation to be available?