Gardience Documentation gardience.com →
Docs / Installation

Install on one server

This page covers the all-in-one install: Gardience and its own Salt master on one Linux server. To use a Salt master you already run, see Attach to an existing Salt master. For a server with no internet access, see Install without internet access.

The quickest way: one command

When you start a trial at gardience.com/trial (or after you buy), the page shows a command like this:

curl -fsSL https://gardience.com/i/YOUR-CODE | sudo bash

Run it on the server. It downloads the current release, checks it against the release checksum, adds your license, installs Docker if it is missing, and runs the installer described below with its default options. It prints the console address and the first admin password when it finishes. The command works for 24 hours; open your trial or order page again for a fresh one. To pass installer options, add them after bash -s --:

curl -fsSL https://gardience.com/i/YOUR-CODE | sudo bash -s -- --hostname gardience.example.com --fleet-size 1000

The release is unpacked in /opt/gardience/releases/X.Y.Z (or under --dir). To check the release signature yourself, or for a server without internet access, use the steps below instead.

If something goes wrong

Before you start

Install

To install:

  1. Copy the bundle and its .sha256 file to the server, then check the download:

    sha256sum -c gardience-X.Y.Z.tar.gz.sha256
  2. Extract the bundle in a folder where it can stay. The install keeps its release files in this folder and refers to it until your first upgrade, so do not delete it. Do not extract it inside /opt itself, because the bundle unpacks to a folder named gardience and the default install folder is /opt/gardience.

    sudo mkdir -p /opt/gardience-release
    sudo tar xzf gardience-X.Y.Z.tar.gz -C /opt/gardience-release
    cd /opt/gardience-release/gardience
  3. Optional, but recommended: create a passphrase file for encrypting the automatic pre-upgrade backups. Those backups hold every key. Keep the file readable by root only.

    sudo sh -c 'umask 077; openssl rand -base64 32 > /root/.gardience-backup-pass'
  4. Run the installer. Set the name agents and browsers will use, your fleet size and your license:

    sudo ./install/install.sh \
      --hostname gardience.example.com \
      --fleet-size 1000 \
      --license /path/to/gardience-license.json \
      --backup-passphrase-file /root/.gardience-backup-pass

    The first run downloads Gardience's prebuilt images with your license (about 300 MB) and checks each one against the SHA-256 in the signed release. The installer then starts the services and waits up to 3 minutes for the console to answer.

  5. Save the output. It shows:

    • the console address, for example https://gardience.example.com/
    • the admin password. It is shown only once.
    • the address and ports agents should use
    • the management commands
  6. Check the install:

    sudo /opt/gardience/gardience status
    sudo /opt/gardience/gardience doctor

    status lists the containers and the health result. doctor checks services, the Salt connection, disk space, the TLS certificate, the license, the audit log and backups, and exits with code 1 if any check fails.

The installer refuses to run when:

Installer options

Run ./install/install.sh --help to print the option list. Every option takes a value except --insecure-salt-api and --upgrade.

Location and web access

OptionDefaultWhat it does
--dir PATH/opt/gardience as root, ~/gardience otherwiseInstall folder. It holds the settings (.env), compose.yml, config/, Salt content in srv/, and the gardience management command.
--https-port N443Host port for the console over HTTPS.
--http-port N80Host port that redirects to HTTPS.
--hostname NAMEthis host's FQDN (hostname -f)Name in the TLS certificate and in the console address the installer prints. Also the default agent address.
--tls-cert FILE and --tls-key FILEnone: a self-signed certificate is createdUse your own certificate and private key. Give both. Or replace the certificate any time later by dropping the files in Administration > Certificate (The console's certificate).
--name NAMEgardience-serverDocker Compose project name. Container and volume names start with it.

The self-signed certificate is valid for 825 days and covers --hostname, localhost, 127.0.0.1 and the server's own addresses.

Servers on a VPN. The server's address is the one on the network card that reaches the internet, except when the internet goes through a VPN (Tailscale, WireGuard, OpenVPN, a company VPN): then the VPN address would only work inside the VPN, so the installer uses the server's own network address instead and says so. The sign-in details list every address the console answers on. If the VPN also uses Docker's address range (172.17 and up), the server cannot reach its own console while the VPN is on; run the install with the VPN off, or give Docker another range in /etc/docker/daemon.json ("default-address-pools") before installing.

Salt and agents

OptionDefaultWhat it does
--salt-bind IP0.0.0.0 (all addresses)Host address the Salt ports listen on.
--salt-ports A,B4505,4506Host ports for Salt's publish port (A) and return port (B). The enrollment playbook sets these ports on agents when they are not the defaults.
--master-address Athe --hostname value when it is a full name (has a dot), otherwise the server's IP addressAddress agents use to reach the Salt master. It goes into the agent install commands and the enrollment playbook. Change it later with sudo /opt/gardience/gardience address A.
--fleet-size N500How many machines you expect to manage. Tunes the Salt master and, above 1,000, the agents. See Requirements.

License and backups

OptionDefaultWhat it does
--license FILEnoneLicense file to install. Without one, the console is read-only.
--install-dockeraskIf Docker or its Compose plugin is missing, install them from Docker's official repository without asking. Not available with the offline bundle (install Docker from your own mirror first).
--backup-passphrase-file FnoneEncrypts the automatic pre-upgrade backups with this passphrase file. Recommended, because those backups hold every key. Keep the file off the backup's disk if you can.

Primary and standby pairs

Use these only when you run two servers, a primary and a warm standby. See Upgrade for how upgrades treat a pair.

OptionDefaultWhat it does
--standby-address AnoneAddress of the warm standby. Agents are set up with both addresses and Salt's failover mode, so they move to the standby on their own after it is promoted.
--peer-url URLnoneConsole URL of the other server in the pair. A returning old primary checks it and fences itself (runs no Salt master) if the standby was promoted. gardience promote refuses to run without it unless you pass --force.
--peer-agent-address AnoneOn the standby: the primary's agent address, so agents enrolled on the standby after a promotion still list both servers.

Attach mode

These apply only when you attach to your own Salt master. See Attach to an existing Salt master.

OptionDefaultWhat it does
--attach URLnot set (all-in-one)Switches to attach mode. The URL of your salt-api.
--eauth TYPEfileThe Salt external authentication type Gardience's service accounts sign in with, for example pam, file or ldap.
--insecure-salt-apioffAccept a self-signed salt-api certificate.
--attach-master-ip IPnoneThe only address allowed to reach Gardience's internal endpoint.
--admins A,BnoneUsers from your master's eauth who administer Gardience.
--approvers A,BnoneUsers who may approve runs. Admins approve too.

Used by upgrades only

OptionWhat it does
--upgradeUsed by gardience upgrade. Regenerates an existing install's compose file, web front end, Salt content and settings for the new release, keeping its secrets, users, certificate, license and data. Do not run it yourself.

First sign-in

To sign in for the first time:

  1. Open the console address the installer printed, for example https://gardience.example.com/. With the self-signed certificate your browser shows a warning until you replace the certificate with your own.
  2. Sign in as admin with the password from the installer output. If the page asks for a login type, choose file, which is used for the accounts the gardience command creates.
  3. Replace the admin password. This creates a new random password and shows it once:

    sudo /opt/gardience/gardience user passwd admin
  4. Create an account for each person instead of sharing admin. Roles are admin, operator, approver, viewer and helpdesk-windows. Each new password is shown once.

    sudo /opt/gardience/gardience user add alice operator

Sessions last 8 hours for local accounts (session_hours in config/users.yaml, 1 to 24) and 1 hour for directory and single sign-on accounts (directory_session_hours), and are shared by every open tab in the browser (closing every console tab ends the shared session after a minute). Removing a user, changing their role or resetting their password ends their open sessions at once, so the change applies at their next sign-in. Sign-ins are rate limited per client address. See Users and roles for what each role can do.

To use your own TLS certificate later, copy the certificate to config/tls/gardience.crt and the key to config/tls/gardience.key in the install folder, then run sudo /opt/gardience/gardience restart.

Licensing

A license is a small signed file. Gardience checks the signature on the server itself, with no internet connection, so it works on air-gapped networks. A license sets how many nodes you may manage and when it expires.

To install or replace a license, or to see its status:

sudo /opt/gardience/gardience license /path/to/gardience-license.json
sudo /opt/gardience/gardience license

What happens when the license does not cover the fleet:

SituationWhat happens
No license, or the file is not validThe console is read-only: viewing, scanning and reports work, changes are refused.
License expiredEverything keeps working for 30 days. After that the console is read-only.
More nodes than the license coversEverything keeps working for 30 days from the first day over. After that the console is read-only until nodes are removed or the license is upgraded.

Once a license has expired, or the fleet has stayed over its limit past the 30 days, security work still runs: installing updates, rebooting to finish them, re-applying the security baseline and checking that machines are back. Salt itself is never affected by the license.

Next steps

Add machines to the fleet. The installer output already shows the address agents use.

Gardience by Bouziden Management LLC.