Skip to content

Instantly share code, notes, and snippets.

@mishfit
Last active March 4, 2018 05:01
Show Gist options
  • Save mishfit/3ae8fe5bbc6fda92a5b75a8534a5a79c to your computer and use it in GitHub Desktop.
Save mishfit/3ae8fe5bbc6fda92a5b75a8534a5a79c to your computer and use it in GitHub Desktop.
IPFS Daemon Debian 9
  1. Compile/Download/Install as detailed at [https://github.com/ipfs/go-ipfs#install]. a. This should create an executable at /usr/local/bin/ipfs
  2. Create a user for the service (I opted to create a regular user with a home directory where an ipfs datastore can 'live'):
$ sudo mkdir /home/ipfs
$ sudo useradd -d /home/ipfs
$ sudo chown -R ipfs:ipfs /home/ipfs
$ sudo chown root:staff /usr/local/bin/ipfs
$ sudo chmod a+rx /usr/local/bin/ipfs
  1. Create a password for the user:
$ su root
# passwd ipfs #follow the prompts to create a password
# exit
  1. Login as the user and initialize ipfs:
$ su ipfs
$ ipfs init
$ exit
  1. Create an ipfs.service file in /etc/systemd/system
  2. Enable and start the servive:
$ sudo systemctl enable ipfs
$ sudo systemctl start ipfs
  1. Verify ipfs has started successfully:
$ ps ax | grep ipfs
$ tail -n 60 /var/log/syslog

Notes

[Unit]
Description=IPFS Daemon
After=network.target
[Service]
# run as root, set base_path in config.toml
#ExecStart=/usr/local/bin/ipfs --config /etc/ipfs/config
# To run as user, comment out above and uncomment below, fill in user and group
# picks up users default config in $HOME/.ipfs/
User=ipfs
Group=ipfs
ExecStart=/usr/local/bin/ipfs daemon
Restart=on-failure
# Specifies which signal to use when killing a service. Defaults to SIGTERM.
# SIGHUP gives IPFS time to exit cleanly before SIGKILL (default 90s)
KillSignal=SIGHUP
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment