Docker (self-hosted)
Logswarm ships as one Docker image that runs the search engine and the web UI. Run it on a host that can reach your log servers over SSH; your team uses it from the browser.
Quick start
Download docker-compose.yml or save this as docker-compose.yml:
services:
logswarm:
image: ghcr.io/mderkowski82/logswarm:latest
restart: unless-stopped
ports:
- "3000:3000"
environment:
# Remove when Logswarm sits behind HTTPS (reverse proxy with TLS).
SESSION_COOKIE_SECURE: "false"
volumes:
- logswarm_data:/data
# Linux hosts, optional: ties the license fingerprint to this machine as well.
# Decide before activating a license (see "Host binding" below).
# - /etc/machine-id:/host/machine-id:ro
volumes:
logswarm_data:
Then:
docker compose up -d
docker compose logs logswarm | grep -A1 "Created admin account"
Open http://<host>:3000 and sign in as admin@logswarm.local with the password from the log. On this first sign-in Logswarm asks you to set your own password (at least 12 characters, typed twice). Until you do, the account can't reach anything else.
What happens on first start
The server binary, in order:
- Runs database migrations against SQLite in
/data. - Generates a random application secret in
/data/.app-secret(owner-only) whenAPP_SECRET_KEYis not set. It signs sessions and encrypts stored SSH credentials. - Creates an installation ID in
/data/installation.id. Together with the optional host machine-id it forms the license fingerprint. - Creates the admin account
admin@logswarm.localwith a random one-time password, printed once to the log. The first sign-in with it requires setting your own password. If you setADMIN_INITIAL_PASSWORDbefore the first start, that password is used as is and no change is forced. - Serves as the unprivileged user
1001. The image has no shell and no Node.js: one static binary, the web UI and the remote search agent. The health check probesGET /api/health.
There are no default secrets. The server refuses the old placeholder values from earlier example files.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
APP_SECRET_KEY | generated in /data/.app-secret | Session signing and SSH credential encryption. Set it only to reuse an existing secret. |
ADMIN_INITIAL_PASSWORD | random, printed once | Password for the first admin account, used only when the account is created. Without it, the printed one-time password must be replaced on first sign-in. |
SESSION_COOKIE_SECURE | true | Set to false when you access Logswarm over plain HTTP. |
LOG_SWARM_DISABLE_CHECKIN | unset | Set to 1 for air-gapped installations (see License check-in). |
LOG_SWARM_HOST_MACHINE_ID_PATH | /host/machine-id | Where the optional host machine-id is mounted. |
INITIALIZE_PASSWORD | unset | Only for the /initialize endpoint; leave unset to disable it. |
Persistent data (/data)
Keep the logswarm_data volume across upgrades. It holds:
- the SQLite database (
logswarm.db) with servers, directories and presets .app-secret— without it stored SSH credentials cannot be decryptedinstallation.idand the encrypted license (license.dat)
Back the volume up regularly. Treat it as sensitive: it contains the secret that decrypts your SSH credentials.
Licensing
Starter works without a license file: 1 server, 4 catalogs and up to 8 log locations. Each location must be a specific log directory such as /var/log/app, not a top-level folder.
For Pro:
- Sign in as admin and open License. Copy the installation fingerprint.
- Activate the fingerprint in your Logswarm dashboard and download the
.logswarm.licfile. - Import the file in License. Status turns valid; renewals download automatically.
Bind the license to the host (optional)
On Linux hosts, mount the host machine-id read-only:
volumes:
- logswarm_data:/data
- /etc/machine-id:/host/machine-id:ro
The fingerprint then depends on both the volume and the host, so a copied volume does not carry the license to another server. Adding or removing the mount changes the fingerprint: re-activate the license afterwards. Docker Desktop on Windows/macOS has no /etc/machine-id; skip this there.
License check-in
Licensed installations report to the license portal every 6 hours: fingerprint, a random per-start instance ID, app version and plan. The portal uses it to detect cloned or tampered installations. Check-in never blocks the application. Set LOG_SWARM_DISABLE_CHECKIN=1 for air-gapped sites.
Upgrades
docker compose pull
docker compose up -d
Use the same volume. Migrations run automatically on start.
Upgrading from an installation that used the example secret (change-me-to-a-random-string-at-least-32-chars): the new image refuses it. Set APP_SECRET_KEY to that old value explicitly together with LOG_SWARM_ALLOW_INSECURE_SECRET=1 to keep stored SSH credentials readable, then re-enter credentials and switch to a new secret when convenient.
Operations checklist
- Put Logswarm behind a reverse proxy with TLS and remove
SESSION_COOKIE_SECURE: "false". - Expose port 3000 only on trusted networks.
- Back up the
/datavolume. - Sign in right after the first start and set your own admin password; the one-time password in the log stops working once you do.
Host binding (/etc/machine-id)
The license fingerprint is computed inside the image from the installation ID stored in /data. That alone ties a license to one data volume.
On Linux hosts you can also mount /etc/machine-id read-only. The fingerprint then includes the host's machine ID, so a copied data volume does not activate the license on another machine.
- Decide before you activate a license. Adding or removing the mount later changes the fingerprint, and the license has to be re-activated in your dashboard.
- On Docker Desktop (Windows, macOS) leave it out: there is no stable host machine ID to mount.
Troubleshooting
| Symptom | What to check |
|---|---|
| Login succeeds but you are sent back to the login page | Plain HTTP with secure cookies: set SESSION_COOKIE_SECURE: "false" or use HTTPS |
| Health check returns 503 "placeholder value" | APP_SECRET_KEY is the old example value; see Upgrades |
| Lost the admin password | Read the first-start log; otherwise reset the account in the database |
| License invalid after redeploy | Different volume, or host machine-id mount added/removed |
| Search says Starter limit reached | More than 8 log locations, a second server, or a top-level folder such as /var on Starter; use a specific log directory or upgrade |
| License error "clock is behind" | The host clock was set back. Fix the time (NTP) and restart; the license works again |