This is a simplified version of the official ERPNext Docker container deployment. I experienced a hard time deploying the application with the originally documented procedure, so decided to create this one.
- Clone the repository to your project path
- Ensure your current directory is the project path
- Make necessary changes to the
.envfile- Check the
DOCKER_NETWORK_PREFIXenvironment variable to ensure the Docker network subnet does not conflict with any existing Docker network - Change the
HOST_NAMEenvironment variable to the domain/subdomain you will be using to access thisERPNextDocker instance with
- Check the
- No need to touch the
docker-compose.ymlfile
- Run using the
Reset.shbash script:bash Reset.sh
- Run using the
Start.shbash script:bash Start.sh
- Access
ERPNextfrom within the private Docker network - Default username is
Administratorand password isadmin - Set
ERPNEXT_IPenvironment variable in.envfile to0.0.0.0to access it from anywhere (not recommended for internet exposure)
The default deployment comes with non SSL flavor within a private Docker network, to be used with an HTTP reverse proxy for access from the internet. There are two ways to expose this ERPNext Docker instance to the internet for public access;
- Built in
Let's Encryptcertificate: Tweak with the.envfile and figure it out on your own! - The easiest is to use the magical
NginX Proxy ManagerDocker instance :) DeployNginX Proxy Managerand simply forward all HTTP requests to this privateERPNextinstance.
- Navigate to
Left panel / Integations / Authentication / Social Login Key - Activate the
Enable Social Logincheckbox - Click
Add Social Login Keybutton on top right - Select
Keycloakfrom the Social Login Provider list - Input
Client IDandClient Secretvalues from Keycloak - Set Base URL to
https://keycloak.domain.tld/realms/REALM_NAME - Set Configuration / Sign ups to
Allowmode - Click the
Savebutton on top right - You must setup
HTTPonly Redirect URL too in Keycloak if running ERPNext behind a reverse proxy; because, seemingly, ERPNext sendshttpURL as redirection to Keycloak, by mistake or not. -
- Create the Keycloak SSO profile as described above but keep it disabled (this is important)
- Creatte a new SSO profile
- Select
Customfrom the Social Login Provider list - Give a desired name to your button:
My ID Provider - Put in
Client IDandClient Secretfrom Keycloak - Copy
Base URLfrom the Keycloak profile created earlier - Set Configuration / Sign ups to
Allowmode - Copy
Authorize URL,Redirect URL,Access Token URL,API Endpoint URLandAuth URL Datavalues from the Keycloak profile created earlier - Activate the profile and save it
Simpler than ever;
- Stop this
ERPNextDocker instance:docker compose down - Backup: Copy the entire project directory
- Restore: Execute from the new location, no data lost
All Volume data are kept locally in Volume folder within the project path under seperate folders;
- ERPNext
- MySQL
- Redis