Using it from your laptop
works
Everything the CLI does on the box, it can do from your laptop. Same commands, same output. This is the setup.
First, the box has to be reachable
Section titled “First, the box has to be reachable”The daemon binds 127.0.0.1 and stays there, deliberately: it is a control
plane that can create and destroy databases, so it does not put itself on a
network. Something you choose has to bridge it.
Tailscale is the recommended answer, and it is one command on the box:
tailscale serve --bg 7432That publishes it at your machine’s tailnet name over HTTPS, reachable by your devices and nothing else. More on tailnets and tunnels.
An SSH tunnel works too, and needs nothing on the box:
ssh -L 7432:127.0.0.1:7432 you@your-boxThen the URL below is http://127.0.0.1:7432, which is allowed over plain HTTP
because it never crosses a wire.
Then log in
Section titled “Then log in”On your laptop:
hobby login https://your-box.tailnet.ts.netIt asks for the operator password, the one set by hobby studio passwd on the
box, and exchanges it for an API token. The password is not stored and never
echoes.
From here every command runs against that box:
hobby lshobby new bloghobby deploy ./site --project blogLink a directory to a project
Section titled “Link a directory to a project”So you stop typing --project:
cd ~/code/bloghobby link blogThat writes { "project": "blog" } into hobby.json in that directory, and
commands run from there default to it. The file is meant to be committed: it
says which project this repository belongs to, and it holds no secret.
Your token is not in it. Credentials live in ~/.hobby/credentials.json at
mode 0600, per machine, precisely so a git add -A cannot sweep one up.
Several boxes
Section titled “Several boxes”hobby login against each, then:
hobby remote ls # which ones, and which is currentHOBBY_REMOTE=https://other-box.ts.net hobby ls # aim one command elsewhereRevoking
Section titled “Revoking”On the box:
hobby token lshobby token rm laptopThat machine is locked out on its next request. hobby logout on the laptop
only forgets the token locally; it does not revoke it, and the output says so.
If a laptop is lost, revoke on the box.
What a token can do
Section titled “What a token can do”Everything. A token is as powerful as the operator password: it can create and destroy every database on the box. There are no read-only tokens and no scopes, because one operator with several machines is the case and scopes without a second person to grant them to are ceremony.
Two consequences worth holding on to. Send a token only to a URL you trust, which
is why hobby login refuses plain HTTP to anything but loopback. And revoke by
name the moment a machine stops being yours.