Start here
Install
The installer takes a few minutes. It asks its questions in the terminal, writes the configuration and the secrets, pulls the images, starts the stack, checks its health and prints the first administrator's password.
Run the installer#
On a host prepared as in Prepare the host:
$ curl -fsSL https://raw.githubusercontent.com/su2626/bastionos-install/main/install.sh | sudo bashOn a bastion, reading a script before running it is a good habit:
$ curl -fsSL -o install.sh https://raw.githubusercontent.com/su2626/bastionos-install/main/install.sh
$ less install.sh
$ sudo bash install.shWithout a version, it installs the latest one. A version can be named: sudo bash install.sh 1.2.0.
What it does, in order:
- checks Docker, Compose 2.24 or later and openssl;
- signs in to the image registry if the images are private (an account and a token are then asked once and kept for upgrades);
- checks the signature of the installer image of that version, and takes the deployment bundle out of it: Compose files, OpenBao configuration, operating scripts and the
bastionoscommand. No source code is installed; - runs
bastionos install, which asks the questions below.
The installation directory is /var/dck/bastionos by default (--dir to change it). The bastionos command is linked into /usr/local/bin and /usr/bin.
The questions#
Address and HTTPS#
Address of the bastion: the name users type, for example bastion.example.com. It must resolve to this host. It is also the address that passkeys and single sign-on redirects are bound to, so choose it once.
HTTPS certificate: five choices.
| Choice | When | What it needs |
|---|---|---|
| Let's Encrypt | the host is reachable from the Internet | ports 80 and 443 open, an e-mail address for expiry notices; renewed automatically |
| Let's Encrypt through DNS | the host is not exposed | your DNS provider's code and API variables (the lego list) |
| Your certificate | internal PKI or a public authority | the PEM chain, certificate first, and its unencrypted key |
| Self-signed | a trial | nothing; browsers warn and may refuse security keys |
| Existing reverse proxy | nginx, Nginx Proxy Manager, Traefik already carry the certificate | the console URL as users open it; the proxy forwards to the console port with WebSockets |
With a reverse proxy, forward https://bastion.example.com to http://<host>:8081 and allow WebSockets on /terminal/ws and /sql/ws. SSH, RDP and database ports are not HTTP: publish them directly, not through the proxy.
Ports#
The installer then asks for the HTTPS and HTTP ports (443 and 80), the API port (8080, bound to the host), the SSH gateway port (2222) and the RDP port for native clients (3389). Database ports keep their defaults (15432, 13306, 17017, 16379, 16443) and can be changed later in deploy/compose/.env.
OpenBao#
BastionOS keeps every account secret in OpenBao.
- Bundled: started on this host and unsealed by a key kept next to its data. Fine for a trial or a small site, never for production.
- Existing: an OpenBao your team runs. Give its address, its CA, and one AppRole per component (
bastionos-controlplane,bastionos-ssh-gateway,bastionos-db-gateway). The policies to create are indeploy/openbao/policies/of the installation. See OpenBao.
Options#
- Premium modules: only with a license that includes them. They can be added later.
- Demonstration directory: an OpenLDAP with fictitious people, to try directory sign-in. Never in production.
First administrator#
Give a password, or leave it empty and the installer generates one. It is shown once. Change it at your first sign-in, then enrol a second factor.
At the end#
==> BastionOS is running
Console https://bastion.example.com
HTTPS Let's Encrypt, renewed automatically
SSH ssh -p 2222 '<user>#<account>@<asset>'@bastion.example.com
RDP bastion.example.com:3389 (a .rdp file from My access)
Administrator admin
Password ************Then follow First session.
Unattended installation#
Every answer can be given in the environment, and --yes takes the default of every question nobody answered:
sudo BASTION_INSTALL_HOST=bastion.example.com \
BASTION_TLS_MODE=letsencrypt \
BASTION_TLS_ACME_EMAIL=ops@example.com \
bash install.sh --yesThe administrator's password is then generated and printed at the end.
BASTION_TLS_MODE takes letsencrypt, letsencrypt-dns, files, selfsigned or proxy. The full list of variables is in the header of the bastionos command (bastionos help).
Running it again#
On a host that is already installed, the same line upgrades to the version it names, after a backup. It also recreates the bastionos link if it was lost. See Upgrade.
Other ways to install#
- Kubernetes with Helm, for production and high availability.
- Air-gapped bundle, for a site without Internet access.