Server commands
Run these commands in the instance’s folder, next to compose.yaml and .env. Each runs inside the api container with the instance’s own settings.
setup.mjs: create the owner
Section titled “setup.mjs: create the owner”docker compose exec api node dist/setup.mjs- Prints a link that creates the owner account and names the instance. See The first start.
- The link works one time, for one hour. Running the command again replaces it.
- After the owner exists, the command refuses and exits with status 1.
reset-password.mjs: set a lost password
Section titled “reset-password.mjs: set a lost password”docker compose exec api node dist/reset-password.mjs owner@example.com- Prints a link that sets a new password for the account with this email address. Use it for the owner, or for any account.
- The link works one time, for one hour. It replaces an earlier reset link of the same account.
- Using the link signs the account out everywhere. The old password works until then.
- If no account has the email address, the command says so and exits with status 1.
The owner and admins can also make reset links for other accounts in the dashboard. Those links work for 24 hours. See Password reset links.
update-geo.mjs: refresh the location data
Section titled “update-geo.mjs: refresh the location data”docker compose exec api node dist/update-geo.mjsThe worker keeps both files current by itself, so you do not need this command on a normal instance. Use it when the owner turned off “Update location data automatically” in the instance settings, for example on an instance without internet access, or when you want new files now. It works with the automatic updates on or off. See Location data.
- Downloads DB-IP’s free location database (about 130 MB) and the address ranges of cloud and hosting providers (about 400 KB), whether they are due or not.
- Checks each file before it replaces the old one. If a download fails, the old file stays, and the command exits with status 1.
- If the worker is updating at that moment, the command says so, with the time when that update ends at the latest, and exits with status 1.
- The API loads the new files within 10 minutes. You do not need to restart it.
- Ctrl-C stops it cleanly. The old files stay.
The location database is IP geolocation by DB-IP, licensed under CC BY 4.0.
Commands that run by themselves
Section titled “Commands that run by themselves”You do not run these. The Compose file runs them:
migrate.mjsupdates both databases’ schemas when the stack starts. The API and the worker wait for it.worker.mjsruns beside the API. It runs uptime checks, evaluates alert rules and sends their notifications, deletes data past its retention, joins session replays, checks the disk for storage warnings, and keeps the location data current.
Backups
Section titled “Backups”backup.sh and restore.sh run on the server too. See Backups and restore.