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.

AddressWhat's there
https://uta.positiveerp.com/The tenant application
https://uta.positiveerp.com/manual/This manual
https://uta.positiveerp.com/health/readyServer 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, jq and openssl tools.
  • DNS A records pointing uta.positiveerp.com and auth.positiveerp.com (the sign-in address) to 45.9.191.9; with the console on the internet, console.positiveerp.com too.
  • 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) ​

  1. Automatic security updates: apt-get install -y unattended-upgrades, then dpkg-reconfigure -f noninteractive unattended-upgrades.
  2. A non-root deployment user in the Docker group: adduser deploy, then usermod -aG docker deploy. Run every script as this user.
  3. The firewall: ufw allow 22/tcp, ufw allow 80/tcp and ufw allow 443/tcp, then ufw 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 ​

  1. Clone the repository onto the server, for example into /opt/positive-erp, and go to the deploy/test-server folder.
  2. Run ./generate-secrets.sh. It creates the .env file with random passwords and keys (DP8).
  3. In .env, check PUBLIC_DOMAIN, TENANT_SLUG and PUBLIC_HOST, and enter your e-mail address in ACME_EMAIL.
  4. Run ./install.sh --demo (or leave out --demo for 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:

ModuleDemo data
HR and payrollSettings 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
CRMThree accounts (one of them a prospect), each with a contact, and five opportunities at different stages
Loyalty and gift cardsThe settings and their accounts, the gift card item GC050, the points programme POINTS, and two enrolled customers
ProcurementTwo services, budgets for two departments, and a draft purchase requisition
QualityA code group, an approved inspection plan INSP-COF, and an inspection on receipt of item P1003
OperationsThe operations line MNT, a draft maintenance quotation, and an open inspection job
Supply chainA demand forecast for warehouse W1, and a draft international shipment
FleetTwo drivers, two vehicles V01 and V02, and a fuel card for a customer
JewelleryThe 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 leasingThe settings, building B01 with two units, and a draft lease for shop G-01
ParkingThe 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 ​

  1. Open https://uta.positiveerp.com/, enter the username admin and the temporary password the script printed.
  2. The system asks for a new password (at least 12 characters, and not the same as the username).
  3. 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:

  1. 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.
  2. From then on, every sign-in to the console asks for the password and the code from the app.
  3. The Keycloak admin console still opens only through the tunnel.
  4. 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 ​

  1. In Terminals and pairing, open the terminal (T01 in the demo data) and request a pairing code, or run ./pairing-code.sh T01 on the server.
  2. The code has 8 characters and is valid for 10 minutes, for one use.
  3. In the POS app, enter the server address https://uta.positiveerp.com, then the code.
  4. 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.

RestaurantSupermarketClothing shop
Branch and warehouseRestaurant, warehouse WRSTSupermarket, warehouse WSUPClothing shop, warehouse WCLO
POS profile and terminalRST (restaurant mode) and R01SUP (retail) and S01CLO (retail) and C01
Items100 menu items, as non-stock services, coded RST001 to RST10080 packaged items with EAN-13 barcodes, and 20 items sold by weight (kilogram) with scale codes 77001 to 7702025 styles with size × colour variants: 100 variants such as "Formal shirt - M - White", with EAN-13 barcodes
GroupsAppetisers, salads, soups, main dishes, grills, sandwiches, manakeesh and pizza, desserts, hot and cold drinksDairy, cheese and eggs; bakery; beverages; snacks; canned food; pantry staples; cleaning; personal care; fruit and vegetables; meat and poultryMen, women, kids, shoes, accessories
Price list (tax-inclusive)RSTMENU, with channel prices: dine-in and takeaway at the list price, delivery 10% higherSUPPRICESCLOPRICES
Opening balanceNoneIn WSUPIn WCLO
Special settingsA 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 tipsScale 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:

ServiceMemoryNotes
pdf, document printing (on by default)About 200 MB while printingStops automatically after 5 minutes without printing.
ocr, reading scanned imagesAbout 300 MBAlso set OCR_PROVIDER=tesseract. Don't turn it on on a 4 GB server.
analytics, Superset dashboardsAbout 1 GBFits 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.sh pulls the latest code, takes a backup, rebuilds and restarts, then checks that everything is ready.
  • Backup: ./backup.sh copies every database, the files, the certificates and the .env file to BACKUP_DIR, and keeps the last 7 backups (DP10). Schedule it daily with cron, 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-run to 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 ​

ServiceLimit (8 GB)Lean limit (4 GB)Measured at idleMeasured at peak
PostgreSQL database1280640164232
Keycloak (sign-in)1024800478519
Server (API)15361100603–687765
Caddy (front end and files)25625615109
PDF printing10246407194
Always-on total51203436About 1350About 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 ​

ProblemWhat to do
Installation stops at the https://… checkCheck the DNS record, that ports 80 and 443 are open, and Caddy's log: docker compose --env-file .env logs web.
An untrusted certificate warningTLS_MODE is still staging or internal. Set it to acme, then run ./update.sh --no-pull.
A container restarts because of memoryCheck 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 applicationThe address must be exactly TENANT_SLUG.PUBLIC_DOMAIN.
The administrator's password is forgotten./user-password.sh admin.