It depends on your linux distribution’s init system. I personally use Ubuntu 16.04 server and have a custom systemd service created for ipfs at
User=*put your own user here*
Group=*put your own group here*
This assumes that you’ve installed ipfs to
/usr/local/bin/ipfs, but if the executable is located somewhere else then you can update the path in the ipfs.service file.
After creating the service file I then configured the systemd service to automatically start by running the following commands:
sudo systemctl enable ipfs.service
sudo systemctl start ipfs.service
This should start the ipfs daemon in the background on boot and allow it to run without you needing to be connected.
This is very similar to the systemd example in the documentation, but if your distribution uses a different init system there are other examples here: https://github.com/ipfs/examples/tree/master/examples/init