This page collects the Argo CD commands engineers use most: getting the initial admin password, finding the Argo CD URL, changing or resetting the admin password with kubectl or the argocd CLI, and running everyday app, repo and cluster operations. The notes above were cut short and have some mistakes, so the sections below give complete, corrected commands that work on current Argo CD 2.x and later.
What the commands above do
The notes above cover three tasks: changing the admin password by patching the argocd-secret Secret, finding the Argo CD hostname from an Ingress, and getting the admin password. They assume Argo CD runs in a namespace called management. A default install uses the argocd namespace, so the examples below use argocd. Replace it with your own namespace if it differs.
Note: Several commands above stop partway through: they end with a trailing | or a half-finished bcrypt hash, so they won't run if you paste them. Use the full versions below instead.
Get the initial admin password
The step above that finds the argocd-server pod name only applies to Argo CD 1.8 and earlier. In those versions the first admin password was the pod name. Since 1.9, Argo CD generates a random password and stores it in the argocd-initial-admin-secret Secret.
# With kubectl
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath='{.data.password}' | base64 -d; echo
# With the argocd CLI (no login needed, uses your kubeconfig)
argocd admin initial-password -n argocdCode language: PHP (php)
The username is always admin. Once you've logged in and changed the password, delete argocd-initial-admin-secret with kubectl -n argocd delete secret argocd-initial-admin-secret. Argo CD only uses it to hand you the first password, and leaving it in place keeps a working credential lying around.
Find the Argo CD URL
The URL command above greps for grafana, which returns the Grafana Ingress, not the Argo CD one. Using awk '{print $3}' is also unreliable: recent kubectl versions add a CLASS column that shifts the columns, and awk prints the header row too. A jsonpath query reads the hostname directly:
# List every Ingress in the namespace with its hosts
kubectl -n argocd get ingress \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.rules[*].host}{"\n"}{end}'
# If argocd-server is exposed as a LoadBalancer Service instead
kubectl -n argocd get svc argocd-server \
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}{.status.loadBalancer.ingress[0].ip}{"\n"}'
# No Ingress or LoadBalancer: port-forward and open https://localhost:8080
kubectl -n argocd port-forward svc/argocd-server 8080:443Code language: PHP (php)
Change the admin password
The easiest way is the CLI. It checks the current password and hashes the new one for you:
argocd login argocd.example.com --username admin
argocd account update-password \
--account admin \
--current-password 'OLD_PASSWORD' \
--new-password 'NEW_STRONG_PASSWORD'Code language: JavaScript (javascript)
If you can't log in, patch the Secret directly. The admin.password field must contain a bcrypt hash, not plain text. That's why the THE_NEW_PASSWORD placeholder above is misleading. Generate the hash first:
# Option 1: argocd CLI
argocd account bcrypt --password 'NEW_STRONG_PASSWORD'
# Option 2: htpasswd (apache2-utils / httpd-tools)
htpasswd -nbBC 10 "" 'NEW_STRONG_PASSWORD' | tr -d ':\n' | sed 's/$2y/$2a/'Code language: PHP (php)
kubectl -n argocd patch secret argocd-secret \
-p '{"stringData": {
"admin.password": "$2a$10$REPLACE_WITH_YOUR_BCRYPT_HASH",
"admin.passwordMtime": "'$(date +%FT%T%Z)'"
}}'Code language: PHP (php)
Keep the JSON in single quotes so the shell doesn't expand the $ characters inside the hash. The '$(date ...)' part briefly closes the single quotes so the shell can insert the current timestamp. When admin.passwordMtime changes, Argo CD invalidates existing admin sessions.
Reset a lost admin password
If nobody knows the current password, remove both password keys and restart the API server. Argo CD then creates a new random password and stores it in argocd-initial-admin-secret.
- Remove the keys:
kubectl -n argocd patch secret argocd-secret --type json -p '[{"op":"remove","path":"/data/admin.password"},{"op":"remove","path":"/data/admin.passwordMtime"}]' - Restart the server:
kubectl -n argocd rollout restart deployment argocd-server - Wait for it to become ready:
kubectl -n argocd rollout status deployment argocd-server - Read the new password with
argocd admin initial-password -n argocd, log in, and set a permanent password.
Everyday argocd CLI commands
Most argocd commands need a session, so run argocd login first. If you have kubectl access and don't want to go through the API server, argocd login --core talks to the Kubernetes API directly.
| Task | Command |
|---|---|
| Log in | argocd login argocd.example.com --username admin --grpc-web |
| Show client and server versions | argocd version |
| Current user info | argocd account get-user-info |
| List local accounts | argocd account list |
| Register a cluster from kubeconfig | argocd cluster add my-context-name |
| List clusters | argocd cluster list |
| Add a Git repository | argocd repo add https://github.com/argoproj/argocd-example-apps.git |
| Create an application | argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default |
| List and inspect apps | argocd app list / argocd app get guestbook |
| Preview changes | argocd app diff guestbook |
| Sync, pruning deleted resources | argocd app sync guestbook --prune |
| Wait until healthy | argocd app wait guestbook --health --timeout 300 |
| Enable auto-sync | argocd app set guestbook --sync-policy automated --auto-prune --self-heal |
| History and rollback | argocd app history guestbook / argocd app rollback guestbook 3 |
| Delete an app | argocd app delete guestbook |
| List projects | argocd proj list |
| End the session | argocd logout argocd.example.com |
Note: argocd app rollback doesn't work while automated sync is turned on, because auto-sync would immediately put the app back to what Git says. Disable auto-sync first with argocd app set guestbook --sync-policy none.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
Invalid username or password after patching the Secret | Plain text was stored in admin.password, or the hash was mangled by shell quoting | Store a bcrypt hash and keep the JSON in single quotes |
secrets "argocd-initial-admin-secret" not found | Wrong namespace, the Secret was already deleted, or Argo CD is older than 1.9 | Check -n, or reset the password as described above |
x509: certificate signed by unknown authority on login | The server uses a self-signed certificate | Add --insecure for testing only, or install a trusted certificate |
| Login hangs or fails with gRPC errors behind an Ingress | The Ingress or load balancer doesn't pass HTTP/2 gRPC traffic | Add --grpc-web to argocd login |
Argo CD server address unspecified | No active CLI session | Run argocd login or use --core |
token is expired | The session token has timed out | Run argocd login again |
Security practices for the admin account
- The notes above publish a plain-text password next to a bcrypt hash. If those values were ever used anywhere, treat them as compromised and rotate them.
- Never commit passwords or hashes to Git, gists or wiki pages. Keep them in a secrets manager.
- Delete
argocd-initial-admin-secretafter the first login. - Set up SSO (OIDC or Dex) and RBAC in
argocd-rbac-cm, then disable the local admin by settingadmin.enabled: "false"inargocd-cm. - Create separate local accounts or project tokens for CI pipelines rather than sharing
admin.
Frequently asked questions
What is the default Argo CD admin password?
Since Argo CD 1.9, the default password is randomly generated and stored in the argocd-initial-admin-secret Secret. You can read it with argocd admin initial-password -n argocd. In 1.8 and earlier it was the name of the argocd-server pod.
Can I put a plain-text password in argocd-secret?
No. admin.password must be a bcrypt hash. You can generate one with argocd account bcrypt --password 'yourpass' or with htpasswd. If you store plain text, every login fails.
How do I reset the Argo CD admin password if I forgot it?
Remove the admin.password and admin.passwordMtime keys from argocd-secret and restart the argocd-server deployment. Argo CD creates a new random password in argocd-initial-admin-secret.
How do I access the Argo CD UI without an Ingress?
Run kubectl -n argocd port-forward svc/argocd-server 8080:443 and open https://localhost:8080 in your browser. You can also point the CLI at localhost:8080 with --insecure.
When should I use –grpc-web with argocd login?
Use it when Argo CD sits behind an Ingress or load balancer that doesn't support HTTP/2 gRPC. The flag sends CLI traffic as gRPC-Web over HTTP/1.1.
Related tutorials
- More CI/CD tutorials
- Gitflow Master Tutorial
- CI/CD Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals