In this Tutorial we will go through the steps to install ERPNext as a Docker Container Stack. The official documentation is a little complex and needs tweaking, however these steps will get the job down simply and without much effort.
We will assume that you already have Docker installed and running and that you are running all commands as root:
Step 1 – Install Git
apt update && apt install git -y
Step 2 – Clone the Docker-Compose package from GitHub:
git clone https://github.com/frappe/frappe_docker.git
Step 3 – Change into the frappe_docker package folder:
cd frappe_docker
Step 4 – Copy the appropriate .env file from the samples:
-
For a Production Environment:
cp env-production .env
-
For a Local Environment
cp env-local .env
Step 5 – Edit the .env Configuration File
nano .env
-
Edit the variables in the file to your needs, most importantly make sure that the ERPNEXT_VERSION, FRAPPE_VERSION, SITES and SITE_NAME variables reflect your desired environment, current stable version of ERPNext is v13.5.0:
LETSENCRYPT_EMAIL=you@yourdomain.com ERPNEXT_VERSION=v13.5.0 FRAPPE_VERSION=v13.5.0 MARIADB_HOST=mariadb MYSQL_ROOT_PASSWORD=admin SITE_NAME=yoursite.yourdomain.com SITES=yoursite.yourdomain.com DB_ROOT_USER=root ADMIN_PASSWORD=admin INSTALL_APPS=erpnext ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=websecure CERT_RESOLVER_LABEL=traefik.http.routers.erpnext-nginx.tls.certresolver=myresol$ HTTPS_REDIRECT_RULE_LABEL=traefik.http.routers.http-catchall.rule=hostregexp(`{$ HTTPS_REDIRECT_ENTRYPOINT_LABEL=traefik.http.routers.http-catchall.entrypoints=$ HTTPS_REDIRECT_MIDDLEWARE_LABEL=traefik.http.routers.http-catchall.middlewares=$ HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=traefik.http.middlewares.redirect-to-https.$ SKIP_NGINX_TEMPLATE_GENERATION=1
Step 6 – Run docker-compose, remember to name the stack under –project-name:
docker-compose --project-name erpnext up -d
Step 7 – Login to your newly created ERPNext site (Admin Password is what you set in the .env file in step 5, default “admin”). https://yoursite.yourdomain.com/
Step 8 (Optional) – Updating a running ERPNext instance in docker:
- You will need to edit the .env file (As per step 5) and replace the version listed for ERPNEXT_VERSION and FRAPPE_VERSION with the new version.
- Simply run the docker-compose file again (Step 6) and it will update your container.
That’s it, you have succesfully installed ERPNext as a docker Container Stack.
Leave a Reply