Skip to content

osa CLI

osa is the operator command-line tool shipped in the ownscale image. It reads the same environment variables as the server.

Run it in the running container:

docker compose exec ownscale osa <command>

Commands that must run while ownscale is stopped, namely restore and migrate down, use a one-off container instead:

docker compose run --rm --entrypoint osa ownscale <command>

From a source checkout, make osa <command> is a shortcut for the first form.

organization

CommandDescription
osa organization listList organizations.

user

CommandDescription
osa user listList users and their organizations.
osa user delete <user_id>Delete a user, their Headscale user and all their machines. Needs the running server.

headscale

osa headscale <subdomain> [headscale args...]

Runs the Headscale CLI against one organization’s instance, through its unix socket. It needs the running server, and the organization must be awake. For example:

docker compose exec ownscale osa headscale abcd nodes list
docker compose exec ownscale osa headscale abcd policy get

Prefer the console for routine changes. This command is for inspection and emergencies.

migrate

CommandDescription
osa migrate upApply the next pending migration. Prints no pending migrations when done.
osa migrate downRevert the last applied migration.
osa migrate statusShow the status of every migration.

The container’s entrypoint applies all pending migrations on every start, so you rarely need these.

verify

CommandDescription
osa verify dbFail if ownscale’s database is missing but has a backup.
osa verify organizationsThe same for every organization’s database.

Both run automatically on container start.

restore

CommandDescription
osa restore dbRestore ownscale’s database from backup, if missing locally.
osa restore organizationsRestore every organization’s database from backup, if missing locally.

Run restore db first. Backups are configured with the OWNSCALE_BACKUP_* settings in example.env.

Development commands

CommandDescription
osa gen-local-caGenerate the local development root CA. Does nothing if it exists.
osa devbox-key <subdomain>Print a short-lived, ephemeral auth key for an organization. Used by make devbox.