{"id":41445,"date":"2026-11-26T22:04:44","date_gmt":"2026-11-26T22:04:44","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=41445"},"modified":"2026-11-26T22:04:44","modified_gmt":"2026-11-26T22:04:44","slug":"argocd-commands-reference","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/argocd-commands-reference\/","title":{"rendered":"ArgoCd Commands Reference"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/1a37da3062eefd89982a94e01e6b6db4.js\"><\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What the commands above do<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The notes above cover three tasks: changing the <code>admin<\/code> password by patching the <code>argocd-secret<\/code> Secret, finding the Argo CD hostname from an Ingress, and getting the admin password. They assume Argo CD runs in a namespace called <code>management<\/code>. A default install uses the <code>argocd<\/code> namespace, so the examples below use <code>argocd<\/code>. Replace it with your own namespace if it differs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Several commands above stop partway through: they end with a trailing <code>|<\/code> or a half-finished bcrypt hash, so they won&#039;t run if you paste them. Use the full versions below instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get the initial admin password<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The step above that finds the <code>argocd-server<\/code> 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 <code>argocd-initial-admin-secret<\/code> Secret.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># With kubectl<\/span>\nkubectl -n argocd get secret argocd-initial-admin-secret \\\n  -o jsonpath=<span class=\"hljs-string\">'{.data.password}'<\/span> | base64 -d; <span class=\"hljs-keyword\">echo<\/span>\n\n<span class=\"hljs-comment\"># With the argocd CLI (no login needed, uses your kubeconfig)<\/span>\nargocd admin initial-password -n argocd<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The username is always <code>admin<\/code>. Once you&#039;ve logged in and changed the password, delete <code>argocd-initial-admin-secret<\/code> with <code>kubectl -n argocd delete secret argocd-initial-admin-secret<\/code>. Argo CD only uses it to hand you the first password, and leaving it in place keeps a working credential lying around.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Find the Argo CD URL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The URL command above greps for <code>grafana<\/code>, which returns the Grafana Ingress, not the Argo CD one. Using <code>awk &#039;{print $3}&#039;<\/code> is also unreliable: recent kubectl versions add a <code>CLASS<\/code> column that shifts the columns, and awk prints the header row too. A jsonpath query reads the hostname directly:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># List every Ingress in the namespace with its hosts<\/span>\nkubectl -n argocd get ingress \\\n  -o jsonpath=<span class=\"hljs-string\">'{range .items&#91;*]}{.metadata.name}{\"\\t\"}{.spec.rules&#91;*].host}{\"\\n\"}{end}'<\/span>\n\n<span class=\"hljs-comment\"># If argocd-server is exposed as a LoadBalancer Service instead<\/span>\nkubectl -n argocd get svc argocd-server \\\n  -o jsonpath=<span class=\"hljs-string\">'{.status.loadBalancer.ingress&#91;0].hostname}{.status.loadBalancer.ingress&#91;0].ip}{\"\\n\"}'<\/span>\n\n<span class=\"hljs-comment\"># No Ingress or LoadBalancer: port-forward and open https:\/\/localhost:8080<\/span>\nkubectl -n argocd port-forward svc\/argocd-server <span class=\"hljs-number\">8080<\/span>:<span class=\"hljs-number\">443<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Change the admin password<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way is the CLI. It checks the current password and hashes the new one for you:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">argocd login argocd.example.com --username admin\nargocd account update-password \\\n  --account admin \\\n  --current-password <span class=\"hljs-string\">'OLD_PASSWORD'<\/span> \\\n  --<span class=\"hljs-keyword\">new<\/span>-password <span class=\"hljs-string\">'NEW_STRONG_PASSWORD'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If you can&#039;t log in, patch the Secret directly. The <code>admin.password<\/code> field must contain a <strong>bcrypt hash<\/strong>, not plain text. That&#039;s why the <code>THE_NEW_PASSWORD<\/code> placeholder above is misleading. Generate the hash first:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Option 1: argocd CLI<\/span>\nargocd account bcrypt --password <span class=\"hljs-string\">'NEW_STRONG_PASSWORD'<\/span>\n\n<span class=\"hljs-comment\"># Option 2: htpasswd (apache2-utils \/ httpd-tools)<\/span>\nhtpasswd -nbBC <span class=\"hljs-number\">10<\/span> <span class=\"hljs-string\">\"\"<\/span> <span class=\"hljs-string\">'NEW_STRONG_PASSWORD'<\/span> | tr -d <span class=\"hljs-string\">':\\n'<\/span> | sed <span class=\"hljs-string\">'s\/$2y\/$2a\/'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl -n argocd patch secret argocd-secret \\\n  -p <span class=\"hljs-string\">'{\"stringData\": {\n    \"admin.password\": \"$2a$10$REPLACE_WITH_YOUR_BCRYPT_HASH\",\n    \"admin.passwordMtime\": \"'<\/span>$(date +%FT%T%Z)<span class=\"hljs-string\">'\"\n  }}'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Keep the JSON in single quotes so the shell doesn&#039;t expand the <code>$<\/code> characters inside the hash. The <code>&#039;$(date ...)&#039;<\/code> part briefly closes the single quotes so the shell can insert the current timestamp. When <code>admin.passwordMtime<\/code> changes, Argo CD invalidates existing admin sessions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reset a lost admin password<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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 <code>argocd-initial-admin-secret<\/code>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Remove the keys: <code>kubectl -n argocd patch secret argocd-secret --type json -p &#039;[{&quot;op&quot;:&quot;remove&quot;,&quot;path&quot;:&quot;\/data\/admin.password&quot;},{&quot;op&quot;:&quot;remove&quot;,&quot;path&quot;:&quot;\/data\/admin.passwordMtime&quot;}]&#039;<\/code><\/li>\n\n\n<li>Restart the server: <code>kubectl -n argocd rollout restart deployment argocd-server<\/code><\/li>\n\n\n<li>Wait for it to become ready: <code>kubectl -n argocd rollout status deployment argocd-server<\/code><\/li>\n\n\n<li>Read the new password with <code>argocd admin initial-password -n argocd<\/code>, log in, and set a permanent password.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Everyday argocd CLI commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most <code>argocd<\/code> commands need a session, so run <code>argocd login<\/code> first. If you have kubectl access and don&#039;t want to go through the API server, <code>argocd login --core<\/code> talks to the Kubernetes API directly.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Task<\/th><th>Command<\/th><\/tr><\/thead><tbody><tr><td>Log in<\/td><td><code>argocd login argocd.example.com --username admin --grpc-web<\/code><\/td><\/tr><tr><td>Show client and server versions<\/td><td><code>argocd version<\/code><\/td><\/tr><tr><td>Current user info<\/td><td><code>argocd account get-user-info<\/code><\/td><\/tr><tr><td>List local accounts<\/td><td><code>argocd account list<\/code><\/td><\/tr><tr><td>Register a cluster from kubeconfig<\/td><td><code>argocd cluster add my-context-name<\/code><\/td><\/tr><tr><td>List clusters<\/td><td><code>argocd cluster list<\/code><\/td><\/tr><tr><td>Add a Git repository<\/td><td><code>argocd repo add https:\/\/github.com\/argoproj\/argocd-example-apps.git<\/code><\/td><\/tr><tr><td>Create an application<\/td><td><code>argocd app create guestbook --repo https:\/\/github.com\/argoproj\/argocd-example-apps.git --path guestbook --dest-server https:\/\/kubernetes.default.svc --dest-namespace default<\/code><\/td><\/tr><tr><td>List and inspect apps<\/td><td><code>argocd app list<\/code> \/ <code>argocd app get guestbook<\/code><\/td><\/tr><tr><td>Preview changes<\/td><td><code>argocd app diff guestbook<\/code><\/td><\/tr><tr><td>Sync, pruning deleted resources<\/td><td><code>argocd app sync guestbook --prune<\/code><\/td><\/tr><tr><td>Wait until healthy<\/td><td><code>argocd app wait guestbook --health --timeout 300<\/code><\/td><\/tr><tr><td>Enable auto-sync<\/td><td><code>argocd app set guestbook --sync-policy automated --auto-prune --self-heal<\/code><\/td><\/tr><tr><td>History and rollback<\/td><td><code>argocd app history guestbook<\/code> \/ <code>argocd app rollback guestbook 3<\/code><\/td><\/tr><tr><td>Delete an app<\/td><td><code>argocd app delete guestbook<\/code><\/td><\/tr><tr><td>List projects<\/td><td><code>argocd proj list<\/code><\/td><\/tr><tr><td>End the session<\/td><td><code>argocd logout argocd.example.com<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> <code>argocd app rollback<\/code> doesn&#039;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 <code>argocd app set guestbook --sync-policy none<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Likely cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>Invalid username or password<\/code> after patching the Secret<\/td><td>Plain text was stored in <code>admin.password<\/code>, or the hash was mangled by shell quoting<\/td><td>Store a bcrypt hash and keep the JSON in single quotes<\/td><\/tr><tr><td><code>secrets &quot;argocd-initial-admin-secret&quot; not found<\/code><\/td><td>Wrong namespace, the Secret was already deleted, or Argo CD is older than 1.9<\/td><td>Check <code>-n<\/code>, or reset the password as described above<\/td><\/tr><tr><td><code>x509: certificate signed by unknown authority<\/code> on login<\/td><td>The server uses a self-signed certificate<\/td><td>Add <code>--insecure<\/code> for testing only, or install a trusted certificate<\/td><\/tr><tr><td>Login hangs or fails with gRPC errors behind an Ingress<\/td><td>The Ingress or load balancer doesn&#039;t pass HTTP\/2 gRPC traffic<\/td><td>Add <code>--grpc-web<\/code> to <code>argocd login<\/code><\/td><\/tr><tr><td><code>Argo CD server address unspecified<\/code><\/td><td>No active CLI session<\/td><td>Run <code>argocd login<\/code> or use <code>--core<\/code><\/td><\/tr><tr><td><code>token is expired<\/code><\/td><td>The session token has timed out<\/td><td>Run <code>argocd login<\/code> again<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Security practices for the admin account<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>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.<\/li>\n\n\n<li>Never commit passwords or hashes to Git, gists or wiki pages. Keep them in a secrets manager.<\/li>\n\n\n<li>Delete <code>argocd-initial-admin-secret<\/code> after the first login.<\/li>\n\n\n<li>Set up SSO (OIDC or Dex) and RBAC in <code>argocd-rbac-cm<\/code>, then disable the local admin by setting <code>admin.enabled: &quot;false&quot;<\/code> in <code>argocd-cm<\/code>.<\/li>\n\n\n<li>Create separate local accounts or project tokens for CI pipelines rather than sharing <code>admin<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What is the default Argo CD admin password?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since Argo CD 1.9, the default password is randomly generated and stored in the <code>argocd-initial-admin-secret<\/code> Secret. You can read it with <code>argocd admin initial-password -n argocd<\/code>. In 1.8 and earlier it was the name of the <code>argocd-server<\/code> pod.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I put a plain-text password in argocd-secret?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. <code>admin.password<\/code> must be a bcrypt hash. You can generate one with <code>argocd account bcrypt --password &#039;yourpass&#039;<\/code> or with <code>htpasswd<\/code>. If you store plain text, every login fails.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I reset the Argo CD admin password if I forgot it?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Remove the <code>admin.password<\/code> and <code>admin.passwordMtime<\/code> keys from <code>argocd-secret<\/code> and restart the <code>argocd-server<\/code> deployment. Argo CD creates a new random password in <code>argocd-initial-admin-secret<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I access the Argo CD UI without an Ingress?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>kubectl -n argocd port-forward svc\/argocd-server 8080:443<\/code> and open https:\/\/localhost:8080 in your browser. You can also point the CLI at <code>localhost:8080<\/code> with <code>--insecure<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">When should I use &#8211;grpc-web with argocd login?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use it when Argo CD sits behind an Ingress or load balancer that doesn&#039;t support HTTP\/2 gRPC. The flag sends CLI traffic as gRPC-Web over HTTP\/1.1.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/devops\/ci-cd\/\">More CI\/CD tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/gitflow-master-tutorial\/\">Gitflow Master Tutorial<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/ci-cd-engineer-role-blueprint-responsibilities-skills-kpis-and-career-path\/\">CI\/CD Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[26139],"tags":[26200,26202],"class_list":["post-41445","post","type-post","status-publish","format-standard","hentry","category-ci-cd","tag-argo-cd","tag-gitops"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=41445"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41445\/revisions"}],"predecessor-version":[{"id":80294,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41445\/revisions\/80294"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=41445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=41445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=41445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}