ERP Installation · 10 min read · Oct 14, 2025
Como instalar o ERPNext no Ubuntu 20.04 LTS
ERPNext é um software ERP gratuito e de código aberto construído com Python, JavaScript e Frappe Framework. É um sistema de negócios moderno, fácil de usar e gratuito, utilizado por fabricantes, distribuidores e prestadores de serviços. É projetado para pequenas e médias empresas que ajudam as empresas a gerenciar todos os aspectos de suas operações comerciais. É um dos melhores softwares de gerenciamento ERP de código aberto usados por milhares de empresas em todo o mundo para gerenciar seus processos ERP.
Neste tutorial, explicarei como instalar o ERPNext no servidor Ubuntu 20.04.
Pré-requisitos
- Um servidor rodando Ubuntu 20.04.
- Um domínio válido apontado para o seu servidor.
- Uma senha de root configurada no seu servidor.
Começando
Antes de começar, você precisará instalar as dependências do Python necessárias em seu sistema. Você pode instalar todas elas com o seguinte comando:
apt-get install python3-dev libffi-dev git python3-pip python3-testresources libssl-dev wkhtmltopdf gcc g++ make -yApós instalar as dependências do Python, o ERPNext também usa o Node.js para seu frontend. Portanto, adicione o repositório do Node.js com o seguinte comando:
curl -sL https://deb.nodesource.com/setup_12.x | bash -Em seguida, instale o Node.js e o servidor Redis com o seguinte comando:
apt-get install nodejs redis-server -yUma vez que ambos os pacotes estejam instalados, instale o pacote Yarn executando o seguinte comando:
npm install -g yarnUma vez que você tenha terminado, pode prosseguir para a próxima etapa.
Instalar e Configurar o Banco de Dados MariaDB
Por padrão, o MariaDB está disponível no repositório padrão do Ubuntu 20.04. Você pode instalá-lo com o seguinte comando:
apt-get install mariadb-server -yUma vez instalado, proteja o MariaDB e defina a senha de root do MariaDB com o seguinte comando:
mysql_secure_installationResponda a todas as perguntas conforme mostrado abaixo para definir a senha de root do MariaDB e proteger a instalação:
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
Uma vez que o MariaDB esteja seguro, faça login no console do MariaDB com o seguinte comando:
mysql -u root -pEm seguida, altere o plugin de autenticação do MariaDB com o seguinte comando:
MariaDB [(none)]>USE mysql;
MariaDB [(none)]>UPDATE user SET plugin='mysql_native_password' WHERE User='root';Em seguida, limpe os privilégios e saia do shell do MariaDB com o seguinte comando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;Em seguida, você precisará alterar o formato do arquivo Innodb do MariaDB para Barracuda. Você pode fazer isso editando o arquivo /etc/mysql/mariadb.conf.d/50-server.cnf:
nano /etc/mysql/mariadb.conf.d/50-server.cnfAdicione / Modifique as seguintes linhas:
[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
Salve e feche o arquivo e reinicie o serviço do MariaDB para implementar as mudanças:
systemctl restart mariadbInstalar ERPNext
Nesta seção, mostraremos como criar um usuário do ERPNext, instalar a ferramenta bench e instalar o ERPNext em seu sistema.
Criar Usuário do ERPNext
Primeiro, crie um novo usuário para executar o ERPNext usando o seguinte comando:
useradd -m -s /bin/bash erpnextEm seguida, defina a senha para o ERPNext com o seguinte comando:
passwd erpnextEm seguida, adicione o usuário ERPNext ao grupo sudo com o seguinte comando:
usermod -aG sudo erpnextEm seguida, faça login no usuário ERPNext e configure a variável de ambiente com o seguinte comando:
su - erpnext
nano ~/.bashrcAdicione a seguinte linha:
PATH=$PATH:~/.local/bin/
Salve o arquivo e ative a variável de ambiente com o seguinte comando:
source ~/.bashrcInstalar a Ferramenta Bench
Primeiro, mude o diretório para o usuário ERPNext e crie um diretório para o ERPNext com o seguinte comando:
su - erpnext
sudo mkdir /opt/benchEm seguida, defina a propriedade para o usuário erpnext:
sudo chown -R erpnext:erpnext /opt/benchEm seguida, mude o diretório para /opt/bench e clone o repositório bench do Git Hub:
cd /opt/bench
git clone https://github.com/frappe/bench bench-repoEm seguida, instale o repositório bench usando o comando pip3:
pip3 install -e bench-repoUma vez instalado, inicialize o diretório bench com o framework frappe usando o seguinte comando:
bench init erpnextVocê deve obter a seguinte saída:
? 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
Criar Site ERPNext
Em seguida, mude o diretório para erpnext e crie um novo site ERPNext com o seguinte comando:
cd /opt/bench/erpnext
bench new-site erp.linuxbuz.comVocê será solicitado a fornecer sua senha de root do MariaDB e a senha de Administrador, conforme mostrado abaixo:
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
Neste ponto, o ERPNext está instalado em seu sistema.
Configurar o ERPNext para Ambiente de Produção
Em seguida, você precisará instalar o Supervisor para gerenciar o processo do ERPNext e o Nginx como um proxy reverso.
Primeiro, mude o usuário para ERPNext e instale o Supervisor e o Nginx com o seguinte comando:
su - erpnext
sudo apt-get install supervisor nginx -yEm seguida, instale o frappe-bench com o seguinte comando:
sudo pip3 install frappe-benchEm seguida, mude o diretório para /opt/bench/erpnext e configure o ERPNext para o ambiente de produção com o seguinte comando:
cd /opt/bench/erpnext
sudo /home/erpnext/.local/bin/bench setup production erpnextUma vez que o ERPNext esteja configurado, você deve ver a seguinte saída:
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
Neste ponto, o ERPNext está configurado com o Nginx para o ambiente de produção.
Acessar a Interface Web do ERPNext
Agora, abra seu navegador e digite a URL http://erp.linuxbuz.com. Você será redirecionado para a página de login do ERPNext:

Forneça o nome de usuário como Administrador e uma senha que você definiu anteriormente e clique no botão Login. Você deve ver a seguinte página:

Selecione seu idioma desejado e clique no botão Next. Você deve ver a seguinte página:

Selecione seu País, Fuso Horário, Moeda e clique no botão Next. Você deve ver a seguinte página:

Forneça seu nome, e-mail, senha e clique no botão Complete Setup. Você deve ver o painel do ERPNext na seguinte página:

Proteger o ERPNext com SSL Let’s Encrypt
Primeiro, você precisará instalar o cliente Certbot para instalar e gerenciar o SSL Let’s Encrypt. Você pode instalá-lo com o seguinte comando:
sudo apt-get install certbot python3-certbot-nginx -yUma vez instalado, execute o seguinte comando para instalar e configurar o SSL Let’s Encrypt para seu domínio:
sudo certbot --nginx -d erp.linuxbuz.comVocê será solicitado a fornecer seu e-mail e aceitar os termos de serviço, conforme mostrado abaixo:
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
Em seguida, selecione se deseja ou não redirecionar o tráfego HTTP para HTTPS, conforme mostrado abaixo:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
Digite 2 e pressione Enter para completar o processo. Você deve ver a seguinte saída:
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.
Neste ponto, seu site ERPNext está protegido com SSL Let’s Encrypt. Você pode agora acessar seu site com segurança usando o protocolo HTTPS.
Conclusão
Neste guia, aprendemos como instalar o ERPNext com Nginx no Ubuntu 20.04. Também aprendemos como proteger o ERPNext com SSL Let’s Encrypt. Você pode visitar a página de documentação do ERPNext para mais informações.
Receba novas postagens na sua caixa de entrada
Sem spam. Cancele a assinatura a qualquer momento.