You need to install mollysocket on a server that has 24/7 availability and has access to the internet. It doesn't necessarily have to have inbound access from the internet, like a webserver. That's the beauty of the "air-gapped" mode mentioned by @23Sha-ger.
Your mollysocket server essentially bridges the gap between the Signal server and your Android phone running ntfy. There's a cool diagram that explains how this works at https://github.com/mollyim/mollysocket. A picture is worth a thousand words, as they say.
You don't have to use Docker to install mollysocket -- you can use crates.io, like I did. I'm going to reproduce my build steps below in the chance it might help someone use this excellent software from the devs that brought you Molly. Their install docs on GitHub are very good, but I did have to connect a few dots. You should also have a decent understanding of the Linux CLI before you attempt this. Also, I do a lot of things logged in as root, which you probably shouldn't do.
0) Find a server you can use to run mollysocket. I signed up for a VPS on https://1984.hosting/ because they have a reputation as a privacy-oriented hosting company. I don't get anything if you sign up with them but I have had a great experience so far and it's very co$t effective, in my opinion. After your VPS is up and running:
1) Install rustup, which also installs cargo
curl https://sh.rustup.rs -sSf | sh
Restart the bash shell afterwards (assumes you're using the bash shell)
source ~/.bashrc
Add Rust to PATH
source "$HOME/.cargo/env"
Verify the installation
rustc -V
2) Create the molllysocket user and home directory
sudo useradd mollysocket -m -d /opt/mollysocket
sudo -su mollysocket
cd
3) Install any dependencies you might be missing (if logged in as root) or sudo
sudo apt-get update
sudo apt-get install libssl-dev
sudo apt-get install libsqlite3-dev
4) Login as the mollysocket user you created and install mollysocket
sudo -su mollysocket
cargo install mollysocket
Create the symbolic link
ln -s /opt/mollysocket/.cargo/bin/mollysocket /opt/mollysocket/ms
5) Download the config file to /opt/mollysocket
wget -O /opt/mollysocket/prod.toml https://github.com/mollyim/mollysocket/raw/main/config-sample.toml
6) Exit back to root
7) Download the systemd unit file to /etc/systemd/system/
wget -O /etc/systemd/system/mollysocket.service https://github.com/mollyim/mollysocket/raw/main/mollysocket.service
8) Start the mollysocket service
systemctl enable --now mollysocket
Verify the mollysocket service is running at any time using:
systemctl status mollysocket
9) Download ntfy from F-Droid/Obtanium and install on the Android phone
10) Install the UnifiedPush version of Molly on the Android phone with Obtanium: https://github.com/mollyim/mollyim-android-unifiedpush
It has to be the UnifiedPush version and not any of the other flavors of Molly.
11) Configure "Air Gapped Mode" on Molly UnifiedPush app by going to: Settings > Notifications
Delivery Method = UnifiedPush
UnifiedPush Status = Air Gapped
Notification method = ntfy
Air gapped switch = On
Copy server parameters
12) Using server parameters copied from Molly, add a new connection to the mollysocket service. Fill in the parts that are unique to your install exactly as you copied from Molly Settings > Notifications
mollysocket -c /opt/mollysocket/prod.toml connection add your-UUID-goes-here 2 \thisisyouruniquestring 'https://ntfy.sh/upthisisuniquetoyou?up=1'
If all of the above was successful, this will generate a push notification from mollysocket to your phone: "Unified Push This is a test notification received from your MollySocket server."
Molly should now receive push notifications when Signal messages are sent to you even when the database is locked.
You'll see the ntfy app is persistent in the status bar/shade: "Listening for incoming notifications".
New Signal incoming messages will send a push notification to your Molly app: "You may have new messages."
Anyway, this will get you 95% of the way there. I may add some post-install steps below to harden the installation as this post is already long enough. And I'm not the strongest Linux person but I hope this helps someone.