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 [email protected] ...
Jump to solution
10 Replies
Codercord
Codercord10mo ago
<#1214919550953586738>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Scott
Scott10mo 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
BrandonOP10mo 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
Scott10mo ago
Ahh... yeah. I don't think that the credentials are stored anywhere other than in the database.
TitiMoby
TitiMoby8mo 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
Atif8mo ago
Try with
coder login \
--first-user-username coder-admin \
--first-user-email [email protected] \
--first-user-password SomeStrongPassword \
--use-token-as-session \
https://coder.example.com
coder login \
--first-user-username coder-admin \
--first-user-email [email protected] \
--first-user-password SomeStrongPassword \
--use-token-as-session \
https://coder.example.com
Atif
Atif8mo 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
Atif8mo ago
GitHub
coder/.github/workflows/pr-deploy.yaml at 13dd526f11f90cc28ffbd0139...
Provision remote development environments via Terraform - coder/coder
TitiMoby
TitiMoby8mo 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
Atif8mo ago
I understand. Could you open an issue for that?
Want results from more Discord servers?
Add your server