> ## Documentation Index
> Fetch the complete documentation index at: https://docs.initia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Cosmovisor (Optional)

Cosmovisor helps manage `initiad` binary upgrades automatically during chain
upgrades.

<Note>
  **Prerequisite:** complete the [Running L1 Nodes with
  Initiad](/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad)
  guide first, then follow the steps below.
</Note>

## Install Cosmovisor

```bash theme={null}
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
```

## Configure Cosmovisor

Set the daemon environment variables and initialize Cosmovisor. The
`<path-to-executable>` must be the path to your `initiad` binary.

```bash theme={null}
export DAEMON_HOME=~/.initia
export DAEMON_NAME=initiad

cosmovisor init <path-to-executable>
```

You can find the `initiad` path with:

```bash theme={null}
which initiad
```

## Update System Service (Optional)

If you run `initiad` as a service, update your `initiad.service` file:

```ini theme={null}
[Unit]
Description=initiad

[Service]
Type=simple
User=ubuntu
ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia
WorkingDirectory=/home/ubuntu/.initia
Restart=on-abort
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=initiad
LimitNOFILE=4096
Environment="DAEMON_NAME=initiad"
Environment="DAEMON_HOME=/home/ubuntu/.initia"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_RESTART_DELAY=5s"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
```

Reload and restart the service:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl restart initiad
```

For more details, see the
[Cosmovisor documentation](https://cosmos-docs.mintlify.app/sdk/v0.47/build/tooling/cosmovisor).
