Repository navigation
Upgrading from 3.3
WebSSH 3.4 replaced the Python server with a new server written in Go. The web interface, the data you created and the way you deploy WebSSH stay the same; the server underneath is new. This page applies to every update from 3.3 to 3.4 or any later release: you can go directly from 3.3 to the current release without installing 3.4.0 first. Updates between 3.4 and later releases need none of this; see Upgrading, Rollback and FAQ.
Compared with 3.3 the image is about five times smaller and has no operating system packages or shell, the server is ready in under a second, and it needs about half the memory.
Supported platforms are the container image for linux/amd64 and
linux/arm64 (Docker, Docker Compose, Unraid), the release binaries for
Linux (LXC, Incus, Proxmox) and a source build on Linux.
With the shipped Compose files or the Unraid template, and no changes of
your own to command:, entrypoint: or the health check: make a backup,
change the image and start it. Everyone signs in once after the update.
Check more only if one of these applies:
- you pass
SECRET_KEYas an environment variable: 3.4 needs the same value; - your Compose file starts
gunicorn,shorpython, or has a health check of your own (the image has no shell); - WebSSH runs behind a reverse proxy: it must forward WebSocket upgrades
and the
Originheader; - you rely on behaviour listed in the 3.4 Change Reference, for example scripts that call the HTTP API.
The checklist below covers each step. The way back to 3.3 stays available until you remove the 3.3 data.
- Image name, container port 5000, the volumes
/app/dataand/app/recovery, the runtime user 1000:1000 (Unraid: 99:100). -
DATA_DIR,SECRET_KEYand the documented environment variables. Values are read the way 3.3 read them. - Accounts, passwords, TOTP, recovery codes and passkeys. The WebAuthn
relying party, the OIDC callback
/oidc/callbackand the GitHub callback/auth/github/callbackare unchanged, so identity providers need no change. - Hosts, jump hosts, SOCKS5 proxies, SSH keys, host keys, notes, commands, command sets, runbooks, schedules, saved passwords, SMB shares, settings and persistent tmux session names.
- Browser-local data (layouts, preferences kept in the browser) keeps its storage namespace.
- Backups made with 3.x restore on 3.4.
- The command form
/app/entrypoint.sh flask --app start:app <command>keeps working until the next major release (seeU18). - The audit log
logs/security_audit.logkeeps its line format. - Automation steps run in the remote login shell as before; with sudo they
run as
sudo -n -- sh -c '<step>'. - Host names with non-ASCII characters are converted with IDNA 2003 as before, in saved hosts and in the allowlists of SOCKS5, SMB and Tailscale SSH.
- The LDAP filter syntax,
LDAP_CA_FILEand theldap-toolshelper volume. - Uploads and server-to-server copies create new files with the target SFTP
server's default permissions, not with the mode of the source, as 3.3 did
(
U89).
-
Read this page to the end, in particular the way back.
-
Create a backup in 3.3 (Settings Center → Backup & Restore) and copy it off the host. Better still, also copy the whole data volume while WebSSH is stopped.
-
Note where
SECRET_KEYcomes from: the generated fileDATA_DIR/secret_key(the default) or an environment variable. With an environment variable, 3.4 must receive the same value. -
Stop and remove the 3.3 container. Never run 3.3 and 3.4 on the same data volume at the same time (
U05). -
Update the Compose file, or at least remove changes that need a shell or Python in the image: any
command:orentrypoint:that startsgunicorn,shorpython, and health checks of your own that run other programs (U15,U16). The health checks of the 3.3 Compose files keep working. -
Behind a reverse proxy, make sure it forwards WebSocket upgrades and the
Originheader for every path below the WebSSH prefix (U31,U32). -
Optional: preview the migration without changing anything:
docker compose run --rm webssh migrate --dry-run
The command prints the migration report as JSON. It activates nothing and leaves the 3.3 data untouched.
| # | What happens | What to do |
|---|---|---|
| U01 | On its first start 3.4 finds the 3.3 data in DATA_DIR, copies everything into its own database in DATA_DIR/go/ and checks every copied record before it activates the result. The start takes a few seconds longer than usual. |
Nothing. Watch the log for migration completed. |
| U02 | The 3.3 data is only read, never changed or deleted. The exceptions are runtime paths: logs/ and keys/ get mode 0700, keys/ is created when it is missing, and 3.4 appends its events to logs/security_audit.log. |
Nothing. |
| U03 | The migration writes a report to DATA_DIR/go/migration-report-<UTC>.json (mode 0600), also when it fails. It lists what was migrated, records that were flagged and actions left to users or administrators: legacy SSH keys 3.4 cannot use (U58), schedules that need a new approval (U95), an old automation vault to import (U92). |
Read the report and act on its warnings and pending_user_actions. |
| U04 | Everyone signs in once. Browser sessions, "remember me" cookies and known-device cookies are not carried over. Also discarded: enrollments in progress, step-up confirmations, issued first-factor bootstrap codes, sign-ins with OIDC or GitHub that were in progress, and the counters of the sign-in rate limits. Passwords, second factors and passkeys stay. | Tell users to expect one new sign-in. Issue new bootstrap codes where the report lists open ones. |
| U05 | If the 3.3 data changes while 3.4 runs, for example because a forgotten 3.3 container still uses the volume, 3.4 notices within a minute, reports not ready and refuses new sign-ins and changes until it is restarted. | Stop the 3.3 container, then see Starting 3.4 again after the way back. |
| U06 | 3.4 creates logs/.webssh-go/keyring-material (32 random bytes). Together with SECRET_KEY it protects the secrets in the new database. While the 3.3 data exists the file lives below logs/ on purpose, so that a backup made by 3.3 after a way back never carries it. |
Do not delete logs/.webssh-go/. Keep it in volume backups. Without it, saved SSH keys, saved passwords and second factors cannot be read. |
| U07 | Settings whose default is safer in 3.4 keep their 3.3 behaviour on an upgraded installation. The migration records them explicitly: host discovery and reachability for all users (U68), legacy SSH algorithms (U57), the origin rule of CORS_ORIGINS=* (U33), the tailnet rule (U64) and the close confirmation of sessions. New installations get the safer defaults. |
Review them in Administration once the update has settled. |
The migration stops without writing anything when it cannot copy the data completely. 3.4 then exits, the 3.3 data is untouched and the message names the way out:
| # | Message or code | Cause | Way out |
|---|---|---|---|
| U08 | legacy_in_use |
3.3 still runs on the volume, or its database or operation.lock is held. |
Stop 3.3 and start 3.4 again. |
| U09 | not_enough_space |
The volume needs room for about three times app.db, plus the user directories, plus 64 MiB. |
Free space on the volume. |
| U10 |
secret_key_mismatch, "SECRET_KEY does not match the stored data" |
3.3 received SECRET_KEY from the environment and 3.4 did not get the same value. |
Pass the same SECRET_KEY to 3.4. |
| U11 | python_restore_unfinished |
A 3.3 restore did not finish. | Start 3.3 once to finish or roll back the restore, stop it, then start 3.4. |
| U12 | for example legacy_unsafe_path, legacy_unreadable, legacy_record_damaged
|
A symbolic link, an unreadable or damaged file or an invalid record in the 3.3 data, for example a corrupt app.db or an SMB share record that contains a password, or a single stored secret that does not decrypt while SECRET_KEY decrypts the others (legacy_record_damaged). The message names the file, or the entity, account and record. |
Fix or remove the named file in 3.3, then start 3.4 again. |
| U13 | migration_incomplete_build |
The 3.4 build cannot migrate every kind of data it found. | Use a released 3.4 image. |
| U14 | "exceeds 67108864 bytes" | A single store file is larger than 64 MiB. The migration handles one account at a time, so its memory depends on the largest account's stores, not on the number of accounts: accounts with stores close to that limit need about 0.9 GB for a moment. 3.4 sets the Go memory limit to three quarters of the container's mem_limit unless GOMEMLIMIT is set. If DATA_DIR lies on a tmpfs, everything the migration writes there (the new database and its staging copy) also counts against the container's memory limit, and the first start can be killed for lack of memory. |
Reduce the store in 3.3 (connection-store), or raise the container's memory limit for the first start. Keep DATA_DIR on a disk volume, not on a tmpfs. |
| U132 |
legacy_unreadable after the way back |
3.4 cannot read the 3.3 data to compare it with the migrated state, usually because the data directory or a file in it belongs to another user than the one 3.4 runs as. 3.4 keeps running as for legacy_changed and answers every request with 503 and an explanation; the log names the file and the error. Earlier builds reported this as legacy_changed and suggested migrate --replace. |
Make the data directory readable by the container's PUID/PGID (for example 99:100 on Unraid), then start 3.4 again. |
Every change you can notice after the update is listed, with a number
(U15 and so on), in the 3.4 Change Reference. The
numbers in parentheses on this page point there; the first-start entries
U01 to U14 and U132 are on this page.
These limits apply to 3.3 and 3.4 alike or are open for a later release:
- At most 10 SSH sessions run at the same time, 5 per account
(
QUOTA_SSH_SESSION_GLOBAL,QUOTA_SSH_SESSION_PER_USER). Two accounts with five sessions each lock everyone else out. Raise the limits for more users. - In 3.4.0 a detached terminal whose program keeps printing stays open
until its owner signs out, because output counts as activity. Since 3.4.1
it ends after
SESSION_DETACHED_TIMEOUT_SECONDS(default one day); see Capacity. - Attempts through the SSH gateway count against the SSH session quota.
- Tailscale SSH has been tested against a stand-in for tailscaled, not against a real tailnet.
The way back is the 3.3 image on the unchanged data volume. It exists until
you run webssh legacy purge.
- Stop and remove the 3.4 container.
- Start the 3.3 image,
ghcr.io/bifrost0x/webssh:3.3(or a pinned3.3.xtag), with the same volumes and the 3.3 Compose file, for examplehttps://raw.githubusercontent.com/bifrost0x/webssh/v3.3.1/docker-compose.yml. 3.3.1 stays available as the tagv3.3.1and the images3.3and3.3.1; it receives no further updates.
3.3 finds its data as it was before the update. Everything done in 3.4
after the update is missing there: new accounts, hosts, keys, settings and
changed passwords. 3.4 backups cannot be restored with 3.3 (U101); keep
the 3.3 backup you made before the update.
While 3.3 runs again:
- It treats
DATA_DIR/go/as ordinary data and includes it in its backups. The secrets in that database stay unreadable withoutlogs/.webssh-go/keyring-material, which 3.3 never packs. - Do not delete
go/orlogs/.webssh-go/if you may upgrade again. -
logs/security_audit.logcontains the entries 3.4 wrote (U115). - The variables 3.4 introduced, such as
TRUSTED_PROXY_CIDRS, have no effect in 3.3.
3.4 compares the 3.3 data with the state it migrated. If 3.3 changed
anything, 3.4 does not start the application and names the command that
migrates again. The process keeps running so the container does not restart
in a loop: every request gets 503 with this explanation (a page in the
browser), /ready answers 503 not_ready with legacy_changed, so the
health check reports the container unhealthy, and /health answers 200.
Nothing is migrated or changed until you choose:
docker compose stop webssh
docker compose run --rm webssh migrate --replace
docker compose up -dmigrate --replace keeps the current 3.4 database as a verified backup in
DATA_DIR/go/ and migrates the 3.3 data again. Changes made in 3.4 before
the way back are replaced. If a 3.3 restore removed go/, 3.4 reports that
its data is missing and names the same command.
If 3.4 cannot read the 3.3 data for this comparison, for example because
the data directory belongs to another user than the container's PUID and
PGID, it reports legacy_unreadable instead (U132). The page and /ready
name that code, and the log names the file and the error. Correct the owner or
the permissions and start 3.4 again; migrate --replace is not the remedy
there.
Once you no longer need the way back, remove the 3.3 data from the volume:
docker compose stop webssh
docker compose run --rm webssh legacy purge --backup-to /app/recovery
docker compose up -d- Remove it as soon as the way back is no longer needed, in particular when
the migration report warns
plaintext_key_sealed: older 3.x versions kept some SSH keys unencrypted, and those files stay in the 3.3 data until the purge. - The command refuses while a server or 3.3 runs on the volume, before a completed migration and while the report still lists data a later release has to take over.
- It lists the paths it will remove, including left-over directories the
migration kept in place and files that are no 3.3 data (they go into the
backup as well), and asks for confirmation (
--yesskips the question, not the list). - Before it removes anything it writes a backup with the 3.4 database,
SECRET_KEY, the keyring material and every left-over 3.3 file, reads it back and prints its path. Without--backup-toit writes next toDATA_DIRwhen that directory is writable, otherwise toBACKUP_TEMP_DIR.--skip-backupis refused while left-over files or files that are no 3.3 data exist. ASECRET_KEYfrom the environment is not written into the backup (U112). - The backup is not encrypted and has mode 0600. Whoever can read it can read every stored secret. Move it off the host.
-
secret_key,logs/andgo/are never removed. The keyring material moves fromlogs/.webssh-go/togo/keyring-material. - An interrupted purge continues at the next start and removes only files of the migration record.
After the purge the way back to 3.3 is gone. rotate-secret-key is
available from then on.
-
3.4 Change Reference: every change you can
notice, with its number (
U15and so on) - Backup, Restore and Secret Rotation
- Upgrading, Rollback and FAQ
- Data Storage and Persistence
WebSSH documentation - Project - Issues - Discussions - Security
This Wiki is published from the versioned docs/wiki source. Please propose documentation changes through a pull request.
WebSSH Wiki
Install
- Docker and Docker Compose
- Install on Unraid
- Install in LXC, Incus or Proxmox
- Production Deployment
- Reverse Proxy and Subfolder Deployment
Update
Use WebSSH
- Overview and Dashboard
- SSH Connections and Host Keys
- Profiles, Jump Hosts and Commands
- Terminal and Persistent tmux Sessions
- SFTP and SMB File Workspace and Transfers
- Local Directories
- Automation
- Saved Passwords
- Herdr Integration
- Tailscale SSH
Accounts and sign-in
- Authentication Overview
- Users and Account Management
- Account Access Controls
- Passkeys, Authenticator Apps and Recovery Codes
- OpenID Connect
- GitHub Authentication
- LDAP and Active Directory
Operate
- Health Checks and Troubleshooting
- Backup, Restore and Secret Rotation
- Administration, Audit and Diagnostics
- Configuration Reference
- Data Storage and Persistence
- Security Model and Hardening
Contribute