How to keep the local server running as a background process on macOS?

Hello there,

It’s probably a simple question but here it is,

I’m running Silverbullet locally on a mac, using the binary source. After launching the server, if I close my terminal window, I’m offline. How can I launch the server as a background task, without a terminal window popping? And also launching it when I boot the computer?

Thank you!

You might try asking that question on a MacOS forum. I’m a Linux user and I know that it is simple in Linux. So, I imagine it would be easy on a Mac. However, it is the type of thing that would be common knowledge in a Mac forum more so than here.

1 Like

Thanks, of course. I’ll do that and update this thread.

1 Like

Possibly via nohup, e.g. nohup deno task watch-all my_test_space > /tmp/silverbullet.log 2>&1 &

Here is what I did:

  • Create a text file containing your commands (bash script):
#!/bin/bash

# Start the Silverbullet server
nohup /Path-to-Silverbullet-binary-file /Path-to-Silverbullet-space-folder > /Path-to-silverbullet.log &
  • Save this file anywhere without extension
  • Make it executable:
chmod +x /Path to the script file
  • Add this file in System Preferences as a login item

At login, a terminal window will open, but I don’t mind it.

Source and other way to do it: https://superuser.com/questions/229773/run-command-on-startup-login-mac-os-x