Setup guide
Set up a Postgres cluster that stays up.
Compare the recommended setups, then choose your system, how many computers and how they connect. You get the steps for that setup.
Recommended setups
Which setup should you pick?
How many computers you use decides what happens when one of them stops. Two computers and a witness suit most people; three computers suit data that really matters.
1 computer. Real Postgres with no second copy. If that computer stops, the database stops until it is back.
2 computers, no witness. It works and keeps a live, full copy, but nothing switches over when the main computer dies: two computers cannot out-vote each other. While both are up, you can move the main role yourself with coyote switch --to <node>. Add a witness to make switch-over automatic.
2 computers + a witness. Two full copies and automatic switch-over. The witness holds no data and only votes. It can be any small always-on device: a mini PC, a Raspberry Pi, an old laptop that stays plugged in and awake, or a cheap cloud server. It can run a different system from the data computers.
3 computers. Three full copies and automatic switch-over, with no witness needed. Even while one computer is down, a save still lands on two computers before it counts.
More than three. More than three computers is possible. Keep the total number of voting machines odd (data computers plus any witness), so there is always a clear majority.
Good practice for any setup
- Same system type for data computers. Data computers in one cluster must all be Windows, or all Linux, or all Mac with the same chip family. The witness and the apps that connect can be anything.
- Use computers that stay on. A laptop that sleeps is a poor cluster member. It is fine as a single node for development.
- A private network that always connects. Put the computers on a private network where they can always reach each other: Tailscale, Twingate, a site-to-site VPN (for example UniFi), or the same LAN. Nodes talk over one encrypted port.
- Not all on one power strip. If you can, avoid one power strip or one internet line for everything. A witness in a different place, or a small cloud server, means one power cut or one router failure cannot take out the majority.
- Steady links. Wired or solid Wi-Fi beats flaky links. The nodes check on each other all the time.
- Keep backups as well. Copies between nodes protect you from a dead computer, not from a deleted table: a mistake is copied to every node at once.
- Down to one data computer. With only one data computer left running, saves pause for about 30 seconds, then carry on with a clear warning until the other is back.
Step by step
Your setup, step by step.
The commands are the real ones. There is no public download yet, and so far CoyoteDB has been tested on macOS and Linux; Windows has not been tested yet.
Your steps
2 computers + witness on Linux
Add a "witness": a tiny helper that holds no data and only votes. Now switch-over happens on its own.
Install CoyoteDB on both Linux computers
CoyoteDB is one small app. Every computer that holds data runs Linux.
Connect them over Tailscale
Put every computer on the same tailnet, so they can reach each other. Nodes talk to each other over one encrypted port.
Start the first node
First computer
This downloads and runs PostgreSQL 18 for you.
$ coyote up $ coyote inviteJoin the second computer
Second computer
Paste the invite code from the first node.
$ coyote join <code>Add the witness
Witness machine (any system)
The witness holds no data and only votes. It can run on any system type.
$ coyote witness <code>Check that it is healthy
Any node
See which nodes are up and which one is the main node.
$ coyote statusPoint your app at it
Use any node’s address with the normal Postgres port. Each node passes you to the current main node.