Linux installer and systemd
curl -fsSL https://raw.githubusercontent.com/kucukkanat/bunker/master/install.sh | sudo BUNKER_URL=https://bunker.example.com shThe installer:
- Detects your OS and CPU, downloads the matching release from GitHub and checks its SHA-256 against
checksums.txt. - Installs the binary to
/usr/local/bin/bunker. - Creates a
bunkersystem user, the data folder/var/lib/bunkerand the settings file/etc/bunker/bunker.env. - Writes and starts a hardened systemd unit (
/etc/systemd/system/bunker.service). - Prints your setup URL and code. The code is also in
/var/lib/bunker/setup-code.txt.
Automatic HTTPS
Section titled “Automatic HTTPS”When you pass an https:// BUNKER_URL (and no BUNKER_LISTEN), the installer writes BUNKER_TLS=auto. Bunker then listens on 443, answers ACME challenges on port 80 and gets Let’s Encrypt certificates by itself. You need:
- a DNS record pointing at the server, and
- ports 80 and 443 open to the internet.
Certificates are cached in /var/lib/bunker/certs. Set BUNKER_ACME_EMAIL to get expiry mail from Let’s Encrypt.
Already have a proxy or load balancer? Set BUNKER_LISTEN=127.0.0.1:8080 instead. See Behind a proxy.
Options
Section titled “Options”Pass options after sh -s --:
| Option | Environment | |
|---|---|---|
--version v1.2.3 |
BUNKER_VERSION |
Install a specific release (default: latest) |
--no-service |
BUNKER_NO_SERVICE=1 |
Only install the binary |
--dir DIR |
BUNKER_INSTALL_DIR |
Where to put the binary |
BUNKER_URL, BUNKER_LISTEN, BUNKER_SETUP_CODE |
Written into /etc/bunker/bunker.env on first install |
|
BUNKER_DOWNLOAD_URL |
A mirror holding the release files and checksums.txt (air-gapped installs) |
Without sudo, the installer puts just the binary in ~/.local/bin. To upgrade, use Admin → Updates, or run the same command again; your settings file is kept.
The settings file
Section titled “The settings file”sudo nano /etc/bunker/bunker.envsudo systemctl restart bunkerjournalctl -u bunker -fEvery variable is listed in the configuration reference.
What the service is allowed to do
Section titled “What the service is allowed to do”The unit runs as the unprivileged bunker user with a tight sandbox:
NoNewPrivileges=yesProtectSystem=strictProtectHome=yesPrivateTmp=yesPrivateDevices=yesProtectKernelTunables=yesProtectKernelModules=yesProtectControlGroups=yesRestrictNamespaces=yesMemoryDenyWriteExecute=yesRestrictAddressFamilies=AF_INET AF_INET6 AF_UNIXSystemCallFilter=@system-serviceSystemCallFilter=~@privilegedCapabilityBoundingSet=CAP_NET_BIND_SERVICEAmbientCapabilities=CAP_NET_BIND_SERVICEReadWritePaths=/var/lib/bunkerUMask=0077It can write only to its data folder and can bind ports 80 and 443 without being root.
macOS and Windows
Section titled “macOS and Windows”- macOS: the same
curl ... | shinstalls the binary. Runbunker serve, orbunker devfor a single-user local copy without sign-in. - Windows (PowerShell):
irm https://raw.githubusercontent.com/kucukkanat/bunker/master/install.ps1 | iex