# Get Started with Flux Operator

Install the Flux Operator and deploy Flux CD with a simple declarative configuration.
Get up and running in minutes.

## 1. Install the Flux Operator CLI

Install the Flux Operator CLI using Homebrew:

```bash
brew install controlplaneio-fluxcd/tap/flux-operator
```

For other install methods see the [CLI documentation](https://fluxoperator.dev/docs/guides/cli.md).

## 2. Create a Flux Instance

Define your Flux configuration with the `FluxInstance` CRD:

```yaml
apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
  name: flux
  namespace: flux-system
spec:
  distribution:
    version: "2.x"
    registry: "ghcr.io/fluxcd"
    artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests"
  components:
    - source-controller
    - source-watcher
    - kustomize-controller
    - helm-controller
    - notification-controller
  cluster:
    type: kubernetes
    size: medium
    multitenant: false
    networkPolicy: true
    domain: "cluster.local"
```

Install the Flux Operator and apply your configuration on a cluster:

```bash
flux-operator install -f flux-instance.yaml
```

Other deploy methods: [Helm](https://fluxoperator.dev/docs/guides/install.md#helm), [Terraform](https://fluxoperator.dev/docs/guides/install.md#terraform), [OperatorHub](https://fluxoperator.dev/docs/guides/install.md#operator-lifecycle-manager).

## 3. Sync from a Git Repository

Add a `sync` configuration to deploy resources from a Git repository:

```yaml
apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
  name: flux
  namespace: flux-system
spec:
  sync:
    kind: GitRepository
    url: "https://github.com/fluxcd/flux2-kustomize-helm-example"
    ref: "refs/heads/main"
    path: "clusters/staging"
    pullSecret: "flux-system"
```

For private repositories, create a secret with your credentials:

```bash
flux-operator create secret basic-auth flux-system \
  --namespace=flux-system \
  --username=git \
  --password=$GITHUB_TOKEN
```

For more information on configuring sync from Git repositories, container registries, and S3-compatible storage, see the [cluster sync guide](https://fluxoperator.dev/docs/instance/sync.md).

## 4. Access the Status Page

Port-forward to access the built-in dashboards:

```bash
kubectl -n flux-system port-forward svc/flux-operator 9080:9080
```

Open http://localhost:9080 in your browser to monitor your GitOps pipelines.

Learn more about the [Flux Web UI](https://fluxoperator.dev/web-ui.md).

## 5. Setup the MCP Server

Install the Flux MCP Server to enable Agentic GitOps within Claude, Cursor, or other MCP-compatible tools:

```bash
brew install controlplaneio-fluxcd/tap/flux-operator-mcp
```

Add the following configuration to your AI assistant's MCP server settings:

```json
{
  "flux-operator-mcp": {
    "command": "flux-operator-mcp",
    "args": [
      "serve",
      "--read-only=false"
    ],
    "env": {
      "KUBECONFIG": "$HOME/.kube/config"
    }
  }
}
```

Learn more about the [Flux MCP Server](https://fluxoperator.dev/mcp-server.md).

## Next Steps

- [Instance Configuration](https://fluxoperator.dev/docs/crd/fluxinstance.md) — multi-tenancy, sharding, scaling, and customization
- [ResourceSet API](https://fluxoperator.dev/docs/resourcesets/introduction.md) — self-service environments and app definitions
- [AI Prompting Guide](https://fluxoperator.dev/docs/mcp/prompting.md) — effective prompting strategies for Flux MCP Server
