BASTIONOSDocs
bastion-os.com
EN

Operate

Address and HTTPS

Users open one address. Passkeys and single sign-on are bound to it, so it is chosen once, at installation, and its certificate is managed by BastionOS or by your reverse proxy.

The five modes#

Mode BASTION_TLS_MODE Renewal
Let's Encrypt over HTTP letsencrypt automatic; port 80 must reach the host
Let's Encrypt through DNS letsencrypt-dns automatic, through your DNS provider's API
Your certificate files bastionos certificate with the new files
Self-signed selfsigned for trials only
Reverse proxy proxy done by your proxy

In every mode but proxy, a small HTTPS front end serves the console under your name and redirects HTTP to HTTPS. The plain console port then listens on the host only.

Let's Encrypt through DNS#

For a host that is not reachable from the Internet. The installer asks for the provider's code and its variables, as listed by lego. For Cloudflare, for example:

DNS provider code: cloudflare
CF_DNS_API_TOKEN=<a token allowed to edit the zone's DNS>

The variables are stored with the installation's secrets, readable by the owner only.

Your certificate#

Give the PEM chain, certificate first, and its unencrypted key. The installer checks that they match and that the certificate names the bastion's address. To replace it before it expires:

$ sudo bastionos certificate /etc/ssl/bastion.crt /etc/ssl/bastion.key

A self-signed installation switches to your certificate the same way.

Behind a reverse proxy#

Nginx, Nginx Proxy Manager, Traefik or HAProxy carry the certificate and forward to the console port (8081 by default). Three things matter:

  • WebSockets on /terminal/ws and /sql/ws, for the web terminal, desktops and the SQL workbench;
  • the proxy passes the client's address in X-Forwarded-For, so policies with source networks and the audit see the real address. Private ranges are trusted by default (BASTION_TRUSTED_PROXIES);
  • only HTTP goes through the proxy. SSH (2222), RDP (3389) and the database ports are published directly by the host.

An Nginx example:

nginx
location / {
  proxy_pass http://10.0.0.5:8081;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto https;
  proxy_read_timeout 1h;
}

The other certificates#

The SSH gateway has its host key, generated at installation: users' SSH clients learn it on their first connection. Database clients and native RDP clients meet certificates generated at installation too. Database clients connect with sslmode=require or its equivalent. The kubeconfigs the console gives include the certificate kubectl must trust.

bastionos status lists certificates that expire soon.

© 2026 BastionOS · Source-available, self-hosted privileged access Contact