I have bitcoind installed on my VPS using ubuntu 18.04 server, and I want to configure it to autostart when system starts, I know two options to make it happend, the first is this:

systemctl enable bitcoind

the second is this but substituting the program with your bitcoind binary

so which is better? what are the differences between those?

Thanks in advance.

  • There’s a suitable systemd configuration for bitcoind in the contrib directory. – Anonymous Nov 23 '19 at 20:22

You could add a cron program that runs on startup, creates a temp file to say it has already ran, and then execute. This makes it so that every time cron tries to run the program, it turns out empty.


touch /tmp/btc.true
[ ! -f /tmp/btc.true ] && sudo -u $USER sh -c 'HOME=~$USER; bitcoind -daemon'
exit 0
| improve this answer | |
  • That’s awful. There’s a @reboot flag for cron if you want to be hacky. – Anonymous Nov 24 '19 at 17:39
  • Ok, I'm noobie in this theme, I really dont understand so well... My main question is why not to use systemctl enable bitcoind? – Daveeee Nov 25 '19 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.