Skip to content

Instantly share code, notes, and snippets.

@thelastinuit
Forked from sanderpick/ipfs.sh
Last active October 13, 2018 22:33
Show Gist options
  • Save thelastinuit/14c5efd19a4e87f3d2fadb5f4f0a5c83 to your computer and use it in GitHub Desktop.
Save thelastinuit/14c5efd19a4e87f3d2fadb5f4f0a5c83 to your computer and use it in GitHub Desktop.
Install ipfs on Amazon Linux.
#!/usr/bin/env bash
set -e
echo 'export IPFS_PATH=/data/ipfs' >>~/.bash_profile
source ~/.bash_profile
# ipfs daemon
wget https://dist.ipfs.io/go-ipfs/v0.4.17/go-ipfs_v0.4.17_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.17_linux-amd64.tar.gz
rm go-ipfs_v0.4.17_linux-amd64.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin
rm -rf go-ipfs
# init ipfs
sudo mkdir -p $IPFS_PATH
sudo chown ubuntu:ubuntu $IPFS_PATH
ipfs init
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
# ipfs systemctl service
sudo bash -c 'cat >/lib/systemd/system/ipfs.service <<EOL
[Unit]
Description=ipfs daemon
[Service]
ExecStart=/usr/local/bin/ipfs daemon --enable-gc --enable-pubsub-experiment
Restart=always
User=ubuntu
Group=ubuntu
Environment="IPFS_PATH=/data/ipfs"
[Install]
WantedBy=multi-user.target
EOL'
# enable the new services
sudo systemctl daemon-reload
sudo systemctl enable ipfs.service
sudo systemctl start ipfs
# sudo systemctl status ipfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment