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:Jump to solution
Try with
```shell
coder login \
--first-user-username coder-admin \
--first-user-email coder-admin@example.com ...
10 Replies
<#1214919550953586738>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
@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.
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
Ahh... yeah. I don't think that the credentials are stored anywhere other than in the database.
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
Try with
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.
We are using it in our PR deployments workflow.
https://github.com/coder/coder/blob/13dd526f11f90cc28ffbd01395261d479b8c3dfd/.github/workflows/pr-deploy.yaml#L409
GitHub
coder/.github/workflows/pr-deploy.yaml at 13dd526f11f90cc28ffbd0139...
Provision remote development environments via Terraform - coder/coder
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.
I understand. Could you open an issue for that?