---
title: Start, stop, and restart the infrastructure agent
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/manage-your-agent/start-stop-restart-infrastructure-agent
---

The infrastructure agent starts automatically after you run the installation script. However, there are situations where you may need to manually restart the agent (for example, after [changing your agent configuration](https://docs.newrelic.com/docs/infrastructure-configure-your-agent)).

Want to try out our infrastructure agent? [Create a New Relic account](https://newrelic.com/signup) for free! No credit card required.

## Linux [#linux]

For [Linux](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux), ensure you use the correct command for [your init system](#init-system). Select `start`, `stop`, `restart`, or `status` as appropriate:

-   **SystemD** (Amazon Linux 2, SLES 12, CentOS 7 or higher, Debian 8 or higher, RHEL 7 or higher, Ubuntu 15.04 or higher):
    ```shell
    sudo systemctl <start|stop|restart|status> newrelic-infra
    ```

-   **System V** (Debian 7, SLES 11.4, RHEL 5):
    ```shell
    sudo /etc/init.d/newrelic-infra <start|stop|restart|status>
    ```

-   **Upstart** (Amazon Linux, RHEL 6, Ubuntu 14.04 or lower):
    ```shell
    sudo initctl <start|stop|restart|status> newrelic-infra
    ```

## Windows [#windows]

> #### ⚠️ IMPORTANT
>
> To start, stop, or restart the agent, you must run `cmd.exe` or PowerShell as **Administrator**.

For [Windows Server](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-windows-server), you can use the Windows command prompt or PowerShell.

### Command prompt (cmd.exe)

-   Start or stop the Windows agent:
    ```shell
    net <start|stop> newrelic-infra
    ```

-   Restart the Windows agent:
    ```shell
    net stop newrelic-infra ; net start newrelic-infra
    ```

-   Check the status of the Windows agent:
    ```shell
    sc query "newrelic-infra" | find "STATE"
    ```

### PowerShell

-   Start or stop the Windows agent:

    ```shell
    Stop-Service -Name "newrelic-infra"
    Start-Service -Name "newrelic-infra"
    ```

    > #### 💡 TIP
    >
    > You can also use `net start|stop newrelic-infra`


-   Restart the Windows agent:
    ```shell
    Restart-Service newrelic-infra
    ```

-   Check status of Windows agent:
    ```shell
    (Get-Service newrelic-infra).Status
    ```

## macOS [#macOS]

-   Stop or start the agent:
    ```shell
    brew services stop newrelic-infra-agent
    brew services start newrelic-infra-agent
    ```

-   Restart the agent:
    ```shell
    brew services restart newrelic-infra-agent
    ```

-   Check status of the agent:
    ```shell
    brew services list
    ```

## Customize agent logs [#logging]

The infrastructure agent logs to a default location which depends on your platform. You can customize this location with the [`log_file`](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/configuration/infrastructure-configuration-settings#log-file) setting. You can also [generate verbose logs for troubleshooting](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/generating-logs-troubleshooting-infrastructure).

## Determine your init system [#init-system]

For Windows Server, the commands in this document use the Windows command prompt.

For Linux, the infrastructure agent selects an init system appropriate for your distribution:

| Distribution            | SystemD | System V | Upstart |
| ----------------------- | ------- | -------- | ------- |
| Amazon Linux            |         |          | ✓       |
| Amazon Linux 2          | ✓       |          |         |
| CentOS 7                | ✓       |          |         |
| CentOS 8                | ✓       |          |         |
| Debian 7 ("Wheezy")     |         | ✓        |         |
| Debian 8 ("Jessie")     | ✓       |          |         |
| Debian 9 ("Stretch")    | ✓       |          |         |
| RHEL 5                  |         | ✓        |         |
| RHEL 6                  |         |          | ✓       |
| RHEL 7                  | ✓       |          |         |
| RHEL 8                  | ✓       |          |         |
| Ubuntu, 14.04 or lower  |         |          | ✓       |
| Ubuntu, 16.04 or higher | ✓       |          |         |
| SLES 12                 | ✓       |          |         |
| SLES 11                 |         | ✓        |         |

## Configuration management tools [#config-mgmt]

To manage the infrastructure agent with your config management tool, see:

-   [Ansible configuration](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-using-ansible)
-   [Chef configuration](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-using-chef)
-   [AWS Elastic Beanstalk configuration](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/config-management-tools/install-infrastructure-agent-aws-elastic-beanstalk)
-   [Puppet configuration](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-puppet)
