The Personal Cloud
Replace Dropbox / Google Drive / iCloud.
Replace Dropbox / Google Drive / iCloud with three nodes you already own: a VPS for availability, a desktop for the bulk of your files, and a phone whose camera folder sends every photo to them. Encrypted before it leaves any of them.
What you'll end up with: a vault called
Photoswith a full copy on the VPS and on the desktop (two copies that count), fed by the phone's camera folder, which sends its photos and receives nothing — deleting a photo on the phone to free space deletes it nowhere else. Browsable from any device's web UI.
Prerequisites
- Any small VPS — 1 vCPU, 1 GB RAM, 25 GB disk is enough for ~20 GB of replicated photos.
- Your usual desktop / laptop (Linux, macOS, or Windows).
- An Android phone with the MeshHold APK installed. iOS is not supported yet.
The app asks for access to all files on the phone the first time you pick
a folder outside its own storage, such as
DCIM/Camera. - A domain pointing at the VPS — optional, but it gives you free Let's Encrypt TLS.
1. Install the first node (VPS)
Start with the VPS — it's the only node guaranteed to be online, so it's our bootstrap peer.
# Ubuntu / Debian
ssh root@vps.example.com
wget https://meshhold.dev/dl/linux/meshhold-amd64.deb
apt-get install -y ./meshhold-amd64.deb
# Set a password for the web UI (daemon stays running)
sudo -u meshhold meshhold set-password
Prefer Docker? Same binary, no apt step, no system user. Works the same on any host with Docker installed:
bash curl -fsSL https://meshhold.dev/dl/docker/meshhold-amd64.tar.gz \ | gunzip | docker load docker volume create meshhold-data docker run -d --name meshhold --restart unless-stopped \ -p 7777:7777/udp -p 7778:7778 -p 8080:8080 \ -v meshhold-data:/var/lib/meshhold \ -e MESHHOLD_PASSWORD=changeme \ meshhold:latest-amd64The image is distroless static and runs as uid 65532. The
meshhold-datanamed volume picks that ownership up automatically; a host-path bind-mount needschown 65532:65532first.
Open https://vps.example.com:8080/ and accept the self-signed cert (or
configure api.tls.acme_domain in config.yaml for Let's Encrypt). The
Setup Wizard greets you with three choices:
- Create new network — pick this on the first node; it mints a fresh swarm-key.
- Join existing — for nodes #2, #3, …
- Continue offline — for trying it out on a laptop with no peers yet.
2. Create a vault
In the web UI, click Vaults → Add vault → Host a folder. Pick:
- Name:
Photos - Folder: the directory the VPS keeps the photos in, e.g.
/var/lib/meshhold/photos - Replication factor:
2(we want two copies that count). - Sync directions on this device: leave all four on — the VPS sends what lands in its folder and receives everything the others add.
The node generates the vault's key: 32 random bytes. It is the encryption
key, and the vault's Show QR / Link carries it — keep a copy of that link
somewhere safe. If you bring a key of your own (through the API or
config.yaml), it has to be 32 random bytes or more written as lowercase
hex, as openssl rand -hex 32 or meshhold vault create prints it. A
passphrase will not do: the vault's id is derived from its key and published
to the swarm, so anyone in it could guess a phrase offline. A new vault is
refused such a key, and meshhold config lint flags one in config.yaml.
RF counts only devices that stay online. Each node has a device type (Profile → Settings → Device type): Always online — a desktop's and a server's default — Backup server, or Sometimes online — a phone's default. A Sometimes online device's copies never count toward the factor and it keeps nothing for others, though it still hands out what it has. That's the point — phones come and go; servers stay.
3. Pair your desktop
On the VPS, open Profile → Network → Show QR / Link and copy the network invite (the QR or the link). On the desktop:
# Install the desktop binary (Linux example — Windows uses the MSI).
sudo apt-get install -y ./meshhold-amd64.deb
systemctl start meshhold
# Open https://localhost:8080/, pick "Join existing", paste the invite.
Within ~20 seconds the desktop appears in the VPS's Network page.
On the VPS, open the Photos vault's menu → Show QR / Link and copy the
link; on the desktop, open Vaults → Add vault → Join with key, paste
it, tick Mirror files locally and pick the folder the photos should land
in. Leave Receive files on and turn Receive deletions off: the
desktop then keeps every photo of the vault, and a photo deleted on another
device stays in its folder.
A device that joins cannot know how much the vault holds, so nothing is written into the folder yet. Once the vault's file list has arrived, the vault's tile says Will write 1,240 files, 18 GB (or however much it is) with Start and Change directions. Press Start.
4. Pair your phone
- Install the APK and open the app.
- Tap Scan invite, point it at the QR from the VPS.
- From the app's Scan tab, scan the
Photosvault's QR (on the VPS: the vault's menu → Show QR / Link). The app opens Add vault → Join with key with the invite filled in. - Tick Mirror files locally and press Browse…. The first time, the
app explains why it needs access to all files on the phone and opens
Android's own screen for it: allow access for MeshHold and come back.
Pick
DCIM/Camera. - Under Sync directions on this device, leave Send files on and turn the other three off. The camera folder then sends every photo in it, and every new one, to the vault; nothing from the other devices is written into it; and a photo you delete on the phone to free space stays in the vault and on the other devices.
- Press Join. With Receive files off there is nothing to start.
There is no separate camera-upload switch: the camera folder is an ordinary folder of the vault, and its sync directions are what make it upload-only. The phone exchanges files while it is active — the app in front with the screen on, or the phone charging on Wi-Fi. A photo taken while the phone sits in your pocket reaches the other devices the next time it is active.
5. Set the keep period and walk away
Each device decides for itself how long it keeps what is deleted. Open
Vaults → Photos → ⋮ → Vault info on the desktop: under Deleted
files, the keep period is how many days this node keeps the bytes of
a deleted file, so the deletion can be undone from here and from every
other device. It is also how long the folder keeps a kept copy of what
another device deleted or replaced in it — the old bytes are moved
into the folder's hidden .meshhold/kept/, and the file's History…
restores them (tick Deleted in the file list to see the deleted ones).
30 days by default; a server can keep a year.
The same panel shows the folder's Sync directions on this device, so you can change them later. A switch you turn on acts from then on and never replays the past: turning Receive deletions back on removes nothing that was deleted before.
A node that holds the vault in config.yaml instead — a headless VPS set up
by a deployment tool, say — says the same there. The key file holds the
vault's key — the vault_key its Show QR / Link carries; it
stays out of config.yaml itself, which deployment tools copy around:
vaults:
- name: "Photos"
key_file: "/etc/meshhold/photos.key" # the vault's key: 64 lowercase hex characters
storage_path: "/var/lib/meshhold/photos"
type: "storage"
# The four sync directions are on unless set; a folder that receives
# files keeps every file of the vault, whatever the factor says.
receive_deletions: false # a photo deleted elsewhere stays here
keep_period_days: 365 # keep deleted photos' bytes for a year
Restart the daemon after editing it. The file says nothing about how many
copies to keep: that is the vault's replication factor, which every device
goes by, and a vault declared this way starts on the default of 3 until
somebody chooses. Set the 2 from step 2 with meshhold vault
replication-factor <vault_id> 2 on the VPS, or under Replication factor
in Vault info on any device. The VPS and the desktop each keep every
photo — their folders receive files — so both count toward the factor of 2;
the phone sends its photos and streams anything else you scroll to without
keeping it.
Sync all now
The periodic passes only look at what changed. Sync all now, in the
header of the vault's file list (or meshhold vault sync <vault_id>), runs
one full pass over this device's folder under its sync directions:
receive the files missing here, apply the vault's deletions — old ones
included — then send what is new here. It never sends an old deletion made
here. Use it after turning a switch on, when you do want the past applied.
It says that it started, or why it is paused: the phone is in the
background, replication is set to Wi-Fi only on a metered network, the
vault waits for Start, or the folder cannot be reached.
6. Look at the photographs
Open Vaults → Photos and switch the view to the gallery — the third button next to the table and grid icons. It is a view of the vault, not a separate app: nothing to install, no second index, no import step.
The gallery reads each picture's own EXIF on the node that holds it, so it groups by the day the shutter fired rather than by the file's modification time — which for a photograph is usually the day it was copied off the phone, and would file a whole holiday under "today". Pictures that carry no date collect in an Undated section that says whether they are genuinely undated or simply not read yet.
It is recursive from wherever you are, so you never walk into 2019/08/,
and the folder structure is still available as a grouping if you organised
your pictures deliberately. Tile size, grouping and sort are per-device.
Press and hold a picture — or Ctrl-click on a desktop — to start selecting; then drag across tiles, Shift-click for a run, or tick a whole day from its heading. The bar that appears can download the selection as a single zip, move or copy it into another folder, or delete it. A deletion can be undone from the file's history for the keep period (step 5), and the confirmation says so.
Two things it will not do. A HEIC from an iPhone or a raw file from a camera shows as an icon: there is no decoder for either in a build that ships without cgo, though the date and the place are still read. And there is no grouping by place name and no map, because both would mean sending the coordinates of your own photographs to somebody else's service — the coordinates are shown in a picture's details panel and stay on your machines.
On a television the same gallery is driveable with the remote, with larger tiles by default.
7. Optional: turn on the media player
The music / video library and player are off by default — a fresh node is infrastructure, not a media server. To browse a vault as a media library and stream from it, turn the feature on for that node in Profile → Settings → Media library. The Player tab then appears in the navigation. It's a per-node switch: leave it off on headless servers that only store and replicate, turn it on where you actually watch and listen.
Troubleshooting
Nodes don't see each other
- Check the swarm-key matches on both —
meshhold keygenoutput, exactly. - Open UDP
7777(QUIC) and TCP7778(the fallback for networks that block UDP) in the VPS firewall. - Point the second node at the VPS directly: run
meshhold node shareon the VPS, thenmeshhold node connect '<the invite it printed>'on the second node. (bootstrap_peersinconfig.yamlonly seeds a brand-new node; once a node has joined a network it no longer reads it.)
Phone keeps going offline
In the background (unless it is charging on Wi-Fi, or something holds it — music playing, a call, the VPN, a port forward, a file transfer, a file being read) a phone does not stay connected to every node: it keeps one quiet connection, to its home node, and the rest of the mesh reaches it — and sees it present — through that node. Choose the home on the phone: open Network, pick the VPS (or the desktop), and choose Make home node from its menu. With none chosen, or the home not answering, the phone takes the first node that answers whose device type is Always online or Backup server.
The phone's power row (Profile → Network → Status) says where it stands: Standby via … names the node holding it; Deep means it holds no connection — no network, or no node answered — and it tries again after 1, 2, 5 and 15 minutes, then every 30, and at once when the network comes back or you open the app.
If it vanishes altogether, it is battery optimisation. In Android settings, mark MeshHold as unrestricted (and add it to any OEM "protected apps" list) so the background daemon's foreground service isn't killed — that service is what keeps chat and call notifications arriving while the screen is off.
RF stuck at 1
Open the vault's menu → Replication info. If only one node whose copies count is online, RF can't climb: a phone's copy never counts. Bring up the second Always online node, or set a third device's type to Always online in its Profile → Settings → Device type.
A file "cannot be stored here"
A file keeps its name on every device: nothing renames it to fit another
operating system, because whatever names it elsewhere — a project, a script,
a document — would stop finding it. So a file named on Linux as a:b.txt,
notes. or CON.txt does not appear in a Windows folder: Windows does not
allow those names. The folder's status says how many such files there are,
and the file list marks each one with the reason. The vault keeps the file,
and the app opens and downloads it as usual. Rename it, on any device, to a
name this device allows and it lands in the folder on the next pass.
Windows (and macOS, and a phone's storage) also takes Photo.jpg and
photo.jpg for the same name, which a Linux folder holds side by side. Such
a pair is one file in the folder: the one already there stays, and when
neither is, the one the vault had first lands; the other is marked "cannot be
stored here" with the name of the one that has its place. The same goes for
two folders, Photos and photos. Rename or delete either file, on any
device, and the other lands.
Next up
Add a chat vault for your household (see The Secure Comms Hub),
or expose Photos over S3 to back up your Immich instance (see
The S3-compatible Backend).