Self-hosting
Create your admin account
The first-run /setup screen on a self-hosted install: create the first workspace and owner with the setup code from the server log, usertasks-admin setup-code or USERTASKS_SETUP_CODE — or bootstrap from the command line.
On this page
A new self-hosted install has no workspaces and no users, and there's no public sign-up page. You create the first workspace and its owner (you) on the Create your admin account screen at /setup.
When /setup appears#
- Only on a self-hosted install (
DEPLOYMENT_MODE=self_hosted, the default) that has no workspaces and no users yet. - While setup is needed,
/,/loginand the app's pages all redirect to/setup. Just open the app's address. - Once the admin account exists,
/setupis gone: it redirects to/login. - The cloud edition has no
/setuppage.
Fill in the form#
| Field | What to enter |
|---|---|
| Organisation name | Your company or team, for example Acme Inc. The URL slug (acme-inc) is made from it and shown underneath; you can edit it. People type the slug in the Organisation field on the login page. |
| Your name | Shown on tasks, comments and the audit log |
| Your sign-in email | |
| Password and confirm | At least 8 characters and at most 72 bytes |
| Setup code | The code from the server's log (below) |
When you submit, UserTasks:
- creates the workspace and your owner account, exactly as
npm run bootstrapdoes - makes you an instance admin (
instance.admin_emails), because whoever has the setup code controls the server anyway - signs you in
- opens the setup wizard at
/settings/setup. There you check your services, add sign-in with your identity provider, set up email and invite your team. Every step can be skipped.
This screen is step 1 of the wizard. It's the only step that needs the setup code. After it, only instance admins can open the wizard.
The setup code#
The setup code stops a stranger from claiming a fresh install that's reachable from the internet before you get to it. The server prints it to its log when it starts, and again whenever someone opens /setup while setup is needed:
UserTasks setup code: ABCD-EFGH-JKLM (open /setup to create the admin account)Where to find it#
| You run UserTasks with | Look here |
|---|---|
| The one-line installer | It prints the code when it finishes (USERTASKS_SETUP_CODE in the install folder's .env) |
npm run dev or npm start | The terminal running it |
Docker Compose (laptop trial, supabase or standalone profile) | docker compose logs app | grep "setup code" |
| Air-gapped bundle | ./bundle.sh admin setup-code prints a fresh code |
| Kubernetes (Helm) | The app pods' logs: see Kubernetes |
Make a new code#
You can make a new code at any time with usertasks-admin setup-code. Making a new code stops the old one working.
| Install | Command |
|---|---|
| One-line installer | usertasks setup-code (with USERTASKS_SETUP_CODE in .env, the server keeps using that one: remove the line and run usertasks restart to use generated codes) |
| Source checkout | npm run setup-code (same as npm run admin -- setup-code) |
| Docker Compose | docker compose exec app node admin.cjs setup-code |
| Air-gapped bundle | ./bundle.sh admin setup-code |
| Kubernetes | kubectl -n usertasks exec deploy/usertasks -- node admin.cjs setup-code |
usertasks-admin setup-code status tells you whether setup is still needed and when the current code was made.
Choose the code yourself#
Set the USERTASKS_SETUP_CODE environment variable to pick the code up front. This is handy for Docker and Helm installs, where reading logs is a chore.
- Use at least 8 characters.
- Case doesn't matter, and neither do dashes or spaces:
abcd-efgh-jklmandABCDEFGHJKLMare the same code. - While it's set, the log says the code comes from that variable instead of printing it.
- Docker Compose: put it in
.env. Kubernetes: put it in the Secret the chart reads (for example--from-literal=USERTASKS_SETUP_CODE=…).
How it's protected#
- Only a hash of the code is stored, never the code itself.
- If the server restarts while setup is still needed, it prints a new code.
- Exception: if another replica made a code in the last minute, the log points you to that replica's log or to
usertasks-admin setup-codeinstead. - Wrong codes are rate-limited per IP address.
- The code stops working as soon as setup is complete.
Kubernetes#
The app runs two replicas by default, and only one of them prints the code. kubectl logs deploy/usertasks shows a single pod, so read all the app pods at once:
kubectl -n usertasks logs -l app.kubernetes.io/instance=usertasks,app.kubernetes.io/component=app --tail=-1 | grep "setup code"Replace usertasks with your release name, and deploy/usertasks with deploy/<release>-usertasks if the release isn't called usertasks. Simpler options: run setup-code with kubectl exec (above) or set USERTASKS_SETUP_CODE in the Secret before you install.
Or use the command line#
The command-line bootstrap still works. It's useful for scripted installs, and it skips /setup entirely. Run it from the UserTasks folder (the one with package.json):
npm run bootstrap -- --email admin@example.com --password 'a-strong-password' --org "Acme Inc" [--name "Ada Lovelace"]In the Docker image, the password can come from BOOTSTRAP_PASSWORD instead of the command line:
docker compose exec -e BOOTSTRAP_PASSWORD='a-strong-password' app node admin.cjs bootstrap --email admin@example.com --org "Acme Inc"The same command is usertasks-admin bootstrap:
- It prints the organisation slug.
--if-missingdoes nothing if the account already exists.--api-key <name>also creates an API key with every permission and prints it once.
npm run bootstrap, usertasks-admin bootstrap and usertasks-admin setup-code read .env.local, then .env, from the current folder by themselves. Variables already set in your shell win. Other commands, such as usertasks-admin db migrate, don't read these files: set DATABASE_URL for them yourself. If the provider variables are missing, the command says which ones (see Troubleshooting).
On Windows#
npm run bootstrap and npm run setup-code work the same in PowerShell and cmd. Two things trip people up:
- Run them from the UserTasks folder.
cdinto the folder that haspackage.json, then check you're in the right place. In PowerShell,Test-Path package.jsonshould printTrue:
cd C:\src\usertasks
Test-Path package.jsonIn cmd, dir package.json should list the file:
cd /d C:\src\usertasks
dir package.json- Quote the password for your shell. In PowerShell, use single quotes for a password with special characters (
$, ``,&`), because PowerShell expands variables inside double quotes. In cmd, use double quotes; single quotes are passed through literally.
npm run bootstrap -- --email admin@example.com --password 'pa$$w0rd!' --org "Acme Inc"npm run bootstrap -- --email admin@example.com --password "pa$$w0rd!" --org "Acme Inc"If the npm script still can't find your settings, run the script with Node's --env-file flag (Node.js 20.6 or later; tsx passes it on to Node):
npx tsx --env-file=.env.local scripts/bootstrap-tenant.ts --email admin@example.com --password 'a-strong-password' --org "Acme Inc"With Docker, docker compose exec app node admin.cjs bootstrap … and docker compose exec app node admin.cjs setup-code work the same from any shell. The container already has its environment.
With Helm#
The Helm chart can run it as a post-install Job (bootstrap.enabled, bootstrap.email, bootstrap.org, with BOOTSTRAP_PASSWORD in the Secret). See First admin account.