mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Environment Variables for initial user-creation #2955
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#2955
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Twinki14 on GitHub (Dec 25, 2023).
⚠️ Please verify that this feature request has NOT been suggested before.
🏷️ Feature Request Type
API, Other
🔖 Feature description
Uptime Kuma is currently next-to-impossible to declaratively configure and manage, this makes it especially hard to host in volatile environments like Kubernetes or even a volatile docker environment where data may not be persisted intentionally.
✔️ Solution
Two environment variables would allow for initial user creation, which would open the doorway to third-party tools like uptime-kuma-api to declaratively configure Uptime Kuma whenever Uptime Kuma is initially deployed without needing any user interaction
UPTIME_KUMA_USERNAMEfor setting the initial usernameUPTIME_KUMA_PASSWORDfor setting the initial passwordWhen both environment variables are present, and pass any other validation, a user could be created for tools like uptime-kuma-api to begin 'seeding' Uptime Kuma without any needed user interaction
❓ Alternatives
This is possible without environment variables, by opening the sqlite db and adding a user/password directly to the user table through , but this is quite a hacky workaround that could be officially simplified
📝 Additional Context
I wanted to use Uptime Kuma for my kubernetes cluster, it looks and appears quite supported, but since setting up Uptime Kuma absolutely requires user interaction inside a browser, it completely goes against my kubernetes cluster design.
@CommanderStorm commented on GitHub (Dec 25, 2023):
Related https://github.com/louislam/uptime-kuma/issues/956 https://github.com/louislam/uptime-kuma/issues/1354
Also see
@jsnouffer commented on GitHub (Jan 3, 2024):
I am disappointed that this minimal feature of configuring credentials via env var is not supported. The strong stance against config files make this impossible to deploy via GitOps. I was going to go the route of using the API to add endpoints, but without being able to bootstrap the service with user credentials, manual action is still required.
I love the kuma UI, but I'm forced to use gatus.
@Twinki14 commented on GitHub (Jan 3, 2024):
Exactly my situation, I can't use Kuma UI at all in GitOps.
It is technically possible by editing Kuma's SQLite DB with some type of SQLite CLI. I don't believe the DB is protected with credentials, but this is such a hacky workaround for something so simple.
@gl-yziquel commented on GitHub (Jan 9, 2024):
This situation is ridiculous. I've been coming over the past few months regularly to uptime kuma and would love to use it.
It's however next to impossible to get in the documentation some setup instructions for username and password.
I guess I'll come back in two months or so to check how that has improved. Or not.
Is it because I'm a dinosaur that has toyed with 286 CPU in real mode as a kid that I don't get this new modern vibe of having unintuitively documented applications where you have to guess the documentation ??
@CommanderStorm commented on GitHub (Jan 9, 2024):
When you boot up the docker image or install via node, this is the first thing you are asked about on the setup screen.
The rest of your comment is not quite formulated as a comment but rather is spreading non-productive, passive-aggressive toxicity
⇒ I am going to ignore those questions/ comments
I am instead going to talk about our docs.
Yes, our documentation may be lacking in some parts.
I don't know what you are concretely missing. What is your expectation from the docs?
@chakflying you stated in https://github.com/louislam/uptime-kuma/pull/4171#issuecomment-1840095650 that you are planning something.
Do you think a pinned issue with a plan of action and a call for contributions may be a part of a solution?
@gl-yziquel commented on GitHub (Jan 10, 2024):
Absolutely. I agree. I was getting annoyed. Apologies.
But it indeed is rather a pain not to have control from the command line. The reality is that I had uptime kuma installed a few months ago, had it running, and as I am not running it regularly, each time I come back, I look at the docs, and fail to find useful information about how the password is set up. It was indeed set up, and I spent quite a few hours running around with a web screen asking me for a password, and nowhere in the documentation where this is handled explicitly.
More seriously: credential management should really be the first thing you see when reading a documentation about such a webapp. Spending four hours roaming around the documentation while multitasking is simply a time waster.
Information about credential management in the first pages. State explicitly (in text mode, I read text, not emojis or images which do not show up in a terminal) that the password and username is configured initially at first login (this way, if you do not see a screen asking to initialise password, you may easily infer without wasting time that it likely is already initialised). Plus a link to the tool to manage the password to reinitialise it, just below.
I am not forgetting that. I was annoyed. It's fairly obvious that this isn't DirectXShaderCompiler with both MS and Google committing.
Ranting, which I did, is by no way demeaning the work done, which is obviously very good. I can swear and congratulate you at the same time.
There is however a culture mismatch between people like me who grew up with a DOS command line and people putting docker containers everywhere. And it shows in the way password management is here handled and this thread about the lack of initialisation by environment variables.
I want explicit installation procedures. Not "here is a docker container, you've got nothing else to do". Which usually is just skimming over the real configuration issues.
I know writing documentation is a pain.
@magicalbob commented on GitHub (Jan 21, 2024):
I would have liked this feature to be available too, so that my IaC could just make sure the initial user is present. As it happens I've created a selenium script in python to set the initial user up in my git https://github.com/magicalbob/k8s_uptime_kuma/blob/master/python/create_user.py
@alehostert commented on GitHub (Jul 15, 2025):
Hello from 2025.
Still not able to automatically add an user via cli/.env.
I'm bumping this one in hope that this feature become alive :)
@seriouslag commented on GitHub (Jan 10, 2026):
I would like the users to be populated from my OIDC provider or auth disabled on initial launch by the config so I can use authentik to secure the app and not need to manually disable auth.
Enjoying the project, thank you!
@CommanderStorm commented on GitHub (Jan 10, 2026):
@seriouslag a bit off topic to this issue. If you want to contribute towards that goal, the right issue is