PHPackages                             g33kme/ipfs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. g33kme/ipfs

ActiveLibrary[HTTP &amp; Networking](/categories/http)

g33kme/ipfs
===========

IPFS PHP Wrapper - About Easy to use PHP Wrapper for IPFS to work with the HTTP API of IPFS. When an IPFS node is running as a daemon, it exposes an HTTP API that allows you to control the node.

v1.0.0(4y ago)17MITPHPPHP &gt;=7.1

Since Nov 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/g33kme/ipfs)[ Packagist](https://packagist.org/packages/g33kme/ipfs)[ Docs](https://geekme.com)[ RSS](/packages/g33kme-ipfs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

IPFS PHP
========

[](#ipfs-php)

Easy to use PHP Wrapper for IPFS to work with the HTTP API of IPFS. When an IPFS node is running as a daemon, it exposes an HTTP API that allows you to control the node.

In many cases, using this API this is preferable to embedding IPFS directly in your program — it allows you to maintain peer connections that are longer lived than your app and you can keep a single IPFS node running instead of several if your app can be launched multiple times

🙏 You own some ADA? Help us improve this project by staking your ADA to our pool with ticker: **GEEK**
[GeekMe Stake Pool](https://adapools.org/pool/c13debc5c24d045cf5e2d69c33ff981602ae55d8bded995a6d930836)

1. Install and use IPFS PHP
---------------------------

[](#1-install-and-use-ipfs-php)

If you don't have any IPFS Node API running where you can connect IPFS PHP to, please follow first the installation steps in part 2.

This library is installable via [Composer](https://getcomposer.org/):

```
composer require g33kme/ipfs
```

You can also simply manually include `source/ipfs.php` from this repository to your project and use the IPFS PHP Class.

```
include('path/to/my/ipfs.php');
```

Requirements
------------

[](#requirements)

This library requires PHP 7.1 or later and if you use Composer you need Version 2+.

```
/*
 * You have to setup some Settings
 */

// Define your URL to your IPFS NODE API, with version, but NO ending slash!
define('IPFS_API', 'http://:5001/api/v0');

// Check version of your IFPS Node
$res = IPFS::version();
print_r($res);

//Add a file to your IFPS Node and get a hash back
$res = IPFS::add(array(
    'file' => 'path/to/your/geekme.png'
));
print_r($res);
echo $res[Name].' was uploaded to IPFS with hash: '.$res[Hash];
```

2. Installation: IPFS Node
--------------------------

[](#2-installation-ipfs-node)

If you have already a running IPFS node where your can connect our IPFS PHP Wrapper to, you can skip the installation part.

⭕ **Important!**

IPFS can run on most Linux, macOS, and Windows systems. We recommend running it on a machine with:

- Min 2 vCPU
- Min 2GB of RAM (4GB Recommended)
- 50 GB of disk space (Ideally SSD)
- Good internet connection (at least 10Mbps)

Alright, let's try to setup your IPFS node, we running on **Ubuntu 20.04 LTS**

### 2.1 GoLang is needed for running your IPFS node

[](#21-golang-is-needed-for-running-your-ipfs-node)

```
# Update operation system
apt-get update
apt-get upgrade

# GoLang is needed for running IPFS
# Install latest GoLang, (At the time of this guide, the current version of GoLang is 1.17.2. You may want to replace the version of GoLang if a newer version becomes available)
wget https://dl.google.com/go/go1.17.2.linux-amd64.tar.gz

# Extract GoLang to /usr/local
tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz

# Open up your .profile
# With any editor your want or nano
nano ~/.profile

# Add these lines to the bottom of the file
export PATH=$PATH:/usr/local/go/bin
export GOPATH="$HOME/go"
PATH="$GOPATH/bin:$PATH"

# Optional, If you’d like to define a specific path for IPFS instead of the default ~/.ipfs path, please include the following line at the end of the file:
export IPFS_PATH=/your/custom/path

# When you are on nano exit with CRTL+x, save with y, and hit enter to confirm

# Then reload your profile
source ~/.profile

# Check that your installation was successful
# You should be greeted with something like: “go version go1.12.1 linux/amd64”. If you received this message, congrats! GoLang was successfully installed
go version
```

### 2.2 Installing IPFS with ipfs-update

[](#22-installing-ipfs-with-ipfs-update)

First, you’ll want to install [ipfs-update](https://github.com/ipfs/ipfs-update). This handy package allows you to easily update your ipfs client whenever there are new updates without having to go through a bunch of manual upgrade headaches.

```
# Download and get
go get -u github.com/ipfs/ipfs-update

# Once this is complete, go ahead and run this command:
ipfs-update versions

# Take note of whatever version is the latest and run something like this
# You should receive a message that says “Installation complete!”
ipfs-update install v0.10.0

# Now run
# You should see a message that you initializing IPFS node, generating keypair and get your peer identity
ipfs init --profile server

# Depending on your server storage you want to increase your IPFS size from default 10GB to let's say 50GB
ipfs config Datastore.StorageMax 20GB

# Now you can start your IPFS daemon
# Your IPFS node is now officially running
ipfs daemon
```

### 2.3 Creating an IPFS service so your IPFS node is running all the time

[](#23-creating-an-ipfs-service-so-your-ipfs-node-is-running-all-the-time)

If you exit your SSH session on your Server, IPFS will shut down. You can fix this by creating an ubuntu systemd service to keep things running.

```
# Create a systemd service file
# Attention, If you chose a custom path for IPFS, you’ll want to use that in the environment instead of the default IPFS path.
nano /etc/systemd/system/ipfs.service

# Enter the following code in your editor
[Unit]
Description=IPFS Daemon
[Service]
Type=simple
ExecStart=/root/go/bin/ipfs daemon --enable-gc
Group=root
Restart=always
Environment="IPFS_PATH=/root/.ipfs"
[Install]
WantedBy=multi-user.target

# Save your new file on nano with CRTL+x, y, and then confirming by hitting ENTER

# Check this commands in your termian to enable your new IPFS service
systemctl daemon-reload
systemctl enable ipfs
systemctl start ipfs

# Check and see the status of your created IPFS service
# You should see some satus "active (running) in your console
systemctl status ipfs

# You may try to restart your server and check your IPFS service
shutdown -r now

# Once the reboot is complete, SSH back into your server and run the following to see if you have an IPFS node up and running:
# You should see a few peers your ipfs node is connected to
ipfs swarm peers
```

### 2.4 Incoming Ports of your IPFS Node

[](#24-incoming-ports-of-your-ipfs-node)

⭕ **Very important!**

Your IPFS Node creates a public accessible HTTP API and open some other ports to work with other IPFS nodes. At easiest and best simple create firewall rules to access the cardano-wallet API only from specific IPs. You can create firewalls, mostly free, on popular hosting providers like Hetzner, Vultr or DigitalOcean. Of course you can setup a custom firewal rule in your operating system as well.

**TCP 4001**
This is the primary port that your IPFS node will use to communicate to other IPFS nodes, you should keep that open for any IP4/6 address.

**TCP 5001**
This is your IPFS API to connect our IPFS PHP library to, you should only allow inbound traffic on specific IPs

**TCP 8080**
This is needed if you want to run your node as a gateway node. This is the port where you can see the content of your IPFS has. For example, you can retrieve an image of some of our Geekme Logos [Geekme Logo](https://ipfs.geekme.com/ipfs/QmXt1kKcQgE347qW7gPeMpmbDJqGAgF34AFcXjkuCyUx4h)

**TCP 8081**
This is needed if you want to run pubsub capabilities on your node.

### 1.5 Changing listen IP address and ports

[](#15-changing-listen-ip-address-and-ports)

You may run your IPFS node on other ports and run on your public IP address to access. Simply set your listen IP address to `0.0.0.0` to listen on all available IPs of your server. E.g set as API config: `/ip4/0.0.0.0/tcp/5001`

```
# Simply set in your api/config file of your IPFS node
/root/.ipfs/api
/root/.ipfs/config

# restart the IPFS Node service
systemctl restart ipfs
```

You may also add some peers from popular sites as cloudflare, pinata etc, so your uploaded files on your IPFS node get sync faster. Open `/root/.ipfs/config` file and change "Bootstrap" Contet to the following

```
"Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/dnsaddr/nyc1-1.hostnodes.pinata.cloud/ipfs/QmRjLSisUCHVpFa5ELVvX3qVPfdxajxWJEHs9kN3EcxAW6",
    "/dnsaddr/fra1-1.hostnodes.pinata.cloud/ipfs/QmWaik1eJcGHq1ybTWe7sezRfqKNcDRNkeBaLnGwQJz1Cj",
    "/ip6/2606:4700:60::6/tcp/4009/ipfs/QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP",
    "/ip4/172.65.0.13/tcp/4009/ipfs/QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP"
  ],
```

```
# restart the IPFS Node service
systemctl restart ipfs

# and check your bootstrap
ipfs bootstrap
```

🙏 Supporters
------------

[](#-supporters)

You own some ADA? Stake your ADA to our pool with ticker: GEEK
[GeekMe Stake Pool](https://adapools.org/pool/c13debc5c24d045cf5e2d69c33ff981602ae55d8bded995a6d930836)

☕ Wanna buy me a coffee or two? Send some ADA to our donation address: addr1qxksn95zhgje7tvdsgfpk9t49sssz4fqewt74neh56cnl4ml8zpc3556jh8exfp70a6f3pva7yf4fmfmw52tdh3dh94sqdvu27

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1641d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3472ede6f010dd75a8feb8751a0a5bf26c3d84a3967d616a536e88b262951432?d=identicon)[g33kme](/maintainers/g33kme)

---

Top Contributors

[![g33kme](https://avatars.githubusercontent.com/u/6792320?v=4)](https://github.com/g33kme "g33kme (1 commits)")

---

Tags

phpipfsipfs-apiipfs phpipfs httpipfs node apiipfs api php

### Embed Badge

![Health badge](/badges/g33kme-ipfs/health.svg)

```
[![Health](https://phpackages.com/badges/g33kme-ipfs/health.svg)](https://phpackages.com/packages/g33kme-ipfs)
```

###  Alternatives

[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76410.4k1](/packages/hannesvdvreken-guzzle-debugbar)[rootsoft/laravel-ipfs

Laravel package to communicate with IPFS

323.9k](/packages/rootsoft-laravel-ipfs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
