Log inSign up

ERPNext on a VPS using the frappe_docker stack

Clone the frappe_docker repository, merge its compose file with the MariaDB, Redis and no-proxy overrides, and start the stack with Docker Compose. Then run bench new-site inside the backend container to create erp.example.net with the ERPNext app installed. Nginx on the host terminates HTTPS and forwards to the stack on 127.0.0.1:8080.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What does ERPNext need before installation?

Plan on 2 vCPU, 4 GB of memory and 40 GB of disk for a small company; the stack runs MariaDB, two Redis instances, a Python backend, a Node.js socket server, background workers and a scheduler. On a 4 GB server also add a 2 GB swap file (how to add swap).

  • Docker Engine and the Compose plugin from the official Docker repository. Follow Docker Engine, or start from the Docker app image where it is already installed.
  • A DNS name such as erp.example.net with records for 198.51.100.24 and 2001:db8:4f2a::24.
  • Git: sudo apt install -y git.

Check the tools before you continue:

docker --version
docker compose version
git --version

How do you prepare the frappe_docker configuration?

The repository ships a base compose file plus overrides; you combine them into one resolved file kept outside the repository. Start by cloning and writing an environment file:

git clone https://github.com/frappe/frappe_docker ~/frappe_docker
cd ~/frappe_docker
mkdir -p ~/gitops
cp example.env ~/gitops/erpnext.env
nano ~/gitops/erpnext.env

In erpnext.env set these values (keep the ERPNEXT_VERSION the example file already pins, or raise it to the newest stable tag on the ERPNext releases page):

DB_PASSWORD=a-long-random-database-password
HTTP_PUBLISH_PORT=127.0.0.1:8080
FRAPPE_SITE_NAME_HEADER=erp.example.net

Binding to 127.0.0.1 keeps the stack invisible from outside; Nginx is the only public entrance. Now resolve the full compose file:

docker compose --env-file ~/gitops/erpnext.env \
  -f compose.yaml \
  -f overrides/compose.mariadb.yaml \
  -f overrides/compose.redis.yaml \
  -f overrides/compose.noproxy.yaml \
  config > ~/gitops/erpnext.yaml

How do you start the stack and create the site?

Start the containers under one project name, wait for MariaDB, then create the site and install ERPNext into it in one bench command.

docker compose --project-name erpnext -f ~/gitops/erpnext.yaml up -d
docker compose --project-name erpnext ps
docker compose --project-name erpnext exec backend \
  bench new-site erp.example.net \
  --mariadb-user-host-login-scope=% \
  --db-root-password a-long-random-database-password \
  --admin-password another-strong-password \
  --install-app erpnext
docker compose --project-name erpnext exec backend bench --site erp.example.net list-apps

The list-apps output shows the installed Frappe and ERPNext versions. Site creation takes several minutes on a small server; let it finish. A quick local test proves the frontend answers:

curl -sI -H "Host: erp.example.net" http://127.0.0.1:8080/login | head -n 1

How do you add HTTPS with Nginx?

Put Nginx on the host in front of port 8080, pass the Host header (the site is selected by name) and allow WebSocket upgrades for realtime updates.

sudo apt install -y nginx certbot python3-certbot-nginx
server {
    listen 80;
    listen [::]:80;
    server_name erp.example.net;
    client_max_body_size 50M;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 120s;
    }
}

Save it as /etc/nginx/sites-available/erpnext, enable it and request a certificate:

sudo ln -s /etc/nginx/sites-available/erpnext /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d erp.example.net
sudo ufw allow OpenSSH && sudo ufw allow 'Nginx Full' && sudo ufw enable

Sign in at https://erp.example.net as Administrator with the admin password, and the setup wizard asks for company, currency, fiscal year and chart of accounts. If you would rather avoid Nginx, Caddy needs only reverse_proxy 127.0.0.1:8080 in a site block (see Caddy HTTPS).

How do outgoing emails work in ERPNext?

Create an Email Account with "Enable Outgoing" ticked and the SMTP details of an authenticated relay: server, port 587, STARTTLS, username and password. Mark it as the default outgoing account so quotations, invoices and password resets use it. Direct delivery on port 25 may be blocked on new servers; ask support with a ticket before you build around it. The relay route is described in SMTP relay for apps, together with SPF and DKIM. The email queue (search "Email Queue") shows each message and any error.

How do you back up ERPNext?

Bench creates a consistent dump of the database plus public and private files; copy the result off the server.

docker compose --project-name erpnext exec backend \
  bench --site erp.example.net backup --with-files
docker compose --project-name erpnext exec backend \
  ls -lh sites/erp.example.net/private/backups

The backups live inside the sites volume; docker compose cp or a mounted host path moves them out. A scheduled job with restic, as shown in daily backups, keeps an offsite history. The scheduler container also runs ERPNext's own scheduled backups if you enable them in System Settings.

How do you upgrade to a newer ERPNext release?

Change ERPNEXT_VERSION in ~/gitops/erpnext.env, regenerate the resolved compose file, pull, recreate and migrate.

cd ~/frappe_docker && git pull
docker compose --env-file ~/gitops/erpnext.env -f compose.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.noproxy.yaml config > ~/gitops/erpnext.yaml
docker compose --project-name erpnext -f ~/gitops/erpnext.yaml pull
docker compose --project-name erpnext -f ~/gitops/erpnext.yaml up -d
docker compose --project-name erpnext exec backend bench --site erp.example.net migrate

Take a backup first. Minor versions inside one major line are usually smooth; a major jump (for example v15 to v16) deserves a trial on a copy of the site.

What are common ERPNext errors and their fixes?

  • 404 or "site does not exist": the Host header does not match the site name. Keep proxy_set_header Host $host; and check FRAPPE_SITE_NAME_HEADER.
  • Realtime updates missing: the WebSocket upgrade headers are not passed; compare with the Nginx block above.
  • Background jobs stuck: inspect the workers with docker compose --project-name erpnext logs queue-long --tail 50.
  • Containers restarting from memory pressure: check docker stats and the usage graphs, then move to a larger plan.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4one company, small team2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A4-8many users or heavy reports4 vCPU, 8 GB RAM, 180 GB NVMe$28.80/mo$86.40 for 3 months

Questions about ERPNext with frappe_docker

Is there a quicker way to try ERPNext?

Yes. The repository includes pwd.yml, a single-file demo you start with docker compose -f pwd.yml up -d. It uses fixed default passwords, so keep it to short local tests.

Can I install more Frappe apps such as HRMS?

Yes, but apps must be part of the image. frappe_docker documents building a custom image with an apps.json list; you then point the compose file at that image.

Does ERPNext need a separate database server?

No. The MariaDB override runs MariaDB as a container in the same stack, with its data in a named volume.

Which login is created first?

The user Administrator with the password you passed to --admin-password. Create named users for staff after the setup wizard.

Can several companies share one site?

Yes. ERPNext supports multiple companies inside one site, each with its own chart of accounts. Separate sites are only needed for fully separate data.