Docker (self-hosted)
The Docker edition runs the same @logswarm/server engine as a containerized Next.js standalone service. Use it when multiple people should share one Logswarm instance over HTTP.
This is the self-hosted server edition. Desktop remains the recommended starting point for individual operators.
Quick start
From the repository root (or your deployment checkout that includes docker-compose.yml and packages/server/Dockerfile):
export APP_SECRET_KEY='replace-with-a-random-string-at-least-32-chars'
export INITIALIZE_PASSWORD='replace-with-a-strong-init-password'
docker compose up --build -d
Open http://localhost:3000 (or your mapped host port).
Compose layout
The default Compose service:
| Setting | Value |
|---|---|
| Image build | packages/server/Dockerfile (context: repo root) |
| HTTP port | 3000:3000 |
| Data volume | logswarm_data → /data |
DATABASE_URL | file:/data/logswarm.db |
LOG_SWARM_DATA_DIR | /data |
APP_SECRET_KEY | required secret for the app |
INITIALIZE_PASSWORD | password used during first-time admin initialization |
What happens on container start
The entrypoint:
- Runs Prisma migrate deploy against the SQLite database.
- Ensures an installation id exists under the data directory (created once, then reused).
- Starts the Next.js standalone server (
node packages/server/server.js) as thenextjsuser.
A health check probes GET /api/health on 127.0.0.1:3000.
Persistent data (/data)
Mount a named volume (or bind mount) at /data. Persist at least:
- SQLite database (
logswarm.db) - Installation / license material (fingerprint-bound)
- App secrets generated for this installation
Redeploy tip: keep the same volume when you rebuild the image. License and configuration survive container recreation.
First-run activation
- Open the web UI and complete initialization if prompted (
INITIALIZE_PASSWORD). - Open License activation. Copy the installation key / fingerprint shown for this server.
- Have an administrator issue a server edition
.logswarm.licfor that fingerprint. - Sign in as admin → import the license file → confirm status is valid.
Search requires a valid license on the server edition the same way the desktop edition binds to a hardware key.
Operations checklist
- Change default
APP_SECRET_KEYandINITIALIZE_PASSWORDbefore production use. - Expose port
3000only on trusted networks or behind TLS reverse proxy. - Back up the
/datavolume regularly. - After upgrades:
docker compose up --build -dwith the same volume.
Troubleshooting
| Symptom | What to check |
|---|---|
| Container unhealthy | docker compose logs, health endpoint, Prisma migrate errors |
| License lost after redeploy | Volume not remounted / different volume name |
| Cannot initialize admin | INITIALIZE_PASSWORD env value |
| DB permission errors | ownership of /data inside the container (nextjs user) |