question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run erpnext on localhost

See original GitHub issue

Hi,

I have no idea how to run the containers in this repo. I want to run the most basic erpnext production setup. Preferably with postgres. No reverse-proxy (Already have one).

I’ll document my steps here.

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

We provide simple and intuitive production setup with prebuilt Frappe and ERPNext images and compose files. To learn more about those, read the docs.

From the docs in Compose files

After building the images we have to run the containers.

So I assume the Dockerfiles need to be built before proceeding. /bench successfully builds. /nginx fails with fatal: repository 'apps/frappe' does not exist but that’s okay. Not critical for my setup. /socketio and /worker fail similarly.

Maybe it’s not necessary to prebuild, we continue.

Considering the naming of overrides, I’ll run compose.yml as is. Fails with RuntimeError: Required environment variable "REDIS_CACHE" not set. Okay cool .env not set but it is mentioned lower down.

Selecting overrides and env vars:

  • compose.noproxy.yaml to expose ports to host
  • compose.erpnext.yaml I don’t want other apps
  • compose.postgres.yaml Override db service to use postgres

Final compose builder script:

  docker compose \
  -f compose.yaml \
  -f overrides/compose.noproxy.yaml \
  -f overrides/compose.postgres.yaml \
  -f overrides/compose.erpnext.yaml \
   config > ./test-compose.yaml

The .env (comments removed for a smaller post):

FRAPPE_VERSION=v14.3.0
ERPNEXT_VERSION=v14.0.1
DB_PASSWORD=changeit
LETSENCRYPT_EMAIL=mail@example.com
FRAPPE_SITE_NAME_HEADER=
UPSTREAM_REAL_IP_ADDRESS=
UPSTREAM_REAL_IP_HEADER=
UPSTREAM_REAL_IP_RECURSIVE=
ROUTER=erpnext-one
SITES=localhost
BENCH_NETWORK=erpnext-one

First error: RuntimeError: Required environment variable "REDIS_CACHE" not set

Docs on this page don’t show manual loading of .env is required. docker-compose --env-file ./.env -f comp ......

Variables with a description are not actually optional:

Set only if external service for database is used.

So looks like I need to include override redis no matter what. New .env:

FRAPPE_VERSION=v14.3.0
ERPNEXT_VERSION=v14.0.1
DB_PASSWORD=changeit
DB_HOST=db
DB_PORT=5432
REDIS_CACHE=
REDIS_QUEUE=
REDIS_SOCKETIO=
LETSENCRYPT_EMAIL=mail@example.com
FRAPPE_SITE_NAME_HEADER=
UPSTREAM_REAL_IP_ADDRESS=
UPSTREAM_REAL_IP_HEADER=
UPSTREAM_REAL_IP_RECURSIVE=
ROUTER=erpnext-one
SITES=localhost
BENCH_NETWORK=erpnext-one

New docker config:

  docker compose --env-file ./.env \
  -f compose.yaml \
  -f overrides/compose.noproxy.yaml \
  -f overrides/compose.postgres.yaml \
  -f overrides/compose.erpnext.yaml \
  -f overrides/compose.redis.yaml \
   config > ./test-compose.yaml

The compose now starts successfully: frontend access shows localhost/0.0.0.0 does not exist After adding FRAPPE_SITE_NAME_HEADER = localhost doesn’t change the error Setting sites to one.example.com and adding that to my host’s hosts gives the same error.

I’ve tried many things not documented here but I feel like this was pretty much following the docs. I would appreciate some help getting erpnext running.

This process is a clean pull of master.

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
revantcommented, Aug 23, 2022

download pwd.yml from root of this repo and use it to deploy single site locally. read through the file to change admin password, image, install apps.

docker compose -p erpnext -f pwd.yml up -d

wait for site creation to complete

docker logs erpnext-create-site-1 -f

visit http://localhost:8080

0reactions
C-monCcommented, Aug 24, 2022

Okay thank you. Then it works correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I want to install ERPNext on my Local host
Q.1.- I have ERPNext ENTERPRISE License & i want to put all setup of ERPnext on my local host for my user. Q.2.-...
Read more >
How to setup erpnext localhost to a web url
I have install erpnext and it works fine on local host but i need to host on web. Kindly assist step by step...
Read more >
ERPNext-installation-Guide The complete guide to install ...
ERPNext -installation-Guide The complete guide to install ERPNext in your Ubuntu system · STEP 1 Install git · STEP 2 install python-dev ·...
Read more >
Install ERPNext local host vm
i cant install erp nexr t as local i need a help.
Read more >
ERPNext Forum
I installed frappe bench , using wget ... type http://localhost:8000/ , it is not running browser displays a message problem loading page ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found