Install with install.sh
One script sets up Bugsoft Portal on your own Linux server: packages, PHP-FPM, nginx or Apache, HTTPS, backups and checks.
In short
- Download the package, check it, and unpack it.
- Run
sudo ./install.shand answer a few questions. - Store the emergency account and the keys in your password vault.
The Bugsoft Portal package contains install.sh. This script sets up your own Linux server in one go: the
operating system packages, PHP-FPM, nginx or Apache, the database, HTTPS, the scheduled tasks, the backups, SELinux, the
firewall and a self-test. Which systems are tested is on What the server needs.
Start the installation
- Download the package
bugsoft-<version>.tar.gzwith its.sha256file (and.sig) from bugsoft.eu to the server. - Check the package and unpack it:
sha256sum -c bugsoft-<version>.tar.gz.sha256 tar -xzf bugsoft-<version>.tar.gz cd bugsoft-<version>
- Run the script as root:
sudo ./install.sh
Never use curl … | bash. Download first, check the SHA-256, then run the script.
What you see
The script asks its questions one by one. Press Enter to accept the suggestion between [ ].
install.sh currently asks its questions in Dutch. In this order, it asks for:
- the address of the portal (only the host, for example
portal.klaverveld.example); - the web server (nginx or Apache);
- the database (SQLite, MariaDB on this server, or MariaDB on another server);
- how HTTPS works, and for Let's Encrypt an e-mail address;
- sign-in: Microsoft Entra ID now, or later in Admin;
- the emergency account, the organisation and the licence;
- the name, language and time zone of the portal, and what the dashboard starts with;
- the backups, outgoing e-mail and the firewall;
- whether you accept the licence terms. Type
y(yes).
Then it works through numbered steps and shows a ✓ for each check that passes, for example the PHP version, the clock
(NTP), the direct connection to Microsoft and the self-test of https://portal.klaverveld.example/healthz.
At the end it asks you to store the keys. Type VERPLAATST ("moved") once they are in your password vault, or
press Enter to do it later with sudo bugsoft keys.
Questions and options
Every question is also an option. In an answers file, the key has the same name in capitals with _:
--db-host becomes DB_HOST=.
| Option | What it does |
|---|---|
--domain HOST | The address of the portal, without https://. The portal runs on https://HOST. |
--webserver nginx|apache | Default: the web server that is already there, otherwise nginx. Other sites on the server are left alone. |
--db sqlite|local|remote | SQLite (default), MariaDB on this server (the database and user are created; the password is in /etc/bugsoft/db-password), or MariaDB on another server. |
--db-host, --db-port, --db-name, --db-user | The MariaDB server with remote. The database must be empty. |
--db-pass-file FILE | The password of the database user, from a file. |
--db-ssl-ca FILE | The CA certificate for an encrypted connection to the database. |
--tls letsencrypt|certificate|proxy|selfsigned | How HTTPS works; see HTTPS, proxy and load balancer. |
--acme-email ADDRESS | With Let's Encrypt: the address for messages about the certificate. |
--enable-epel | On Oracle Linux, Rocky, Alma and RHEL, certbot is only in EPEL. Without this option the script asks first. |
--tls-cert FILE, --tls-key FILE | With your own certificate: the full chain and the key (PEM). |
--proxies LIST | Behind a proxy: the IP addresses or networks of the proxy. |
--listen IP | Behind a proxy: the address of this server on which port 80 listens. |
--sso entra|later | Set up Microsoft Entra ID now, or later in Admin › Settings › Sign-in › Connections. |
--entra-tenant, --entra-client | The tenant ID and client ID of the app registration. |
--entra-secret-file FILE | The client secret, from a file. Without this option the script asks for it and does not show it. |
--entra-secret-expires YYYY-MM-DD | The expiry date of the client secret. Bugsoft Portal warns you in time. |
--admin-email ADDRESS, --admin-name NAME | The emergency account: a local account for when signing in with Microsoft does not work. |
--admin-password-file FILE | The password of the emergency account. Without it, Bugsoft Portal makes a strong password. |
--organisation NAME | The name of your organisation (as on the licence). |
--license-file FILE | A file with the licence key. Without it, the 30-day trial starts. |
--name NAME | The name of the portal (default Bugsoft Portal). |
--locale nl|en|fr | The default language. |
--timezone ZONE | The time zone; the suggestion is the one of the server. |
--starter none|SET | An empty dashboard (default) or a starter set, for example microsoft365. |
--backup-path FOLDER | The folder for the backups (default /var/backups/bugsoft). |
--backup-copy-path FOLDER | A second place for every backup, for example a share on another system. |
--backup-cert FILE | Encrypt every backup for this certificate; see Backups and restoring. |
--backup-time HH:MM | The time of the daily backup (default 02:30). |
--backup-keep-days N | How many days backups are kept (default 14). |
--mail-host, --mail-port, --mail-encryption, --mail-user | Outgoing e-mail (optional); see Set up e-mail. |
--mail-pass-file FILE | The password of the mail user, from a file. |
--mail-from ADDRESS, --mail-from-name NAME | The sender of the e-mail. |
--firewall yes|no | Open ports 80 and 443 in firewalld, or in ufw if that is on (default yes). |
--saml | Also install php-xml, for sign-in with SAML. |
--accept-terms | Accept the licence terms. Required; without this option the script asks. |
--init systemd|none | Default systemd. none (automatic when there is no systemd, as in a container) starts the services itself and uses /etc/cron.d. |
How the script runs
--yes: ask nothing. A required value that is missing is an error.--answers FILE: read the answers from a file (KEY=VALUE). Only known keys; the file is never executed.--write-answers FILE: write the answers to a file, without secrets. Useful to keep a test environment and production the same; see A test environment and production.--dry-run: change nothing. Every command is shown, and every file as adiff -u.--package FILE: check and unpack a package instead of using the folder of the script.--allow-unsigned: accept a test package without a signature, or a signature that cannot be checked (there is no release key). Never for production.--latest: only withsudo bugsoft update: download the newest version that the licence check names, and install it; see Update Bugsoft Portal.--purge: only withsudo bugsoft uninstall; see Stop using Bugsoft Portal.
You can safely run the script again. Each step first checks whether there is anything to do. If Bugsoft Portal is already
installed, it only updates the settings. A second run with --dry-run should show nothing.
What the script does
- Checks first: root, the operating system, at least 1 GB of memory and 2 GB of free disk, the clock (NTP), ports 80 and 443, and whether the server can reach Microsoft directly.
- Packages from the sources of the operating system; no third-party sources. On Oracle Linux, Rocky and Alma, the module streams for PHP, nginx and MariaDB.
- PHP-FPM: its own pool that runs as the user
bugsoft. - Install Bugsoft Portal: database, keys, emergency account. Every secret goes through a file, never through the command line.
- Bugsoft Portal checks: the Bugsoft Connect key, the connection to Microsoft, the licence.
- The site for nginx or Apache, only after the installation, tested with
nginx -torapachectl configtest. If that fails, the previous version comes back. - Scheduled tasks:
bugsoft cron:runevery minute, and a backup every night. - SELinux (Oracle Linux, Rocky, Alma, RHEL) and the firewall.
- Self-test:
/healthz, no secret files readable through the website, http redirects to https, andproduction:check.
Everything is written to the log /var/log/bugsoft-install.log, without secrets.
Where everything is
| What | Where |
|---|---|
| The code (read-only) | /opt/bugsoft/releases/<version>; the active version through /opt/bugsoft/current |
| Settings and keys | /etc/bugsoft/bugsoft.env |
| The answers of install.sh | /etc/bugsoft/install.conf |
| Data | /var/lib/bugsoft |
| Backups | /var/backups/bugsoft |
| Admin command | /usr/local/sbin/bugsoft; see The bugsoft command |
After the installation
At the end, the emergency account is in /root/bugsoft-noodaccount.txt and the keys are in
/root/bugsoft-sleutels.env. Put both in your password vault. Then continue with First steps after the installation.
Without the keys from /root/bugsoft-sleutels.env, the saved passwords and the authenticator
keys are lost, even if you have a backup. The keys are deliberately not in the backups.
Stuck? See Questions and problems or contact Bugsoft at ugurs156@gmail.com.