---
title: "Autostart (Windows) | WebhookRelay"
meta:
  "og:description": "Learn how to configure background service so that Webhook Relay agent connects on Windows server startup"
  "og:title": "Autostart (Windows)"
  description: "Learn how to configure background service so that Webhook Relay agent connects on Windows server startup"
---

![Stripes](https://webhookrelay.com/docs/installation/autostart-windows/images/stripes.svg)

Documentation

**Fundamentals**

# **Autostart (Windows)**

Learn how to configure background service so that Webhook Relay agent connects on Windows server startup

## [Prerequisites](#prerequisites)

- Windows machine
- [Webhook Relay account](https://my.webhookrelay.com)

## [Install relay client](#install-relay-client)

Open PowerShell:

![opening powershell](https://webhookrelay.com/docs/installation/autostart-windows/images/docs/installation/windows/powershell.png)

Download and install the relay client:

```
iwr https://my.webhookrelay.com/webhookrelay/downloads/install-cli.ps1 -useb | iex
```

You should see the following output:

![running command to install](https://webhookrelay.com/docs/installation/autostart-windows/images/docs/installation/windows/command.png)

Now, create a file `config` in the C:\ProgramData\WebhookRelay directory:

![config file location](https://webhookrelay.com/docs/installation/autostart-windows/images/docs/installation/windows/config-file.png)

With contents (get your key and secret from [here](https://my.webhookrelay.com/tokens)):

```
version: "v1"
key: your-secret-key # will be encrypted on startup
secret: your-secret  # will be encrypted on startup
buckets:
- windows-bin
```

Then, install and start the service:

```
relay service install -c 'C:\ProgramData\WebhookRelay\config.txt'
```

The agent is now installed and will be run after a system reboot.

To restart the service (if you change the configuration file):

```
relay service restart
```

### [Troubleshooting](#troubleshooting)

- To view the logs:

```
relay service install -c C:\ProgramData\WebhookRelay\config.txt  --logs-output C:\ProgramData\WebhookRelay\relay.log
```

- If the service is not starting, check the logs in `C:\ProgramData\WebhookRelay\relay.log`

Did this page help you?