Installazione ERP · 10 min read · Oct 14, 2025

Come installare ERPNext su Ubuntu 20.04 LTS

ERPNext è un software ERP gratuito e open-source costruito con Python, JavaScript e Frappe Framework. È un sistema aziendale moderno, facile da usare e gratuito, utilizzato da produttori, distributori e servizi. È progettato per piccole e medie imprese che aiutano le aziende a gestire tutti gli aspetti delle loro operazioni aziendali. È uno dei migliori software di gestione ERP open-source utilizzati da migliaia di aziende in tutto il mondo per gestire i loro processi ERP.

In questo tutorial, spiegherò come installare ERPNext su un server Ubuntu 20.04.

Prerequisiti

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

Iniziare

Prima di iniziare, dovrai installare le dipendenze Python richieste nel 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 -y

Dopo aver installato le dipendenze Python, ERPNext utilizza anche Node.js per il suo frontend. Quindi aggiungi il repository Node.js con il seguente comando:

curl -sL https://deb.nodesource.com/setup_12.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 20.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, cambia il plugin di autenticazione di MariaDB con il seguente comando:

MariaDB [(none)]>USE mysql;  
MariaDB [(none)]>UPDATE user SET plugin='mysql_native_password' WHERE User='root';

Successivamente, svuota i privilegi ed esci dalla shell di MariaDB con il seguente comando:

MariaDB [(none)]> FLUSH PRIVILEGES;  
MariaDB [(none)]> EXIT;

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

[mysql]
default-character-set = utf8mb4

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

systemctl restart mariadb

Installa ERPNext

In questa sezione, ti mostreremo come creare un utente ERPNext, installare lo strumento bench e installare ERPNext nel tuo sistema.

Crea utente ERPNext

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

Installa lo strumento Bench

Per prima cosa, cambia la directory all’utente ERPNext e crea una directory per ERPNext con il seguente comando:

su - erpnext  
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 ottenere 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

Crea sito ERPNext

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

cd /opt/bench/erpnext  
bench new-site erp.linuxbuz.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.linuxbuz.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 Nginx come reverse proxy.

Per prima cosa, cambia l’utente in ERPNext e 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.linuxbuz.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.linuxbuz.com. Verrai reindirizzato alla pagina di accesso di 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 la tua lingua desiderata e fai clic sul pulsante Next. Dovresti vedere la seguente pagina:

Seleziona il tuo Paese, Fuso Orario, Valuta e fai clic sul pulsante Next. Dovresti vedere la seguente pagina:

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

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.linuxbuz.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.linuxbuz.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.linuxbuz.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/erp.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/erp.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-08-29. 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

In questa guida, abbiamo imparato come installare ERPNext con Nginx su Ubuntu 20.04. Abbiamo anche imparato come proteggere ERPNext con Let’s Encrypt SSL. 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.