Installazione di Frappe 15 su Ubuntu WSL: Guida Completa Passo-Passo (e unattended)
Guida dettagliata per installare Frappe 15 (e ERPNext) su Ubuntu via WSL. Ottimizzata per performance e compatibilità.

Frappe, il framework dietro ERPNext, è una piattaforma per la creazione di applicazioni web complesse.

📋 Prerequisiti
Questa guida presuppone che tu stia usando WSL2 con Ubuntu 22.04 o superiore installato. È ideale per chi desidera sviluppare localmente in un ambiente leggero.
🎁 Bonus: Setup completo e unattended in un solo script alla fine dell'articolo.
Step 1. Aggiorna il sistema
sudo apt update && sudo apt upgrade -y
Step 2. Installa Git
sudo apt install git -y
Step 3. Installa Python 3.12 e strumenti di sviluppo
sudo apt install python3.12 python3.12-dev python3.12-venv -y
Step 4. Installa pip, setuptools e virtualenv
sudo apt install python3-pip python3-setuptools virtualenv -y
Step 5. Installa MariaDB
sudo apt install mariadb-server mariadb-client -y
sudo mysql_secure_installation
Step 6. Configura MariaDB per Frappe
utf8mb4
.sudo tee -a /etc/mysql/my.cnf <<EOF
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
EOF
sudo service mysql restart
Step 7. Installa librerie client per MariaDB
sudo apt install libmysqlclient-dev -y
Step 8. Installa Redis
sudo apt install redis-server -y
sudo systemctl enable redis --now

Step 9. Installa Node.js tramite NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18
node -v
Step 10. Installa Yarn
npm install -g yarn

Step 11. Installa wkhtmltopdf
sudo apt install xvfb libfontconfig wkhtmltopdf -y

Step 12. Installa Bench con UV
bench
.curl -LsSf https://astral.sh/uv/install.sh | sh
echo "alias bench='uvx --from frappe-bench bench'" >> ~/.bashrc
source ~/.bashrc
Step 13. Inizializza Bench
bench init frappe-bench --frappe-branch version-15
cd frappe-bench
Step 14. Avvia il server di sviluppo
bench start
Step 15. Crea un nuovo sito
bench new-site site1.localhost
Step 16. (Opzionale) Installa ERPNext
bench get-app erpnext --branch version-15
bench --site site1.localhost install-app erpnext

Step Finale: Accedi al sito
Apri il browser e vai su:
http://localhost:8000
Login: Administrator
con password scelta durante bench new-site
.
🎁 Bonus: Setup completo e unattended in un solo script
Salva questo contenuto in un file chiamato frappe_setup.sh
, rendilo eseguibile (chmod +x frappe_setup.sh
) e poi esegui (./frappe_setup.sh
).
#!/bin/bash
set -e
# 1. Aggiorna sistema
sudo apt update && sudo apt upgrade -y
# 2. Installa strumenti base
sudo apt install -y git curl python3.12 python3.12-dev python3.12-venv \
python3-pip python3-setuptools virtualenv mariadb-server mariadb-client \
libmysqlclient-dev redis-server xvfb libfontconfig wkhtmltopdf \
build-essential
# 3. Configura MariaDB
sudo tee /etc/mysql/my.cnf > /dev/null <<EOF
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
EOF
sudo service mysql restart
sudo mysql_secure_installation
# 4. Abilita Redis
sudo systemctl enable redis --now
# 5. Installa NVM e Node.js 18
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm install 18
nvm use 18
# 6. Installa Yarn
yarn --version || npm install -g yarn
# 7. Installa UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# 8. Alias Bench
if ! grep -q 'alias bench=' ~/.bashrc; then
echo "alias bench='uvx --from frappe-bench bench'" >> ~/.bashrc
fi
source ~/.bashrc
# 9. Inizializza Bench e Frappe
bench init frappe-bench --frappe-branch version-15
cd frappe-bench
# 10. Crea nuovo sito
bench new-site site1.localhost --admin-password admin
# 11. (Opzionale) Installa ERPNext
read -p "Vuoi installare anche ERPNext? (s/n): " install_erp
if [[ "$install_erp" == "s" ]]; then
bench get-app erpnext --branch version-15
bench --site site1.localhost install-app erpnext
fi
# 12. Avvia server
bench start
✅ Risultato
Alla fine del processo:
- avrai un'istanza funzionante di Frappe 15 (con o senza ERPNext)
- potrai accedere da browser su
http://localhost:8000
Login: Administrator
/ admin
(o la password che hai indicato)