Skip to content

Instantly share code, notes, and snippets.

@KEINOS
Last active October 29, 2022 00:51
Show Gist options
  • Save KEINOS/bc0e44d42debd817f823eeff20e1e1a8 to your computer and use it in GitHub Desktop.
Save KEINOS/bc0e44d42debd817f823eeff20e1e1a8 to your computer and use it in GitHub Desktop.
[IPFS] Simple "systemd" example to run IPFS and IPFS-Cluster as a service.
[Unit]
Description=IPFS-Cluster daemon
After=network.target ipfs
[Service]
User=myuser
WorkingDirectory=/home/myuser/
ExecStart=/usr/local/bin/ipfs-cluster-service daemon --bootstrap /ip4/<IP of your bootstrap>/tcp/9096/p2p/<NodeID>
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]
Description=IPFS daemon
After=network.target
[Service]
User=myuser
WorkingDirectory=/home/myuser/
ExecStart=/usr/local/bin/ipfs daemon --enable-gc --migrate
Restart=on-failure
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Copy the service files
cp ./ipfs.service /etc/systemd/system/ipfs.service
cp ./ipfs-cluster.service /etc/systemd/system/ipfs-cluster.service
# Regist service
sudo systemctl --system daemon-reload
sudo systemctl enable ipfs ipfs-cluster
sudo systemctl start ipfs ipfs-cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment