frappe_docker icon indicating copy to clipboard operation
frappe_docker copied to clipboard

How to install

Open ristein opened this issue 1 year ago • 7 comments

Hey there, thank you for your effort in this project. I came here in search of a way to get erpnext running for production use in a small company. Sadly it is hard to get any information on how to do this from the docs. I would like to see a docs page with general installation instruction for newbies. Following points could be mentioned there:

  1. what commands to run to get a basic installation
  2. what values need to be changed in pwd.yml (i.e. passwords)
  3. how to configure used ports (if colliding with already installed apps)
  4. what to configure in a reverse proxy for public access
  5. how to configure docker volume locations
  6. what to backup if not using the build in tool

ristein avatar Aug 18 '23 09:08 ristein

Having the same question. The Docker Compose needs an .env file that should be generated by python3 easy-install.py --prod --email [email protected]I guess. But this script is failing with Ubuntu 23.04 (GNU/Linux 5.15.74-1-pve x86_64)

Bildschirmfoto 2023-09-06 um 10 50 45

With what system does your script work? Please name OS and Version - Thanks in advance

SmartLiving-Rocks avatar Sep 06 '23 08:09 SmartLiving-Rocks

There is a file called pwd.yml, download it and rename it Docker Compose Yml, run Docker Compose d on your Linux server and open port 8080

mrchenxxx avatar Oct 21 '23 01:10 mrchenxxx

Thank you mrchenxxx, that helped. For installation I did following: curl -O https://raw.githubusercontent.com/frappe/frappe_docker/main/pwd.yml one might want to change the port in file (I chose 8087):

     ports:
      - "8087:8080"

docker compose -p erpnext -f pwd.yml up -d when updating I also do docker compose -p erpnext -f pwd.yml down before the last command. wait two minutes before accessing it. data-volumes got stored in /var/lib/docker/volumes/erpnext_***, so I included these in my backup. It is possible to store them elsewhere but I did not bother. For reverse proxying nothing special was needed in apache, just a standard config, in my case:

<VirtualHost *:443>
        ServerName  erp.example.com
SSLCertificateFile /etc/letsencrypt/live/example.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com-0001/privkey.pem
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log vhost_comb
        ProxyPreserveHost       On
        ProxyPass               "/"     "http://localhost:8087/"
        ProxyPassReverse        "/"     "http://localhost:8087/"
</VirtualHost>

To make the containers work after rebooting: https://stackoverflow.com/a/48066454 so in my case:

# /etc/systemd/system/erpnext-docker-compose.service
[Unit]
Description=ERPnext docker compose
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/data/erpnext/
ExecStart=docker compose -p erpnext -f pwd.yml up -d --force-recreate
ExecStop=docker compose -p erpnext -f pwd.yml down
TimeoutStartSec=50

[Install]
WantedBy=multi-user.target

and: systemctl enable docker-compose-app

ristein avatar Dec 12 '23 20:12 ristein

Thank you mrchenxxx, that helped. For installation I did following: curl -O https://raw.githubusercontent.com/frappe/frappe_docker/main/pwd.yml one might want to change the port in file (I chose 8087):

     ports:
      - "8087:8080"

docker compose -p erpnext -f pwd.yml up -d when updating I also do docker compose -p erpnext -f pwd.yml down before the last command. wait two minutes before accessing it. data-volumes got stored in /var/lib/docker/volumes/erpnext_***, so I included these in my backup. It is possible to store them elsewhere but I did not bother. For reverse proxying nothing special was needed in apache, just a standard config, in my case:

<VirtualHost *:443>
        ServerName  erp.example.com
SSLCertificateFile /etc/letsencrypt/live/example.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com-0001/privkey.pem
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log vhost_comb
        ProxyPreserveHost       On
        ProxyPass               "/"     "http://localhost:8087/"
        ProxyPassReverse        "/"     "http://localhost:8087/"
</VirtualHost>

To make the containers work after rebooting: https://stackoverflow.com/a/48066454 so in my case:

# /etc/systemd/system/erpnext-docker-compose.service
[Unit]
Description=ERPnext docker compose
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/data/erpnext/
ExecStart=docker compose -p erpnext -f pwd.yml up -d --force-recreate
ExecStop=docker compose -p erpnext -f pwd.yml down
TimeoutStartSec=50

[Install]
WantedBy=multi-user.target

and: systemctl enable docker-compose-app

The stack overflow question you are referring is a couple of years older, you dont need to create a systemd service inorder to restart your setup after reboot, refer --restart flag in docker documentation, docker can restart itself after a reboot

letajmal avatar Feb 12 '24 15:02 letajmal

@letajmal the docker compose file already includes a restart_policy. How should I edit that file to make it restart without a systemd service?

ristein avatar Feb 12 '24 15:02 ristein

@ristein Pwd.yml has a restart policy, which is on-failure. If that doesn't work for you, you can try "always", this will work if you have enabled the docker service

letajmal avatar Feb 22 '24 21:02 letajmal

This issue has been automatically marked as stale. You have a week to explain why you believe this is an error.

github-actions[bot] avatar Apr 23 '24 00:04 github-actions[bot]