On this page
Test server
What it's for
This is an edition for internal testing by the owner's team, on a single server: a Hostinger KVM 2 virtual server (two CPUs, 8 GB of memory, Ubuntu 24.04, public address 45.9.191.9). The lean setup also fits in 4 GB. Users of the uta tenant open the system at https://uta.positiveerp.com with a real Let's Encrypt certificate (DP1). Everyone signs in on one neutral address, https://auth.positiveerp.com — never on another tenant's address (DP16).
This isn't the production environment. The full runbook, in English, is in the repository: docs/deploy-test-server.md.
| Address | What's there |
|---|---|
https://uta.positiveerp.com/ | The tenant application |
https://uta.positiveerp.com/manual/ | This manual |
https://uta.positiveerp.com/health/ready | Server health |
https://auth.positiveerp.com/kc/ | The sign-in page (Keycloak) of every tenant, the console and the point of sale |
https://localhost:8443/ (through an SSH tunnel only) | The operator console and the Keycloak admin console (DP2) |
Prerequisites
- An Ubuntu 24.04 server with 8 GB of memory (or 4 GB with the lean values) and 20 GB of free disk space. The installer warns you if there's less than 6 GB of memory, and refuses to continue below 3.5 GB.
- Docker Engine 24 or later with Docker Compose 2.24 or later (pre-installed by Hostinger's Docker manager), plus the
git,curl,jqandopenssltools. - DNS A records pointing
uta.positiveerp.comandauth.positiveerp.com(the sign-in address) to45.9.191.9; with the console on the internet,console.positiveerp.comtoo. - Only ports 22, 80 and 443 are open to the internet, and no other web server is running on ports 80 and 443.
Preparing Ubuntu 24.04 (once)
- Automatic security updates:
apt-get install -y unattended-upgrades, thendpkg-reconfigure -f noninteractive unattended-upgrades. - A non-root deployment user in the Docker group:
adduser deploy, thenusermod -aG docker deploy. Run every script as this user. - The firewall:
ufw allow 22/tcp,ufw allow 80/tcpandufw allow 443/tcp, thenufw enable. If Hostinger's firewall is turned on, allow the same ports there too.
For details and the full commands, see section 2 of the English runbook.
Installation
- Clone the repository onto the server, for example into
/opt/positive-erp, and go to thedeploy/test-serverfolder. - Run
./generate-secrets.sh. It creates the.envfile with random passwords and keys (DP8). - In
.env, checkPUBLIC_DOMAIN,TENANT_SLUGandPUBLIC_HOST, and enter your e-mail address inACME_EMAIL. - Run
./install.sh --demo(or leave out--demofor an empty tenant). The first run takes 15 to 25 minutes, because the images are built on the server (DP6).
The script checks the prerequisites, starts the services and waits for them to be ready (database updates are applied when the server starts, DP5). It then provisions the uta tenant with its company, branch, plan and first administrator through the operator API (DP11), and prints a one-time password for the administrator. With --demo, it also enters demo data through an audited support session (DP12).
You can safely run the script again; it carries on from where it stopped. If the tenant already exists, the script adds to its plan any modules listed in TENANT_MODULES that aren't on yet. It never removes a module.
The demo data includes accounts, items, customers, suppliers and a point of sale, plus basic records for each module so you can try its screens:
| Module | Demo data |
|---|---|
| HR and payroll | Settings for the Jordanian system with the social security and income tax tables, leave types and an annual leave policy, four departments, five employees with salaries, and open payroll months |
| CRM | Three accounts (one of them a prospect), each with a contact, and five opportunities at different stages |
| Loyalty and gift cards | The settings and their accounts, the gift card item GC050, the points programme POINTS, and two enrolled customers |
| Procurement | Two services, budgets for two departments, and a draft purchase requisition |
| Quality | A code group, an approved inspection plan INSP-COF, and an inspection on receipt of item P1003 |
| Operations | The operations line MNT, a draft maintenance quotation, and an open inspection job |
| Supply chain | A demand forecast for warehouse W1, and a draft international shipment |
| Fleet | Two drivers, two vehicles V01 and V02, and a fuel card for a customer |
| Jewellery | The 24, 21 and 18 karats, a gold price, a gold ring J1001 with a balance of 50 grams, and a draft gold sale |
| Real-estate leasing | The settings, building B01 with two units, and a draft lease for shop G-01 |
| Parking | The STD tariff, an entry gate and an exit gate, and an open ticket |
All documents are drafts, so no accounting entries are created apart from the items' opening balance entries. Running ./demo-data.sh a second time changes nothing. If a module isn't on in the tenant's plan, the script skips it and prints its name: add it to TENANT_MODULES in .env, run ./install.sh --no-build, then run ./demo-data.sh.
A first try without using up Let's Encrypt limits
Set TLS_MODE=staging in .env for your first try (the browser shows a certificate warning). Then set it back to acme and run ./update.sh --no-pull.
First sign-in
- Open
https://uta.positiveerp.com/, enter the usernameadminand the temporary password the script printed. - The system asks for a new password (at least 12 characters, and not the same as the username).
- Start with Users and Roles and permissions.
New users. The test server doesn't send e-mail. After you invite a user from the Users screen, run ./user-password.sh <username> on the server to get a one-time password to give them. Use the same command to reset a forgotten password.
The operator console. From your computer, run ssh -L 8443:127.0.0.1:8443 <user>@uta.positiveerp.com, then open https://localhost:8443/ and sign in as operator with the password OPERATOR_PASSWORD from the .env file. You'll see a certificate warning because the certificate is one of Caddy's internal certificates; this is expected. The Keycloak admin console is at https://localhost:8443/kc/admin/.
The console from the internet (optional, DP15). In .env, set CONSOLE_PUBLIC_HOST=console.positiveerp.tech (its DNS record points to the server; the base domain itself opens the corporate site, DP16). The console's address also carries the public pricing and sign-up pages. You can limit it to specific IP addresses with CONSOLE_ALLOWED_IPS. Then run ./update.sh --no-pull. Open https://console.positiveerp.tech/ and sign in as operator:
- The first time, Keycloak shows a QR code. Scan it with an authenticator app on your phone (Google Authenticator, Microsoft Authenticator or another) and enter the 6-digit code.
- From then on, every sign-in to the console asks for the password and the code from the app.
- The Keycloak admin console still opens only through the tunnel.
- If you lose the phone: in the Keycloak admin console (through the tunnel), go to Users → operator → Credentials and delete the OTP credential. You'll be asked to set up a new code at the next sign-in.
To close it to the internet again, empty CONSOLE_PUBLIC_HOST and run ./update.sh --no-pull.
Pairing a point of sale
- In Terminals and pairing, open the terminal (
T01in the demo data) and request a pairing code, or run./pairing-code.sh T01on the server. - The code has 8 characters and is valid for 10 minutes, for one use.
- In the POS app, enter the server address
https://uta.positiveerp.com, then the code. - The cashier needs a POS PIN and the point-of-sale role.
Demo points of sale: restaurant, supermarket and clothing shop
The ./demo-pos.sh script adds three businesses to the first company so you can test three devices at once. Each business is a branch with its own warehouse, cash box, POS profile, terminal and 100 items (300 items in all).
It needs ./demo-data.sh to have run first and, like that script, works through the system's API and an audited support session in the tenant administrator's name (DP12). It looks for each record before creating it and never changes an existing POS profile, so running it again changes nothing. It's safe on the uta tenant with its current data.
| Restaurant | Supermarket | Clothing shop | |
|---|---|---|---|
| Branch and warehouse | Restaurant, warehouse WRST | Supermarket, warehouse WSUP | Clothing shop, warehouse WCLO |
| POS profile and terminal | RST (restaurant mode) and R01 | SUP (retail) and S01 | CLO (retail) and C01 |
| Items | 100 menu items, as non-stock services, coded RST001 to RST100 | 80 packaged items with EAN-13 barcodes, and 20 items sold by weight (kilogram) with scale codes 77001 to 77020 | 25 styles with size × colour variants: 100 variants such as "Formal shirt - M - White", with EAN-13 barcodes |
| Groups | Appetisers, salads, soups, main dishes, grills, sandwiches, manakeesh and pizza, desserts, hot and cold drinks | Dairy, cheese and eggs; bakery; beverages; snacks; canned food; pantry staples; cleaning; personal care; fruit and vegetables; meat and poultry | Men, women, kids, shoes, accessories |
| Price list (tax-inclusive) | RSTMENU, with channel prices: dine-in and takeaway at the list price, delivery 10% higher | SUPPRICES | CLOPRICES |
| Opening balance | None | In WSUP | In WCLO |
| Special settings | A dining room with 12 tables and a terrace with 6 tables; kitchen, grill and bar stations; a 10% service charge on table orders, taxed at 16%; and tips | Scale barcode formats (weight and price), and cash rounding to 0.010 JOD | — |
All three profiles use the Jordanian dinar and tax-inclusive prices; the payment methods cash, card, on account, gift card and loyalty points; drawer expense categories with their accounts and purchase tax; and a receipt header and footer in Arabic and English.
Tax. The general sales tax of 16% is the default. Fresh milk, eggs, Arabic bread, and fruit and vegetables are exempt (EXEMPT), and some basic foods and meat are at the reduced rate of 4% (VAT4). This is a choice made for the demo data; check it against the tax tables in force before relying on it.
Note. Items are company-level, so every item in the company reaches every terminal. Each business's items are told apart by their groups, codes and barcodes. Returns and exchanges are governed by user permissions, not by the POS profile.
Pairing the three devices. When the devices are ready, run ./demo-pos.sh --pair. For each of R01, S01 and C01, it prints a pairing code that's valid for 10 minutes and one use, together with the server address. In the POS app on each device (Windows or Android), enter the server address https://uta.positiveerp.com, then that terminal's code. For an extra code for one terminal, run ./pairing-code.sh S01. If the number of terminals goes beyond the limit in the tenant's plan, the script prints a clear message and skips only the extra terminals.
Optional services
To turn one on, add its name to COMPOSE_PROFILES in the .env file, then run ./update.sh --no-pull:
| Service | Memory | Notes |
|---|---|---|
pdf, document printing (on by default) | About 200 MB while printing | Stops automatically after 5 minutes without printing. |
ocr, reading scanned images | About 300 MB | Also set OCR_PROVIDER=tesseract. Don't turn it on on a 4 GB server. |
analytics, Superset dashboards | About 1 GB | Fits on an 8 GB server alongside the other services. Needs its own DNS name. Don't turn it on on a 4 GB server. |
Updates and backups
- Update:
./update.shpulls the latest code, takes a backup, rebuilds and restarts, then checks that everything is ready. - Backup:
./backup.shcopies every database, the files, the certificates and the.envfile toBACKUP_DIR, and keeps the last 7 backups (DP10). Schedule it daily withcron, and move the backups off the server. - Restore:
./restore.sh <backup folder>replaces all current data with the backup, after you confirm. - Restore a deleted dashboard:
./restore-dashboard.sh <backup folder> "dashboard name or ID"extracts a single dashboard from a backup and puts it back in the current database with its layout and sharing, without replacing any other data. Add--dry-runto see what it would do first. Use it only if the dashboard is no longer in Deleted dashboards or in the audit trail (DB13).
Memory budget
| Service | Limit (8 GB) | Lean limit (4 GB) | Measured at idle | Measured at peak |
|---|---|---|---|---|
| PostgreSQL database | 1280 | 640 | 164 | 232 |
| Keycloak (sign-in) | 1024 | 800 | 478 | 519 |
| Server (API) | 1536 | 1100 | 603–687 | 765 |
| Caddy (front end and files) | 256 | 256 | 15 | 109 |
| PDF printing | 1024 | 640 | 7 | 194 |
| Always-on total | 5120 | 3436 | About 1350 | About 1800 |
| Superset (optional) | 1536 | — | ||
| OCR (optional) | 512 | — |
Values are in megabytes. The limits are set in the .env file (the 8 GB values; the lean values are in brackets in .env.example). The figures were measured with docker stats on the tenant with its demo data, and the peak was measured after opening every screen of the application (DP4).
Troubleshooting
| Problem | What to do |
|---|---|
Installation stops at the https://… check | Check the DNS record, that ports 80 and 443 are open, and Caddy's log: docker compose --env-file .env logs web. |
| An untrusted certificate warning | TLS_MODE is still staging or internal. Set it to acme, then run ./update.sh --no-pull. |
| A container restarts because of memory | Check docker stats --no-stream, then raise the limit in .env (such as API_MEM_LIMIT) or turn off an optional service. |
| Keycloak error "Invalid parameter: redirect_uri" | The address you're using differs from the PUBLIC_HOST the system was installed with. Correct the redirect URIs in the Keycloak admin console, through the tunnel. |
tenant_not_found in the application | The address must be exactly TENANT_SLUG.PUBLIC_DOMAIN. |
| The administrator's password is forgotten | ./user-password.sh admin. |