---
# System prepended metadata

title: Osmosis Pruned Node Setup

---

# Osmosis Pruned Node Setup



## Osmosisd

Installing the Osmosis Binary:
```
cd $HOME
git clone https://github.com/osmosis-labs/osmosis
cd osmosis
git checkout v11.0.1
make install
```
## Initialize Osmosis Node
```
#node name used : Pruned-test
osmosisd init Pruned-test

#Downloading and placing genesis in osmosis config:
wget -O ~/.osmosisd/config/genesis.json https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json
```
## Install and setup Cosmovisor
```
cd $HOME
git clone https://github.com/cosmos/cosmos-sdk
cd cosmos-sdk
git checkout v0.42.5
make cosmovisor
cp cosmovisor/cosmovisor $GOPATH/bin/cosmovisor
cd $HOME
```
Now make the necessary directories:
```
mkdir -p ~/.osmosisd
mkdir -p ~/.osmosisd/cosmovisor
mkdir -p ~/.osmosisd/cosmovisor/genesis
mkdir -p ~/.osmosisd/cosmovisor/genesis/bin
mkdir -p ~/.osmosisd/cosmovisor/upgrades
```
Next, set the following Environment Variables for Cosmovisor:
```
echo "# Setup Cosmovisor" >> ~/.profile
echo "export DAEMON_NAME=osmosisd" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.osmosisd" >> ~/.profile
echo 'export PATH="$DAEMON_HOME/cosmovisor/current/bin:$PATH"' >> ~/.profile
source ~/.profile
```

Copy osmosisd binary into the cosmovisor/genesis folder:
```
cp $GOPATH/bin/osmosisd ~/.osmosisd/cosmovisor/genesis/bin
```
Check versions of Cosmovisor and Osmosisd:

```
cosmovisor version
osmosisd version
```
## Download Chain Data

Download lz4:
```
sudo dnf install lz4
```
Now download the pruned node chain data:
```
URL="curl -L https://quicksync.io/osmosis.json|jq -r '.[] |select(.file=="osmosis-1-pruned")|select (.mirror=="Netherlands")|.url'"
cd $HOME/.osmosisd/
wget -O - $URL | lz4 -d | tar -xvf -
```
## Setup systemd service
``` python=1
echo "[Unit]
Description=Cosmovisor daemon
After=network-online.target
[Service]
Environment="DAEMON_NAME=osmosisd"
Environment="DAEMON_HOME=${HOME}/.osmosisd"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
User=cosmos
ExecStart=/home/cosmos/go/bin/cosmovisor start
Restart=always
RestartSec=3
LimitNOFILE=infinity
LimitNPROC=infinity
[Install]
WantedBy=multi-user.target
" >cosmovisor.service
```
Now move the cosmovisor.service file to:

```
sudo mv cosmovisor.service /lib/systemd/system/cosmovisor.service
```
Reload and start the service:

```
sudo systemctl daemon-reload
sudo systemctl restart systemd-journald
sudo systemctl start cosmovisor

#To check  status
sudo systemctl status cosmovisor
sudo journalctl -xe
```