Argo CD Tutorial: Deploy Your First GitOps Application

a stepwise row of three glass deployment nodes connected from a laptop to servers, learning a GitOps workflow

This Argo CD tutorial takes you from an empty Kubernetes cluster to a working GitOps workflow in about an hour. You will install Argo CD, log in with the CLI, deploy a sample application straight from a Git repository, change it by committing to Git, and then watch Argo CD detect drift, heal it and roll back a release. Every step uses real commands you can paste into a terminal.

The goal is not just to get a green tick in the UI. By the end you should understand why the cluster changed, which Argo CD component made the change, and where to look when it does not.

What you need before you start

  • A Kubernetes cluster you can administer. A local cluster from kind, minikube or k3d is perfect for learning.
  • kubectl configured for that cluster. Run kubectl get nodes and make sure it answers.
  • A GitHub account if you want to practice the commit-and-sync loop later. You can skip it for the first deployment.
  • Roughly 2 GB of free memory on the cluster for the Argo CD components plus the sample app.

How Argo CD works, in one minute

Argo CD runs inside your cluster as a set of controllers. You give it an Application: a pointer to a Git repository, a path inside it and a revision, plus a destination cluster and namespace. The argocd-repo-server renders the manifests from Git, the argocd-application-controller compares them with what is actually running, and argocd-server exposes the API and web UI you use to watch it all.

Two statuses matter on every Application, and beginners often confuse them:

StatusQuestion it answersCommon values
Sync statusDoes the live cluster match what Git says?Synced, OutOfSync
Health statusAre the running resources actually working?Healthy, Progressing, Degraded, Suspended, Missing, Unknown

An app can be Synced and Degraded at the same time, for example when Git correctly describes a Deployment whose image tag does not exist. Keep both columns in mind as you work through the steps.

Step 1: Install Argo CD on the cluster

The quickest install uses the non-HA manifest from the official repository. It creates the CRDs, service accounts, RBAC rules and all core components in an argocd namespace.

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Wait until every pod reports Running:

kubectl get pods -n argocd -w

You should see the server, repo server, application controller, ApplicationSet controller, Dex, Redis and notifications controller. If you want production options such as the HA manifest, Ingress or pinned versions, follow our full Argo CD installation guide; for this tutorial the defaults are fine.

Step 2: Install the CLI and log in

The argocd CLI talks to the API server. On macOS or Linux with Homebrew:

brew install argocd

On Linux without Homebrew, download the binary from GitHub Releases:

curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64

Windows users can grab argocd-windows-amd64.exe from the same releases page; see the download section on our homepage for links. Next, open a tunnel to the API server in a separate terminal and leave it running:

kubectl port-forward svc/argocd-server -n argocd 8080:443

The initial username is admin. Read the generated password, then log in:

argocd admin initial-password -n argocd
argocd login localhost:8080 --username admin --insecure

The --insecure flag is needed only because the port-forward presents a self-signed certificate. You can also open https://localhost:8080 in a browser and sign in with the same credentials. Change the password straight away with argocd account update-password. Our Argo CD login guide covers SSO and password resets in depth.

After you have set a new admin password, delete the argocd-initial-admin-secret in the argocd namespace. Argo CD recreates it only if you ask it to regenerate the password, and leaving it around is an easy credential leak.

Step 3: Create your first Argo CD Application

The Argo project publishes a small example repository with a guestbook app. Create an Application that points at it:

argocd app create guestbook \
  --repo https://github.com/argoproj/argocd-example-apps.git \
  --path guestbook \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace default

https://kubernetes.default.svc is how Argo CD refers to the cluster it is running in. Check the result:

argocd app get guestbook

The app is OutOfSync and its resources are Missing. That is expected: you told Argo CD what should exist, but you have not told it to act yet. The default sync policy is manual.

The same Application, declared in YAML

The CLI is handy, but in real projects you store the Application itself in Git so it is reviewed like any other change. Here is the equivalent manifest:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: guestbook
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps.git
    targetRevision: HEAD
    path: guestbook
  destination:
    server: https://kubernetes.default.svc
    namespace: default

Applying it with kubectl apply -n argocd -f guestbook-app.yaml produces exactly the same object. Note that Application resources live in the argocd namespace, while the workloads they deploy go to the destination namespace.

Step 4: Sync and inspect the result

argocd app sync guestbook
argocd app get guestbook

Argo CD applies the Service and Deployment, then reports Synced and, once the pod is ready, Healthy. In the web UI the Application card expands into a resource tree showing the Deployment, its ReplicaSet and pod. Click any node to see its live manifest, events and logs. To view the guestbook itself:

kubectl port-forward svc/guestbook-ui -n default 8081:80

Then browse to http://localhost:8081.

Step 5: Change the app the GitOps way

This is where Argo CD earns its keep. Fork argoproj/argocd-example-apps on GitHub and point the Application at your fork:

argocd app set guestbook --repo https://github.com/<your-user>/argocd-example-apps.git

In your fork, edit guestbook/guestbook-ui-deployment.yaml, change replicas: 1 to replicas: 3 and commit to the default branch. Without a webhook, Argo CD polls repositories roughly every three minutes, so either wait or force a refresh:

argocd app get guestbook --refresh
argocd app diff guestbook

The diff shows the replica change, and the app turns OutOfSync. Run argocd app sync guestbook and three pods appear. Notice that you never ran kubectl scale; Git is now the record of what should be running and why.

Step 6: Turn on automated sync, prune and self-heal

Manual syncs are good for learning, but most teams let Argo CD apply changes as soon as they land in Git:

argocd app set guestbook --sync-policy automated --auto-prune --self-heal
  • Automated syncs whenever the rendered manifests differ from the cluster.
  • Prune deletes resources that you removed from Git. It is off by default so a bad commit cannot wipe a namespace by accident.
  • Self-heal reverts changes made directly in the cluster.

Test self-heal by simulating a manual hotfix:

kubectl scale deployment guestbook-ui -n default --replicas=1
argocd app get guestbook

Within moments Argo CD notices the drift and scales the Deployment back to three, because three is what Git says. This drift detection is the main safety property of GitOps: the cluster cannot quietly diverge from what your team reviewed.

Useful sync options

Sync options fine-tune how resources are applied. Two you will meet early are CreateNamespace=true, which creates the destination namespace if it does not exist, and ServerSideApply=true, which helps with very large resources such as some CRDs. Set them with argocd app set guestbook --sync-option CreateNamespace=true or under spec.syncPolicy.syncOptions in YAML.

Step 7: View history and roll back

Every sync is recorded with the Git revision it deployed:

argocd app history guestbook

The output lists an ID per deployment. To return to an earlier one, disable automated sync first (Argo CD refuses to roll back an app that would immediately re-sync to Git), then roll back:

argocd app set guestbook --sync-policy none
argocd app rollback guestbook <history-id>

Treat a rollback as a short-term fix. The durable solution is to revert the commit in Git and re-enable automated sync, so Git and the cluster agree again.

Clean up

Deleting the Application with cascade removes the guestbook resources too:

argocd app delete guestbook --cascade

If deletion hangs, a finalizer is usually waiting on a resource; our Argo CD troubleshooting guide explains how to clear it safely.

Where to go after this Argo CD tutorial

You now have the core loop: declare in Git, let Argo CD reconcile, inspect status, roll back when needed. Real projects build on it with a few more concepts:

  • AppProjects restrict which repositories, clusters and namespaces an Application may use.
  • Helm and Kustomize sources replace plain YAML for most teams. See the Argo CD Helm chart guide.
  • Sync waves and hooks order resources, for example running a database migration Job in a PreSync hook.
  • ApplicationSets and the App of Apps pattern generate many Applications from one definition.
  • Webhooks from GitHub or GitLab replace the three-minute polling delay.

Frequently asked questions

Do I need my own Git repository to follow this Argo CD tutorial?

Not for the first deployment. The public argocd-example-apps repository works as a read-only source. To practice the full GitOps loop of committing a change and watching Argo CD apply it, fork that repository and point your Application at the fork.

Can I run Argo CD on a local cluster such as kind, minikube or k3d?

Yes. Any conformant Kubernetes cluster works, and a local cluster is the cheapest place to learn. Use kubectl port-forward to reach the Argo CD server, because local clusters usually have no external load balancer.

Why does my application show Synced but not Healthy?

Sync status only says the cluster matches Git. Health says whether the resources actually work. A Deployment whose pods cannot pull their image, for example, is Synced but Degraded or Progressing. Check the resource tree in the UI or run kubectl describe on the failing pod.

Is it safe to edit resources with kubectl once Argo CD manages them?

It works, but the change is temporary. Argo CD marks the app OutOfSync, and with self-heal enabled it reverts the edit within moments. Make lasting changes in Git so they are reviewed, versioned and reproducible.

Next steps

Harden your setup with the installation guide, connect private repositories using Argo CD with GitHub and GitLab, or review the feature overview and FAQ on the homepage.