ScriptNet Solutions Support

How to Install and run an IPFS node on Ubuntu Servers

Here is a simple, step-by-step guide to installing and running an IPFS node using Kubo on an Ubuntu server.

 

1. Download and Install Kubo Binary:
 
Fetch the latest official release from the distribution server.

 

Connect to your Ubuntu server via SSH, update your package lists, and download the latest version of Kubo:

sudo apt update && sudo apt install -y wget curl
# Download the latest Linux AMD64 package
wget https://dist.ipfs.tech/kubo/v0.32.1/kubo_v0.32.1_linux-amd64.tar.gz

(Note: You can check [https://dist.ipfs.tech/#kubo](https://dist.ipfs.tech/#kubo) for the absolute newest version if needed).

 

Extract the archive, move into the extracted directory, and run the install script:

tar -xvzf kubo_v0.32.1_linux-amd64.tar.gz
cd kubo
sudo bash install.sh

And verify the installation by checking the version:

ipfs --version

 

2. Initialize the IPFS Repository:
 
Set up local node keys and configurations.

 

Initialize your local IPFS repository. If you are setting this up on a remote server or a cloud instance, it is recommended to use the server profile, which optimizes configuration for headless servers (e.g., disabling local mDNS discovery):

ipfs init --profile server

This will generate your node's unique Peer ID and initialize the configuration directory (typically located at ~/.ipfs).

 

3. Create a Dedicated Systemd Service:
 
Run IPFS in the background as a persistent service.

 

To keep your IPFS node running continuously in the background and start it automatically on boot, create a dedicated system user and a systemd service file.

Create a non-privileged user for IPFS:

sudo useradd -r -s /bin/false ipfs
sudo mkdir -p /var/lib/ipfs
sudo chown ipfs:ipfs /var/lib/ipfs

Move your initialization files or initialize it for the new user:

sudo -u ipfs IPFS_PATH=/var/lib/ipfs ipfs init --profile server

Create the systemd service file:

sudo nano /etc/systemd/system/ipfs.service

Paste the following configuration into the file:

[Unit]
Description=IPFS Daemon
After=network.target

[Service]
User=ipfs
Group=ipfs
Environment=IPFS_PATH=/var/lib/ipfs
ExecStart=/usr/local/bin/ipfs daemon --enable-gc
Restart=on-failure
LimitNOFILE=8192

[Install]
WantedBy=multi-user.target

Save and exit (Ctrl+O, Enter, then Ctrl+X), then enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable --now ipfs

 

4. Verify Node Status:
 
Confirm your node is active and connected to peers.

 

Check if the IPFS daemon is running successfully:

sudo systemctl status ipfs

You can also interact with your local node CLI to see connected peers:

ipfs swarm peers

 

Now you're running your own IPFS Node!