Created
February 4, 2018 22:36
-
-
Save pstehlik/9efffa800bd1ddec26f48d37ce67a59f to your computer and use it in GitHub Desktop.
Install IPFS on Ubuntu 16.04 64bit and set up as systemd service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#pick your IPFS version | |
VERS=0.4.13 | |
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 |
The script fail in reboot!!
To fix it change the 29 (WantedBy=multiuser.target) by the next:
WantedBy=default.target
And then all will be fine!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks