Skip to content

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.

Last updated 4 min read Edit this page on GitHub
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, /, /login and the app's pages all redirect to /setup. Just open the app's address.
  • Once the admin account exists, /setup is gone: it redirects to /login.
  • The cloud edition has no /setup page.

Fill in the form#

FieldWhat to enter
Organisation nameYour 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 nameShown on tasks, comments and the audit log
EmailYour sign-in email
Password and confirmAt least 8 characters and at most 72 bytes
Setup codeThe code from the server's log (below)

When you submit, UserTasks:

  1. creates the workspace and your owner account, exactly as npm run bootstrap does
  2. makes you an instance admin (instance.admin_emails), because whoever has the setup code controls the server anyway
  3. signs you in
  4. 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 withLook here
The one-line installerIt prints the code when it finishes (USERTASKS_SETUP_CODE in the install folder's .env)
npm run dev or npm startThe 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.

InstallCommand
One-line installerusertasks 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 checkoutnpm run setup-code (same as npm run admin -- setup-code)
Docker Composedocker compose exec app node admin.cjs setup-code
Air-gapped bundle./bundle.sh admin setup-code
Kuberneteskubectl -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-jklm and ABCDEFGHJKLM are 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-code instead.
  • 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:

Bash
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):

Bash
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:

Bash
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-missing does 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:

  1. Run them from the UserTasks folder. cd into the folder that has package.json, then check you're in the right place. In PowerShell, Test-Path package.json should print True:
PowerShell
cd C:\src\usertasks
Test-Path package.json

In cmd, dir package.json should list the file:

Batch
cd /d C:\src\usertasks
dir package.json
  1. 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.
PowerShell
npm run bootstrap -- --email admin@example.com --password 'pa$$w0rd!' --org "Acme Inc"
Batch
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):

Bash
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.

Next#

The setup wizard, then sign in and invite people.

Was this page helpful?