Docker based production installation


  • Docker
  • docker-compose
  • List of sites and server ip added to DNS

1. Install docker-compose-letsencrypt-nginx-proxy-companion

cd $HOME
git clone
cd docker-compose-letsencrypt-nginx-proxy-companion
cp .env.sample .env

2. Clone repository

cd $HOME
git clone
cd erpnext_kubernetes
touch .env

3. Setup .env file

  • MYSQL_ROOT_PASSWORD=admin, set mariadb root password (bootstraps a mariadb container with this root password)
  •, these are list of sites that are part of the bench. Comma (,) separated
  • email to for letsencrypt expiry notification

Note: To add more sites recreate erpnext-assets container with sites appended to SITES ENV variable

4. Uncomment following lines from docker/docker-compose-${VERSION}.yml


      name: webproxy

5. Comment the exposed port 80:80 from docker/docker-compose-${VERSION}.yml from erpnext-assets service

#   ports:
#     - "80:80"

6. Start services (replace appropriate version)

DNS needs to be configured for following to work

docker-compose \
    --project-name erpnext_kubernetes \
    -f docker/docker-compose-$VERSION.yml \
    --project-directory . up -d

7. create new site(s)

# Create ERPNext site
docker exec \
    -e "" \
    -e "INSTALL_ERPNEXT=1" \
    -it erpnext_kubernetes_erpnext-python_1 new

# Create Frappe only site
docker exec \
    -e "" \
    -it erpnext_kubernetes_erpnext-python_1 new

Wait for mariadb to start. If new site creation fails re-try again after mariadb container is up

8. Update sites

cd $HOME/erpnext_kubernetes

# Pull new images
docker-compose -f docker/docker-compose-$VERSION.yml pull

# Restart containers
docker-compose \
    --project-name erpnext_kubernetes \
    -f docker/docker-compose-$VERSION.yml \
    --project-directory . restart

docker exec \
    -it erpnext_kubernetes_erpnext-python_1 migrate

If migrate fails because of redis cache related error remove the redis container(s) and volume(s) and migrate again

docker-compose \
    --project-name erpnext_kubernetes \
    -f docker/docker-compose-$VERSION.yml \
    --project-directory . stop

docker-compose \
    -f docker/docker-compose-$VERSION.yml \
    --project-directory . rm redis-cache redis-queue redis-socketio

docker volume rm \
    erpnext_kubernetes_redis-cache-vol \
    erpnext_kubernetes_redis-queue-vol \

docker-compose \
    --project-name erpnext_kubernetes \
    -f docker/docker-compose-$VERSION.yml \
    --project-directory . up -d

Read more:


./start should be ./, right?



1 Like

@revant_one could you please add instructions on how to restore a backup?

Would it also be possible to use an external database like AWS RDS?

1 Like

nothing special in container to restore backups.
Manually extract the user uploaded files in appropriate volumes or paths
Manually restore or create database with credentials from site_config.json
For restoring multiple dbs across servers, rsync seems faster.

rsync -avz /var/lib/mysql/* 

# at destination as root
chown mysql:mysql -R /var/lib/mysql/

I have success with using separate server under private network (Not Amazon RDS).

Instead of starting the mariadb service, pass your own db_host as environment variable MARIADB_HOST to erpnext-python container. It will create the config with the passed db_host. Other needed config can be changed manually as it will be available in sites directory on host

Related wiki : Using Frappe with Amazon RDS (or any other DBaaS) · frappe/frappe Wiki · GitHub


Hello revant_one,

did you have a solution to use your Docker Container with an external Database?

Did we get a ERPNextofficial/ERPNext Container on ?

Wher can i find yout Dockerfile?

one is one, first





Dockerfile(s) for edge images built from develop branch

git repo: castlecraft / erpnext_kubernetes · GitLab

Hello, i’m confused, which ERPNext i the Master Branch, v11 oder v12 at this time?


There is only master branch

3 directories,
each directory will have Dockerfile. i.e. 3 Dockerfiles
plain Dockerfile is for develop branch.
there is also v11.Dockerfile and v12.Dockerfile

Read and Dockerfile(s) to know more

  • erpnext-python image is ERPNext Python environment. Start 5x containers out of it viz. gunicorn, worker-default, worker-short,worker-long,scheduler`. sites/assets directory in gunicorn container is populated by erpnext-assets container.
  • erpnext-assets image serves pre-built assets and populates assets for gunicorn serving jinja
  • frappe-socketio image is the express, socketio server that is needed for websocket
1 Like

Hello @revant_one,

why did you use two reporitory provider and "" ?

I have try to replicate your How To without success.

Many steps are not clear for me.


Which two repositories? It is one repository on gitlab.

If you are talking about image registry, it is using docker hub to publish images

You have to understand docker and components.

GitHub - evertramos/nginx-proxy-automation: Automated docker nginx proxy integrated with letsencrypt. is used to serve sites in production. Check their readme and know more. If you don’t know docker, readme will only confuse you more.

  • Understand errors and debug on your own. I generally do that in any FOSS project.
  • Or post the errors and wait for someone to read and solve them (do care to format the error dump). Don’t expect any priority reply in any FOSS projects even if it is contribution.
  • Or best solution will be contact any service provider who understands docker. ( listed there is my team)
1 Like

Hello, thank you,

i mean “” and “”.

gitlab and github