I’ve been playing with Umbrel the last couple of days and it’s a great product. Love the one-click install of all kinds of stuff that I’ve been maintaining through docker containers on a separate server.
One feature that I would really like as a developer is the ability to run signet and testnet nodes with electrs/mempool servers that connect to them. The only way that I can conceive of doing them at the moment is through portainr, which is fine, but running a getumbrel/umbrel-bitcoin docker image off of that is not easy to configure, so I would love to get some hints on how to do that. Obviously, I would like to configure two docker images to be running testnet and signet to start. I would also like to do the same with electrs and mempool.space.
Ideally, I would like to have these available not just in my private network via tailscale, but also have the option to route to them using DynDNS. That would also mean that there would need to be some sort of ssl cert in the nginx configuration, perhaps a letsencrypt certificate container that renews the certificate, but let’s not get ahead of ourselves.
How do you run testnet/signet umbrel-bitcoin in a docker container so the block data persists? I can bind the volume directly to disk, but it’s really a docker running in a docker, so the directory is not where I thought it would be (took me a bunch of tries to figure out where the actual data directory was). Any hints from the Umbrel tech support team would be appreciated.
Hey Jimmy, stoked to hear that you’re digging the convenience of the one-click install even as a coder.
Have you played around with switching networks in the Bitcoin Node app’s UI yet? This, in combination with running multiple umbrelOS instances (instead of trying to run multiple nodes on the same instance), is probably the easiest way to do what you’re trying to do without having to mess around with portainer, docker-in-docker, stripping out our app proxy, and translating environment variables.
To switch networks:
Go to the Bitcoin Node app, click the three dots in the upper right corner of the app, and select Advanced Settings.
In the “Network Selection” section, choose
the network you want to switch to and then click “Save and restart bitcoin node”.
Your node will now be running on the network you chose (e.g., testnet). Data is persisted no matter which network you are on, so you don’t have to modify any of the data directories or anything like that.
The main data directory on the host machine for the bitcoin node app is ~umbrel/app-data/bitcoin/data
bitcoind data is one level deeper at ~umbrel/app-data/bitcoin/data/bitcoin
Then it just follows the standard bitcoin data directory structure from there. Writing this bit for others who make their way to this post: your mainnet block data is at ~umbrel/app-data/bitcoin/data/bitcoin/blocks, but any other network gets its own subdirectory… signet for example would be at ~umbrel/app-data/bitcoin/data/bitcoin/signet/blocks.
Restart umbrelOS to make sure dependent apps are running on the correct network.
Future updates will make this easier, but for now the most foolproof way to get dependent apps (like LND, Core, electrs, mempool) to switch networks is to just restart umbrelOS completely. This will make sure that all apps have access to the correct environment variable for the network you’re running on.
To be extra safe I would do exactly this to avoid third-party apps having difficulty switching if they have already written data related to mainnet:
Install Bitcoin Node app
Switch networks through Advanced Settings
Restart umbrelOS
Then install other apps like LND, Core, electrs, mempool, etc.
I use what I have described above in my development workflow, so can confirm this works for official umbrel apps like Lightning Node and Electrs, but I know it also works for Mempool.
Ideally, I would like to have these available not just in my private network via tailscale, but also have the option to route to them using DynDNS. That would also mean that there would need to be some sort of ssl cert in the nginx configuration, perhaps a letsencrypt certificate container that renews the certificate, but let’s not get ahead of ourselves.
We have some interesting ideas for this in the future, but haven’t implemented an easy way to do this yet. @lukechilds any advice on the above DynDNS question?
Ya, this is tricky if you are attempting to run via the Portainer app since we are using docker-in-docker.
One of the quirks with this is that you have to use named volumes instead of bind mounts in order for the data to persist across restarts. The downside is that the named volume gets stored in the darkest depths of Mordor within the docker-in-docker’s data directory. To find your named volumes I think you go to: ~/umbrel/app-data/portainer/data/docker/data/volumes
I didn’t realize running multiple instances of UmbrelOS on the same machine was an option! How do I do that? I tried installing to a different path but it craps out when docker runs into name conflicts.
How do I specify different container names or prefixes or something so I don’t get this error?
I guess my attempt to install another instance of UmbrelOS nuked my current setup! Any hints on how to get the mainnet back? The data is all there, but I was made to go through initial setup again and the apps I installed are no longer showing up.
Ah damn, sorry @jimmysong I wasn’t very clear with my language here:
I used the word “instance” way too loosely and accidentally sent you down the wrong path. I meant that it is best to run completely separate umbrelOS installs, such that each install is on a separate machine.
That being said, if you want to run multiple instances of umbrel OS on the same machine then your best bet would be to run multiple VMs. Multipass works pretty well for this in my experience: https://multipass.run/
You could set up two instances on the same machine with something like this (change --disk to what you actually need):
In theory, all you need to do is install the bitcoin app again and copy over all block/chainstate/index data to ~/umbrel/app-data/bitcoin/data/bitcoin and you will be good to go.
But I haven’t personally run into this issue before so I’m not sure what strange state we might be in with respect to the umbrelOS install and the data directory. Let me know if you want to jump on a call to resolve this realtime (DM’d you calendar details on this platform)
Also, just following up on this. While we are still working on a solution for this the best course of action is to manually set up DynDNS or a public proxy server. Thanks for the feedback on this. We’re open ears for anything else you come across while tinkering.