---
title: "Run Grafana Agent Flow as a standalone binary | Grafana Agent documentation"
description: "Learn how to run Grafana Agent Flow as a standalone binary"
---

# Run Grafana Agent Flow as a standalone binary

If you [downloaded](/docs/agent/v0.43/flow/get-started/install/binary/) the standalone binary, you must run Grafana Agent Flow from a terminal or command window.

## Start Grafana Agent Flow on Linux, macOS, or FreeBSD

To start Grafana Agent Flow on Linux, macOS, or FreeBSD, run the following command in a terminal window:

shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```shell
AGENT_MODE=flow <BINARY_PATH> run <CONFIG_PATH>
```

Replace the following:

- *`<BINARY_PATH>`* : The path to the Grafana Agent Flow binary file.
- *`<CONFIG_PATH>`* : The path to the Grafana Agent Flow configuration file.

## Start Grafana Agent Flow on Windows

To start Grafana Agent Flow on Windows, run the following commands in a command prompt:

cmd ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```cmd
set AGENT_MODE=flow
<BINARY_PATH> run <CONFIG_PATH>
```

Replace the following:

- *`<BINARY_PATH>`* : The path to the Grafana Agent Flow binary file.
- *`<CONFIG_PATH>`* : The path to the Grafana Agent Flow configuration file.

## Set up Grafana Agent Flow as a Linux systemd service

You can set up and manage the standalone binary for Grafana Agent Flow as a Linux systemd service.

> Note
> 
> These steps assume you have a default systemd and Grafana Agent Flow configuration.

1. To create a new user called `grafana-agent-flow` run the following command in a terminal window:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo useradd --no-create-home --shell /bin/false grafana-agent-flow
   ```
2. Create a service file in `/etc/systemd/system` called `grafana-agent-flow.service` with the following contents:
   
   systemd ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```systemd
   [Unit]
   Description=Vendor-neutral programmable observability pipelines.
   Documentation=https://grafana.com/docs/agent/latest/flow/
   Wants=network-online.target
   After=network-online.target
   
   [Service]
   Restart=always
   User=grafana-agent-flow
   Environment=HOSTNAME=%H
   EnvironmentFile=/etc/default/grafana-agent-flow
   WorkingDirectory=<WORKING_DIRECTORY>
   ExecStart=<BINARY_PATH> run $CUSTOM_ARGS --storage.path=<WORKING_DIRECTORY> $CONFIG_FILE
   ExecReload=/usr/bin/env kill -HUP $MAINPID
   TimeoutStopSec=20s
   SendSIGKILL=no
   
   [Install]
   WantedBy=multi-user.target
   ```
   
   Replace the following:
   
   - *`<BINARY_PATH>`* : The path to the Grafana Agent Flow binary file.
   - *`<WORKING_DIRECTORY>`* : The path to a working directory, for example `/var/lib/grafana-agent-flow`.
3. Create an environment file in `/etc/default/` called `grafana-agent-flow` with the following contents:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   ## Path:
   ## Description: Grafana Agent Flow settings
   ## Type:        string
   ## Default:     ""
   ## ServiceRestart: grafana-agent-flow
   #
   # Command line options for grafana-agent
   #
   # The configuration file holding the Grafana Agent Flow configuration.
   CONFIG_FILE="<CONFIG_PATH>"
   
   # User-defined arguments to pass to the run command.
   CUSTOM_ARGS=""
   
   # Restart on system upgrade. Defaults to true.
   RESTART_ON_UPGRADE=true
   ```
   
   Replace the following:
   
   - *`<CONFIG_PATH>`* : The path to the Grafana Agent Flow configuration file.
4. To reload the service files, run the following command in a terminal window:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo systemctl daemon-reload
   ```
5. Use the [Linux](/docs/agent/v0.43/flow/get-started/run/linux/) systemd commands to manage your standalone Linux installation of Grafana Agent Flow.
