Install SilverBullet on a 64-bit Debian/Ubuntu/RaspianOS, Internet accessible via Tailscale

This is a simple guide to setup SilverBullet on any 64-bit Debian derivative (Debian, RaspianOS, Ubuntu) and exposing it to the Internet using Tailscale.

Features:

  • Quick to set up
  • Enables simple username/password authentication
  • Exposes your SilverBullet to the Internet (or local Tailscale VPN) via HTTPS, via a *.ts.net domain
  • Auto upgrades (daily in case of new releases)
  • Automatically comes back up if your machine restarts

Requirements:

  • A free tailscale account
  • A 64-bit Linux machine (e.g. a Raspberry Pi 3B+, or a cheap VPS from e.g. Linode, DigitalOcean, Vultr, or Hetzner) running a Debian-derivative OS with 1GB of RAM (to be safe, but less may be possible)

Login to the Linux machine and install Docker and Tailscale:

$ sudo apt update
$ sudo apt install curl docker.io
$ curl -fsSL https://tailscale.com/install.sh | sh
$ sudo tailscale up

Click the auth link, login to your Tailscale account. Then, visit your tailscale admin DNS page: Tailscale and enable ā€œMagicDNS.ā€

Go back to your Linux machine and create a folder for your space where your content (markdown files, attachments) will be kept:

$ mkdir space

Start the SilverBullet container with docker. Important: in this command replace sb:12345 with a better username:password combo.

$ sudo docker run -d --name silverbullet -e SB_USER=sb:12345 --restart=unless-stopped -p 3000:3000 -v $PWD/space:/space zefhemel/silverbullet:latest

For the adventurous: you can replace :latest with :edge to use edge builds: Living on the edge (builds)

SilverBullet now runs and is available on your machineā€™s IP at port 3000.

(Inter)net access

To expose SB via HTTPS (which is a requirement for many PWA features to work, including sync and working offline), you have two options:

  1. Enable Internet-wide access (you can access your SB instance from anywhere through its assigned URL)
  2. You restrict access to devices that are connected to your Tailscale VPN

To enable Internet-wide access use tailscale funnel:

$ sudo tailscale funnel --bg 3000

Or to only allow access from within your Tailscale VPN use tailscale serve:

$ sudo tailscale serve --bg 3000

Both will give you a https URL to access your SB (just one is accessible from the Internet, the other is not).

Note: Devices connected to your Tailscale VPN will use the shortest path to your machine (can be direct via your LAN or relayed via Internet Tailscale relay servers), so performance is generally better when connected via the Tailscale VPN client.

Automatic upgrades

Enable automatic upgrades with the watchtower container:

$ sudo docker run -d --restart=unless-stopped -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower

This will check daily if a new version of SilverBullet is available, pull the new container image and start a new container using it.

Enjoy!

3 Likes

What this would need is a good backup option. In case you use a cloud VPS, you may just have a box you can tick to have your VM be automatically backed up, but when self hosting a Raspberry PI youā€™ll need to come up with something else. Recommendations appreciated.

I was about to complain that I canā€™t start SilverBullet from cron job @reboot, but I guess this is the ā€œcorrectā€ way to do it with updates and whatnot.

What this would need is a good backup option.

Personally, I use the Git Plug to sync notes with a offsite repository. This gives me more history and resilience than I need, honestly.

I donā€™t think ā€œJust use GitHub broā€ fits the self-hosted ethos, but one can always run their own git serverā€¦ Definitely recommend it for the paranoic hoarder archivist, makes me more comfortable with pruning my notes, knowing they will stay somewhere there.

I have a deno instance at work, because i cannot use docker in my corp machine, which i spin up with a systemd configuration.
It turns up at boot.

Let me know if youā€™d like to get the details.

Eventually Iā€™ll add this in a guide but i am really busy these days

1 Like

Iā€™d like the details as Iā€™d like to avoid docker too :slight_smile:

I just added a Guide here: Install SilverBullet on Linux with Deno