Installazione ERP · 9 min read · Sep 22, 2025

Come installare ERPNext su Ubuntu 22.04

ERPNext è un software ERP gratuito e open-source utilizzato da produttori, distributori e servizi. È costruito con Python, JavaScript e Frappe Framework. È moderno, facile da usare, gratuito e progettato per piccole e medie imprese che aiutano le aziende a gestire tutti gli aspetti delle loro operazioni aziendali. Migliaia di aziende in tutto il mondo lo utilizzano per gestire i loro processi ERP. È uno dei migliori sistemi ERP che supporta produzione, distribuzione, vendita al dettaglio, commercio, servizi, istruzione, organizzazioni non profit e altro ancora.

In questo tutorial, ti mostreremo come installare il software ERPNext su un server Ubuntu 22.04.

Prerequisiti

  • Un server che esegue Ubuntu 22.04.
  • Un dominio valido puntato al tuo server.
  • Una password di root configurata sul tuo server.

Iniziare

Per prima cosa, dovrai installare alcune dipendenze Python sul tuo sistema. Puoi installarle tutte con il seguente comando:

apt-get install python3-dev libffi-dev git python3-pip python3-testresources libssl-dev wkhtmltopdf gcc g++ make python3.10-venv -y

Una volta installate tutte le dipendenze Python, dovrai installare Node.js sul tuo server.

Per prima cosa, aggiungi il repository di Node.js con il seguente comando:

curl -sL https://deb.nodesource.com/setup_16.x | bash -

Successivamente, installa Node.js e il server Redis con il seguente comando:

apt-get install nodejs redis-server -y

Una volta installati entrambi i pacchetti, installa il pacchetto Yarn eseguendo il seguente comando:

npm install -g yarn

Una volta terminato, puoi procedere al passaggio successivo.

Installa e configura il database MariaDB

Per impostazione predefinita, MariaDB è disponibile nel repository predefinito di Ubuntu 22.04. Puoi installarlo con il seguente comando:

apt-get install mariadb-server -y

Una volta installato, proteggi MariaDB e imposta la password di root di MariaDB con il seguente comando:

mysql_secure_installation

Rispondi a tutte le domande come mostrato di seguito per impostare la password di root di MariaDB e proteggere l’installazione:

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new 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

Una volta che MariaDB è protetto, accedi alla console di MariaDB con il seguente comando:

mysql -u root -p

Successivamente, dovrai cambiare il formato del file Innodb di MariaDB in Barracuda. Puoi farlo modificando il file /etc/mysql/mariadb.conf.d/50-server.cnf:

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

Aggiungi / Modifica le seguenti righe:

[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

Salva e chiudi il file, quindi riavvia il servizio MariaDB per implementare le modifiche:

systemctl restart mariadb

Installa ERPNext su Ubuntu 22.04

Per prima cosa, crea un nuovo utente per eseguire ERPNext utilizzando il seguente comando:

useradd -m -s /bin/bash erpnext

Successivamente, imposta la password per ERPNext con il seguente comando:

passwd erpnext

Successivamente, aggiungi l’utente ERPNext al gruppo sudo con il seguente comando:

usermod -aG sudo erpnext

Successivamente, accedi all’utente ERPNext e imposta la variabile d’ambiente con il seguente comando:

su - erpnext  
nano ~/.bashrc

Aggiungi la seguente riga:

PATH=$PATH:~/.local/bin/

Salva il file, quindi attiva la variabile d’ambiente con il seguente comando:

source ~/.bashrc

Successivamente, crea una directory per ERPNext con il seguente comando:

sudo mkdir /opt/bench

Successivamente, imposta la proprietà all’utente erpnext:

sudo chown -R erpnext:erpnext /opt/bench

Successivamente, cambia la directory in /opt/bench e clona il repository bench da Git Hub:

cd /opt/bench  
git clone https://github.com/frappe/bench bench-repo

Successivamente, installa il repository bench utilizzando il comando pip3:

pip3 install -e bench-repo

Una volta installato, inizializza la directory bench con il framework frappe utilizzando il seguente comando:

bench init erpnext

Dovresti ricevere il seguente output:

? Built js/checkout.min.js
? Built js/dialog.min.js
? Built js/social.min.js
? Built js/web_form.min.js
? Built js/list.min.js
? Built js/chat.js
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
? Built css/frappe-rtl.css
? Built css/printview.css
? Built js/bootstrap-4-web.min.js
? Built js/barcode_scanner.min.js
? Built css/list.min.css
? Built css/report.min.css
? Built frappe/css/email.css
? Built js/frappe-recorder.min.js
? Built js/desk.min.js
? Built css/frappe-chat-web.css
? Built js/frappe-web.min.js
? Built css/form.min.css
? Built css/web_form.css
? Built css/desk.min.css
? Built css/frappe-web-b4.css
? Built js/control.min.js
? Built js/form.min.js
? Built js/data_import_tools.min.js
? Built js/report.min.js
?  Done in 111.35s
Done in 113.33s.
SUCCESS: Bench erpnext initialized

Successivamente, cambia la directory in erpnext e crea un nuovo sito ERPNext con il seguente comando:

cd /opt/bench/erpnext  
bench new-site erp.example.com

Ti verrà chiesto di fornire la password di root di MariaDB e la password dell’amministratore come mostrato di seguito:

MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================] 100%
Updating country info               : [========================================] 100%
Set Administrator password: 
Re-enter Administrator password: 
* Scheduler is disabled *
Current Site set to erp.example.com

A questo punto, ERPNext è installato nel tuo sistema.

Configura ERPNext per l’ambiente di produzione

Successivamente, dovrai installare Supervisor per gestire il processo ERPNext e configurare Nginx come reverse proxy.

Per prima cosa, passa all’utente ERPNext e poi installa Supervisor e Nginx con il seguente comando:

su - erpnext  
sudo apt-get install supervisor nginx -y

Successivamente, installa il frappe-bench con il seguente comando:

sudo pip3 install frappe-bench

Successivamente, cambia la directory in /opt/bench/erpnext e configura ERPNext per l’ambiente di produzione con il seguente comando:

cd /opt/bench/erpnext  
sudo /home/erpnext/.local/bin/bench setup production erpnext

Una volta configurato ERPNext, dovresti vedere il seguente output:

PLAY RECAP ************************************************************************************************************************************
localhost                  : ok=8    changed=4    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

$ sudo systemctl restart supervisor
Port configuration list:

Site erp.example.com assigned port: 80
$ /usr/bin/supervisorctl reread
No config updates to processes
$ /usr/bin/supervisorctl update
$ sudo /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl reload nginx

A questo punto, ERPNext è configurato con Nginx per l’ambiente di produzione.

Accedi all’interfaccia web di ERPNext

Ora, apri il tuo browser web e digita l’URL http://erp.example.com. Sarai reindirizzato alla pagina di accesso di ERPNext:

Accesso ERPNext

Fornisci il nome utente come Administrator e una password che hai impostato in precedenza e fai clic sul pulsante Login. Dovresti vedere la seguente pagina:

Seleziona lingua

Seleziona la tua lingua desiderata, Paese, Fuso orario e Valuta e fai clic sul pulsante Next. Dovresti vedere la seguente pagina:

Crea un utente

Fornisci il tuo nome, email, password e fai clic sul pulsante Complete Setup. Dovresti vedere il dashboard di ERPNext nella seguente pagina:

Dashboard ERPNext

Proteggi ERPNext con Let’s Encrypt SSL

Per prima cosa, dovrai installare il client Certbot per installare e gestire il Let’s Encrypt SSL. Puoi installarlo con il seguente comando:

sudo apt-get install certbot python3-certbot-nginx -y

Una volta installato, esegui il seguente comando per installare e configurare Let’s Encrypt SSL per il tuo dominio:

sudo certbot --nginx -d erp.example.com

Ti verrà chiesto di fornire la tua email e accettare i termini di servizio come mostrato di seguito:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for erp.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/erpnext.conf

Successivamente, seleziona se reindirizzare o meno il traffico HTTP a HTTPS come mostrato di seguito:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Digita 2 e premi Invio per completare il processo. Dovresti vedere il seguente output:

Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/erpnext.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://erp.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=erp.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/erp.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/erp.example.com/privkey.pem
   Your cert will expire on 2022-09-11. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

A questo punto, il tuo sito web ERPNext è protetto con Let’s Encrypt SSL. Puoi ora accedere al tuo sito web in modo sicuro con il protocollo HTTPS.

Conclusione

Congratulazioni! hai installato con successo ERPNext con Nginx e Let’s Encrypt SSL su Ubuntu 22.04. Sentiti libero di chiedermi se hai domande. Puoi visitare la pagina della documentazione di ERPNext per ulteriori informazioni.

Share: X/Twitter LinkedIn

Ricevi i nuovi post nella tua casella di posta.

Nessuno spam. Disiscriviti in qualsiasi momento.