# Using systemd for a Validator Node

You can run your validator as a [systemd](https://en.wikipedia.org/wiki/Systemd) process so that it will automatically restart on server reboots or crashes (and helps to avoid getting slashed!).

Before following this guide you should have already set up your validator by following the [How to validate](https://wiki.polkadot.network/docs/learn-validator) article.

First create a new unit file called `polkadot-validator.service` in `/etc/systemd/system/`.

```
touch /etc/systemd/system/polkadot-validator.service
```

In this unit file you will write the commands that you want to run on server boot / restart.

```
[Unit]Description=Polkadot Validator[Service]ExecStart=PATH_TO_POLKADOT_BIN --validator --name SHOW_ON_TELEMETRYRestart=alwaysRestartSec=120[Install]WantedBy=multi-user.target
```

**WARNING**

It is recommended to delay the restart of a node with `RestartSec` in the case of node crashes. It's possible that when a node crashes, consensus votes in GRANDPA aren't persisted to disk. In this case, there is potential to equivocate when immediately restarting. What can happen is the node will not recognize votes that didn't make it to disk, and will then cast conflicting votes. Delaying the restart will allow the network to progress past potentially conflicting votes, at which point other nodes will not accept them.

To enable this to autostart on bootup run:

```
systemctl enable polkadot-validator.service
```

Start it manually with:

```
systemctl start polkadot-validator.service
```

You can check that it's working with:

```
systemctl status polkadot-validator.service
```

You can tail the logs with `journalctl` like so:

```
journalctl -f -u polkadot-validator
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skypirl.tech/faq/maintain/validator-guides/using-systemd-for-a-validator-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
