Skip to main content

Setting up Cosmovisor


cosmovisor is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, cosmovisor can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.



  1. Install the latest version of cosmovisor
go install
  1. Install from source
git clone [email protected]:cosmos/cosmos-sdk
cd cosmos-sdk
git checkout cosmovisor/vx.x.x
make cosmovisor

This will build cosmovisor in /cosmovisor directory. Afterwards you may want to put it into your machine's PATH like as follows:

cp cosmovisor/cosmovisor ~/go/bin/cosmovisor

Add environment variables to your shell

In the .profile file, usually located at ~/.profile, add:

export DAEMON_NAME=aurad
export DAEMON_HOME=$HOME/.aura

Then source your profile:

source ~/.profile

Set up folder structure

Cosmovisor expects a certain folder structure:

├── cosmovisor
│ ├── current -> genesis or upgrades/<name>
│ ├── genesis
│ │   └── bin
│ │   └── $DAEMON_NAME
│ └── upgrades
│ └── <name>
│ ├── bin
│ │   └── $DAEMON_NAME
│ └── upgrade-info.json
└── ...

current - a symlink used by Cosmovisor. The other folders will need setting up:

mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades

Set up genesis binary

Cosmovisor needs to know which binary to use at genesis. We put this in $DAEMON_HOME/cosmovisor/genesis/bin First, find the location of aurad:

which aurad

Then use the path returned to copy it to the directory Cosmovisor expects. Let's assume the previous command returned /home/<your-user>/go/bin/aurad

cp /home/<your-user>/go/bin/aurad $DAEMON_HOME/cosmovisor/genesis/bin

Configure the host's init system

Configure cosmovisor as a system serivce for automatically starting.

systemd is used for demonstration.

First, create the service file:

sudo vi /etc/systemd/system/cosmovisor.service

Change the contents of the below to match your setup - cosmovisor


ExecStart=/home/<your-user>/go/bin/cosmovisor run start


Start Cosmovisor

Enable the service and start it:

sudo -S systemctl daemon-reload
sudo -S systemctl enable cosmovisor
sudo systemctl start cosmovisor

Check it is running using:

sudo systemctl status cosmovisor
journalctl -u cosmovisor -f