Take your IPFS game to the next level by learning how to deploy and manage your very own IPFS node in the cloud.
Matt Ober |
---|
@obo20 |
- How to deploy an IPFS node using a cloud provider
- How to configure that node for your specific use case
- Tips and tricks for running IPFS infrastructure in the cloud
We will use Digital Ocean, a Cloud service to host our remote and public IPFS node. To successfully complete this course, you will need to create a Digital Ocean account:
- Sign up for an account preloaded with $50 in free credits with this link: https://do.co/pinata - (Requires a credit card but you won't be charged)
The following commands are provided for easy copy / pasting during the node deployment part of the course. During the course, we will go over when and why to use these commands when setting up your infrastructure.
- Open up your terminal
- Type in
ssh-keygen
- Hit enter to accept the recommended default path. DO NOT CHOOSE TO OVERWRITE IF A KEY ALREADY EXISTS
- Optionally provide a password to require each time you use your key or just hit enter twice to avoid requiring a password
To copy your SSH Key, do either of these:
- Type:
cat ~/.ssh/id_rsa.pub
- Travel to your public key with:
cd ~/.ssh/id_rsa.pub
and open the file to copy the contents
( The above instructions are assuming your key is saved in the default location )
In your terminal type: ssh root@your_droplet_ip
( You'll need to type yes
when ssh-ing into your node for the first time )
You should now be connected to your droplet!
Now, in your terminal type:
-
apt-get update
-
apt-get upgrade
2.1. If you get a pink screen asking whether to automatically restart, hit
LEFT ARROW
and thenENTER
2.2. If you get another pink screen asking for a confirmation, hit
ENTER
-
apt autoremove
-
shutdown -r 0
Your droplet should now be updated and rebooted.
In your terminal:
- Download ipfs-update with:
curl -O https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz
- Unzip it with:
tar -xzf ipfs-update_v1.5.2_linux-amd64.tar.gz
- Go into the ipfs-update folder with:
cd ipfs-update
- Install ipfs-update with:
./install.sh
- Install the latest ipfs version with:
ipfs-update install latest
- Initialize ipfs with
ipfs init --profile server
- Check that IPFS was installed with:
ipfs daemon
- Hit
CTRL + C
to end the process
- Create a system service with:
nano /etc/systemd/system/ipfs.service
- Enter the following instructions:
[Unit]
Description=IPFS Daemon
[Service]
ExecStart=/usr/local/bin/ipfs daemon --enable-gc
Restart=always
Environment="IPFS_PATH=/root/.ipfs"
[Install]
WantedBy=multi-user.target
- Save your new service by hitting
CTRL + X
, theny
, thenENTER
- Reload your system with:
systemctl daemon-reload
- Enable your new service with:
systemctl enable ipfs
- Start your new service with:
systemctl start ipfs
- Test that this succeeded with:
systemctl status ipfs
- In your terminal type:
ipfs pin add -r --progress QmWcLKHWqrRB95zQnb4vX8RRgoGsVm5YAUHyZyiAw4mCMQ
- In your terminal expose your gateway with:
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
- Now restart ipfs with:
systemctl restart ipfs
- Now in your browser go to http://yourDropletIp:8080/ipfs/QmWcLKHWqrRB95zQnb4vX8RRgoGsVm5YAUHyZyiAw4mCMQ
https://medium.com/pinata/how-to-deploy-an-ipfs-node-on-digital-ocean-c59b9e83098e