Skip to content
Ansible configuration to start an IPFS gateway
HTML JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Easy IPFS gateway and pinner

These are Ansible scripts to set up your own IPFS gateway on a Debian server including a small web front-end that allows for pinning of IPFS content.


There are two ways of installing the gateway on a server: using the ansible script to remotely provision the server or using the cloud-init snippet below. The cloud-init snippet is the best approach for beginners.

Using cloud-init to provision on server creation

You can use cloud-init to configure a Scaleway server and have everything automatically done.

Copy paste the following cloud-init in the Configure advanced options section of the Scaleway new server form:

  - ansible
  - git
  - whois
package_update: true
package_upgrade: true
package_reboot_if_required: true
  - "git clone"
  - "cd ipfs-video-gateway && HOME=/root PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ansible-playbook --connection=local --inventory=, playbook.yml 2>&1|/usr/bin/tee /tmp/tee.log"
  - "echo admin:`mkpasswd -m sha-256 ADMINPASSWORDHERE` > /etc/nginx/htpasswd"

After starting the server, wait for a few minutes for the system to update, install and configure.

You should see the website come up and you should be able to start pinning content. To pin content you will be requested to use a password for the user admin. The password is configured above by replacing ADMINPASSWORDHERE with the password you want. If you forget to do this, the password will simply be the capital letters ADMINPASSWORDHERE.

Remote provision using local Ansible installation

  • Locally install Ansible
  • Have a debian based server with SSH connectivity ready. You could start a Scaleway Debian server, a Debian Stretch START1-XS will do, but you can also use another already running server. Keep in mind however, that the provisioning will override the following: firewall configuration, nginx configuration, repository information
  • Verify that you can ssh into your server
  • Configure the user and ip address in inventory.yml
  • Provision the server using ansible-playbook --inventory-file=inventory.yml playbook.yml

After provision has finished, you should be able to access the IPFS pinner web interface at your server ip.

Consider trying to pin Qmb7yZdYZeRoLCvTvjwMzqeS4Jv9jeJuHKCBuUkHoAFhRh

Please note: Currently there is no security enabled! After provisioning anybody will be able to pin any content. You can disable pinning by chaning the /etc/nginx.conf file by removing the proxy to the ipfs api.

You can’t perform that action at this time.