Skip to content

Instantly share code, notes, and snippets.

@ilovelili
Created November 22, 2020 07:42
Show Gist options
  • Save ilovelili/38145eb5c3ac8e81cc2f81d8e2440f8c to your computer and use it in GitHub Desktop.
Save ilovelili/38145eb5c3ac8e81cc2f81d8e2440f8c to your computer and use it in GitHub Desktop.
set up IPFS systemd service
#!/bin/bash
#pick your IPFS version
VERS=0.7.0
DIST="go-ipfs_v${VERS}_linux-amd64.tar.gz"
sudo apt-get update
sudo apt-get install golang-go -y
wget https://dist.ipfs.io/go-ipfs/v0.4.13/$DIST
tar xvfz $DIST
rm *.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
#initialized IPFS as 'ubuntu' user
#the systemd config also runs it as 'ubuntu'
ipfs init
#need to be root to write service file
sudo su
cat <<EOT >> /lib/systemd/system/ipfs.service
[Unit]
Description=IPFS daemon
After=network.target
[Service]
User=ubuntu
ExecStart=/usr/local/bin/ipfs daemon
[Install]
WantedBy=multiuser.target
EOT
exit
sudo systemctl start ipfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment