Create default Admin user without UI

Looking for a bit of guidance, I am deploying Coder on a Kubernetes cluster with the Helm Chart, and wondered if there was an env variable that sets the default admin user credentials?
Solution:
Try with ```shell coder login \ --first-user-username coder-admin \ --first-user-email coder-admin@example.com ...
Jump to solution
10 Replies
Codercord
Codercord7mo ago
<#1214919550953586738>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Scott
Scott7mo ago
@Brandon - Have you gotten the UI running? If I recall correctly, the initial access to the UI requests for you to create an admin user. I might be wrong though. It's been a while since I installed Coder.
Brandon
Brandon7mo ago
Hi @Scott yep UI is up and running and you are correct that is the process. However, I was hoping to be able to pull this in from a predefined secret for reinstall consistency
Scott
Scott7mo ago
Ahh... yeah. I don't think that the credentials are stored anywhere other than in the database.
TitiMoby
TitiMoby5mo ago
As I see this is still open, may I ask if someone has found a way to automate this credentials part? There are still too many manual steps in the guide I want to write for my company. I really try to automate everything possible.
Solution
Atif
Atif5mo ago
Try with
coder login \
--first-user-username coder-admin \
--first-user-email coder-admin@example.com \
--first-user-password SomeStrongPassword \
--use-token-as-session \
https://coder.example.com
coder login \
--first-user-username coder-admin \
--first-user-email coder-admin@example.com \
--first-user-password SomeStrongPassword \
--use-token-as-session \
https://coder.example.com
Atif
Atif5mo ago
This should create the first admin user and logs it in so that you can use other coder commands to create a default template and workspaces.
Atif
Atif5mo ago
GitHub
coder/.github/workflows/pr-deploy.yaml at 13dd526f11f90cc28ffbd0139...
Provision remote development environments via Terraform - coder/coder
TitiMoby
TitiMoby5mo ago
thanks, I'll try this and it is already a great solution. But it is a post install step and I was looking a step that could be done right from Helm or Terraform.
Atif
Atif5mo ago
I understand. Could you open an issue for that?
Want results from more Discord servers?
Add your server