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!

4 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

As mentioned by @drewbs-b elsewhere, this goes nicely together with TSDProxy, which allows you to expose multiple SilverBullet instances (or other services) via different tailscale sub-domains easily: Introduction – TSDProxy

Is this guide still up to date. I am trying to run SilverBullet on my pi and access it as a server via other machiles on my lan. I tried these steps and cannot get it to work on my pi as per this guide. I continue to get "command not found when I enter “$ sudo docker run -d --name silverbullet -e SB_USER=sb:12345 --restart=unless-stopped -p 3000:3000 -v $PWD/space:/space zefhemel/silverbullet:latest”
I was able to log into my tailscale account after clicking the auth link after running “sudo tailscale up” but it only showed a screen where it was waiting for an app to connect. I could not figure out how to navigate to an admin page to enable “MagicDNS”

However I can get it to work locally on the pi via the command “sudo docker run -it -p 3000:3000 -v ./space:/space Package silverbullet · GitHub”
and access it on the pi only via localhost

Any Ideas? Thanks
Stephen

Just to be really sure, are you entering the command without the $ infront?

Oh you are correct. Now I can get it running and access it on the pi at port 3000. However it does not behave well as many of the pages are missing? and there is a large html on boarding content block that does not run.
I changed the “latest” parameter to “edge” but it made no difference.

You probably need to access SB over HTTPS. There are a bunch of guides on here and on the web on how to get a certificate and set it up. Tailscale also has guides for that I think.

Thanks I will try that

I think you are right but I cant find the setup guides for ssl certs you have mentioned in this forum. Could you point me towards them please.
Thanks

Just searched for the stuff again and I think I have mandela effect. There are some side notes, but nothing going in depth. But if you google, there thousands of helpful results. This is the first one for me. If you are using tailscale, this guide is probably the right one, although I don’t know much about tailscale.
There isn’t a one size fits all solution for this issue tho, so you’ll have to read a bit about advantages, disadvantages and see what’s easiest and best for you.

Thanks. I am not very technical and it is a bit overwhelming. The idea of using the pi is good but hard to set up.
Can I ask how you set it up as I want to share the one “space” between two computers and an ipad on my local lan.
Stephen
Stephen

My setup is convoluted and complex.
You’ll have to just take the plunge and follow some guide or tutorial. You’ll probably have to learn what e.g. a reverse proxy is and so on, there really isn’t away around the technical stuff if you want to independently self host.