GuidesConfiguration
Installer variables
Environment variables that control bootstrap.sh and the install-ubuntu.sh / install-almalinux.sh installers.
All installation commands accept variables placed before the command. Without a terminal (cron, cloud-init, ssh server 'command') the installer asks nothing, so variables are the only way to change the defaults.
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo VARIABLE=value bashVariable reference
| Variable | Default | Description |
|---|---|---|
MODE | all (asked if a terminal is available) | all: web server + database on this server. web: web server + PHP only, database on another server (requires DB_HOST). db: MariaDB only, open to the network, no web server or code. |
DB_HOST | — | With MODE=web: IP of the database server. |
DB_ALLOW | Any IP (%) | With MODE=db: IP of the web server allowed to connect to port 3306. |
WEB_PORT | 80 (asked if a terminal is available) | Website port. Ports 22, 3306 and 8108 are rejected. |
DOMAIN | _ | Web server server_name. Example: pos.mystore.com. |
PHP_VER | 8.3 | PHP version. Supported values: 8.2 and 8.3. |
WITH_PRINTING | yes | no skips CUPS, Chrome/Chromium and printing. |
ENV_ONLY | no | yes or 1 installs only the environment (dependencies and services), without the HWD POS code. |
APP_DIR | /var/www/HWDPOS | Code installation folder. The installer refuses system folders such as /, /tmp or /var. |
DB_NAME | hwd_pos | Database name. |
DB_USER | hwdpos_manager | Database user. |
DB_PASS | — | Database user password. If empty, the installer reuses the one already in use (storage/config.php or the credentials file) and generates a new one only if none exists. In both cases it applies it to the database user, so file and database always match. |
SET_TIMEZONE | — | yes sets the server time zone to America/Panama; no leaves it. If empty, it is asked (default: yes); without a terminal it is left unchanged and a warning is shown. |
HWPOS_ZIP | — | Local path or URL of the HWD POS .zip package used by bootstrap.sh. The .zip must have HWDPOS/ as its root folder. |
HWPOS_REPLACE | — | 1 allows HWPOS_ZIP to replace an already installed system. The previous folder is kept as HWDPOS.anterior-DATE. |
HWPOS_BASE_URL | https://3r.com.pa/hwdpos_inst | Where bootstrap.sh, the installers, install-workers.sh, hwdpanel.sh, check.sh and scripts.zip are downloaded from. |
INSTALLER_URL | — | Direct URL of the family installer (install-ubuntu.sh or install-almalinux.sh), if it is not available at HWPOS_BASE_URL. |
check.sh also accepts PHP_VER, APP_DIR, DB_NAME, DB_USER, DOMAIN, MODE and CHECK_ONLY. See check.sh diagnostics.
Examples
# Different port, without asking
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo WEB_PORT=8080 bash
# No printing (server that does not print)
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo WITH_PRINTING=no bash
# With your own domain name
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo DOMAIN=pos.mystore.com bash
# Environment only (dependencies and services), without the system code
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo ENV_ONLY=1 bash
# From a specific package already on the server
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo HWPOS_ZIP=/root/HWDPOS-v1.5.0.zip bash
# Unattended, also changing the time zone
curl -fsSL https://3r.com.pa/hwdpos_inst/bootstrap.sh | sudo HWPOS_ZIP=/root/HWDPOS-v1.5.0.zip SET_TIMEZONE=yes bashWhen the code is already on the server and deploy/ exists (it is created by the first installation), you can call the family installer directly:
sudo DOMAIN=pos.mystore.com PHP_VER=8.3 WITH_PRINTING=no bash /var/www/HWDPOS/deploy/install-ubuntu.shBefore the first installation, use bootstrap.sh with HWPOS_ZIP instead, because the official .zip does not include the deploy/ folder.
Behavior notes
- Re-running is safe. It does not delete data and does not change a database password that already works. See Upgrade and reinstall.
- Exit code. Any failure or cancellation ends with a non-zero exit code, so automation cannot mistake a failed installation for a successful one.
- Terminal detection. Questions are asked only if
/dev/ttycan actually be opened. Under cron, cloud-init orssh host 'command'it may exist but not open; in that case defaults and variables are used. - Split installations. See Separate database server for
MODE,DB_HOSTandDB_ALLOW.