Can any one help me set erpNext using docker on my laptop

I am trying for so long to set up erpNext using docker on my laptop but could not

You can use below commands to install frappe/erpnext using docker. If you are using window then first install WSL and run these commands.

  1. Update the package index:
sudo apt-get update

  1. Download the Docker installation script:
curl -fsSL https://get.docker.com -o get-docker.sh

  1. Run the Docker installation script with the --dry-run flag to simulate the installation:
sudo sh ./get-docker.sh --dry-run

  1. Download the Docker installation script again:
curl -fsSL https://get.docker.com -o get-docker.sh

  1. Run the Docker installation script:
sudo sh get-docker.sh

  1. Add a docker group:
sudo groupadd docker

  1. Add your user to the docker group:
sudo usermod -aG docker $USER

  1. Activate the changes to group membership:
newgrp docker

  1. Run a test Docker container:
docker run hello-world

  1. Enable the Docker service:
sudo systemctl enable docker.service

  1. Enable the containerd service:
sudo systemctl enable containerd.service

  1. Set up Docker CLI plugins directory:
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins

  1. Download Docker Compose binary to the CLI plugins directory:
curl -SL https://github.com/docker/compose/releases/download/v2.19.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose

  1. Make the downloaded Docker Compose binary executable:
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

  1. Download Docker Compose binary to /usr/local/bin
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

  1. Make the downloaded Docker Compose binary executable:
sudo chmod +x /usr/local/bin/docker-compose

  1. Verify Docker Compose installation:
docker-compose --version

Finally docker installation complete now we will do Frappe installation.

  1. Clone the Frappe Docker repository:
git clone https://github.com/frappe/frappe_docker.git

  1. Navigate into the cloned repository:
cd frappe_docker

  1. Copy the devcontainer-example directory to .devcontainer:
cp -R devcontainer-example .devcontainer

  1. Copy the vscode-example directory to .vscode:
cp -R development/vscode-example development/.vscode

  1. Install the Remote Containers extension for Visual Studio Code:
code --install-extension ms-vscode-remote.remote-containers

  1. Open the current directory in Visual Studio Code:
code .

NOTE :rotating_light: :rotating_light: :rotating_light:: here it will open vs code and it will show one popup like Open in Container , so click on this popup. then open terminal (CTRL+J) and run below command one by one

  1. Initialize a new Frappe bench with version 15:
bench init --skip-redis-config-generation --frappe-branch version-15 frappe-bench

  1. Move into the Frappe bench directory:
cd frappe-bench

  1. Set database host to MariaDB:
bench set-config -g db_host mariadb

  1. Set Redis cache host:
bench set-config -g redis_cache redis://redis-cache:6379

  1. Set Redis queue host:
bench set-config -g redis_queue redis://redis-queue:6379

  1. Set Redis socketio host:
bench set-config -g redis_socketio redis://redis-queue:6379

  1. Remove Redis from Procfile:
sed -i '/redis/d' ./Procfile

  1. Create a new site with specified passwords and configurations:
bench new-site --mariadb-root-password 123 --admin-password admin --no-mariadb-socket development.localhost

  1. Set root login and password for PostgreSQL:
bench config set-common-config -c root_login postgres
bench config set-common-config -c root_password '"123"'

  1. Enable developer mode and clear cache for the site:
bench --site development.localhost set-config developer_mode 1
bench --site development.localhost clear-cache

  1. Get the ERPNext app with version 15:
bench get-app --branch version-15 --resolve-deps erpnext

  1. Install the ERPNext app on the site:
bench --site development.localhost install-app erpnext

  1. Start the Frappe bench:
bench start

2 Likes

git clone -b version-15 GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext
cd frappe_docker

docker compose up -d

I am using simply this but It is not doing the required output

Clone the frappe github

git clone https://github.com/frappe/frappe_docker

Change in the Frappe docker Directory

cd frappe_docker

Start all the container using the Docker compose file pwd.yml

docker compose -f pwd.yml up -d

After running this command wait for 3-4 mins until configuration and migration is done.

Or you can check the logs of the Create-site container until it finishes

docker logs <create-site-container-id>

Your can access the frappe Ui in the

http://localhost:8080

if you port is already using by some other applications
change the port in pwd.yml file
*
`ports:*

  • “8080:8080”`

HOST_PORT : CONTAINER_PORT
change the host-port 1st one to which every port you like and run the same command.

docker compose -f pwd.yml up -d

same and wait tail the migration is done 3-4 mins and access it in your

**
http://localhost:<your-port>**

Basically pwd.yml contains the information of your images by default has frappe/erpnext:v16.12.0 , Mariadb and Redis. This file pull frappe-erpnext , mariadb, redis images and start multiple containers in your system. And it exposes the UI in the frontend in localhost:8080 (default) using the frontend docker.

Create your Custom Image
You can create your custom image and push it to docker hub and use the image in pwd.yml to check your image..

Refer the below docs for the custom image build using docker Container file and custom apps json
Build Setup | Frappe Docker Docs

If you want a quick way to add/remove containers/apps check out