Skip to content

Instantly share code, notes, and snippets.

@sanderpick
Last active November 29, 2022 04:30
Show Gist options
  • Save sanderpick/4d9a8ddb310c6c2908498ae9ee72a6a2 to your computer and use it in GitHub Desktop.
Save sanderpick/4d9a8ddb310c6c2908498ae9ee72a6a2 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.15/go-ipfs_v0.4.15_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.15_linux-amd64.tar.gz
rm go-ipfs_v0.4.15_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 ec2-user:ec2-user $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=ec2-user
Group=ec2-user
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
@sanderpick
Copy link
Author

sanderpick commented Mar 5, 2018

Run the installer

$ wget https://gist.github.com/sanderpick/4d9a8ddb310c6c2908498ae9ee72a6a2/raw/74495690656a064ac84867b75e2095669043536e/ipfs.sh && bash ipfs.sh

Sanity check

$ sudo systemctl status ipfs

Tail Logs

$ journalctl -u ipfs --follow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment