June 28, 2025
bcrypt, 2FA (TOTP), basic RBAC, OIDC (Google, Okta, Authentik), and rate limiting built in. DB file is encrypted with AES-256-GCM.sudo mkdir /opt/termix
sudo nano /opt/termix/docker-compose.yml
services:
termix:
image: ghcr.io/lukegus/termix:latest
container_name: termix
restart: unless-stopped
ports:
- "127.0.0.1:8100:8080" # Map to host localhost only
environment:
- PORT=8080
volumes:
- ./termix-data:/app/data
Then run: cd /opt/termix && sudo docker compose up -d
Once the docker container is up, you can verify that it is running:
sudo docker container ps -a
sudo nano /etc/nginx/conf.d/termix.conf
server {
listen 8082; # Different port from other services
server_name termix.bachelor-tech.com;
# Import Trusted Proxies (Reuse your existing snippet!)
include /etc/nginx/snippets/trusted-proxies.conf;
# Import Blocklist (Optional, but good practice)
include /etc/nginx/blocklist.conf;
location / {
proxy_pass http://127.0.0.1:8100;
# Standard Proxy Headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# CRITICAL: WebSocket Support for SSH Terminal
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
sudo nginx -t
sudo systemctl reload nginx
The crucial piece of the puzzle here is that we do not want this website to be publicly reachable, yet we do want to equip it with an SSL certificate and accessible internally via HTTPS.
(Some parts are skipped, as they are left at default settings.)
sudo fail2ban-client status sshd
sudo nano /etc/fail2ban/jail.local
# "ignoreself" specifies whether the local resp. own IP addresses should be ignored
# (default is true). Fail2ban will not ban a host which matches such addresses.
ignoreself = true
# "ignoreip" can be a list of IP addresses, CIDR masks or DNS hosts. Fail2ban
# will not ban a host which matches an address in this list. Several addresses
# can be defined using space (and/or comma) separator.
ignoreip = 127.0.0.1/8 ::1 192.168.0.0/16 172.20.0.0/16
sudo systemctl restart fail2ban
sudo fail2ban-client set sshd unbanip 172.20.0.2
Enjoying this tutorial?
This site is a non-profit project. If it saved you some time, you can support it by getting Jan some coffee.
☕ Buy me a coffee
Comments