Self-hosted Postgres, with the ergonomics of a managed service.
oddk runs Postgres on your Linux server: tuned instances, offsite snapshots and health alerts. One archive and one key rebuild the whole deployment.
Linux · Docker · systemd Install details
curl -fsSL https://oddk.dev/install | sh

Fig. 1 — Provisioning
One command
to a live database.
Pick cores, memory and a port. oddk pulls the image and generates a password, then waits for Postgres to answer. If startup fails, it rolls back the container and volume.
$ oddk create --name app --version 18 \ --port 5432 --cpu 4 --ram 8 # pulls postgres:18 if missing, then: Created RDBMS instance: app PostgreSQL version: 18 Port: 5432 CPU Cores: 4 RAM: 8192 MB Status: running Password: •••••••••••• Connection string: postgresql://postgres:••••@10.88.0.1:5432/postgres?sslmode=disable
Defaults sized to your instance
Memory and worker settings scale with the RAM and cores you assign. Named parameter groups let you tune further. One apply changes the group, cores, memory or port: it checks the host's capacity, the port and shared memory before replacing the container, and rolls back to the previous configuration if startup fails. See the defaults and change a parameter group →
Fig. 2 — Backups
The whole deployment,
in one archive.
Every instance's data and oddk's configuration, captured on a schedule and copied offsite. Restore one database, one instance, or the whole host. See Fig. 4.
$ oddk snapshot setup-cron --utc-hour 3 \ --interval-hours 6 --cleanup-remote-days 30 # 03, 09, 15, 21 UTC: capture, upload, prune $ oddk snapshot make --comment "before upgrade" # all instances + config, verified $ oddk snapshot list # archive IDs, sizes and copy locations $ oddk snapshot verify --all --deep # re-read every copy, local and S3 $ oddk snapshot restore-database \ --instance app --database sales \ --id 7 --restore-as sales_copy # a new database; the instance keeps serving
Running instances use pg_basebackup; stopped ones use a cold file copy.
Settings, ACLs and collations survive. Use --logical to cross CPU architectures.
Daily or every few hours: capture, upload, retry earlier failed uploads, then prune. A failed phase does not stop the phases after it.
Automatic uploads to your S3 bucket or S3-compatible endpoint. With offsite configured, failed uploads keep their local copy past retention for retry.
Local and offsite retention keep at least the newest 2 archives. The newest complete archive is kept longer.
Every archive is encrypted with age, using a post-quantum hybrid key
(ML-KEM-768 + X25519) derived from your master key. Without the key, an archive reveals
nothing about its contents, not even instance names. Keep the key off the host: no archive can be restored
without it.
Archives are read back in full before being catalogued, and verified again after
download and before restore. A corrupt archive is refused. Each archive's SHA-256 is
recorded, so an intact copy that is not the one this host wrote is refused too.
oddk snapshot verify re-reads stored copies on demand and exits non-zero on
any problem, so it can run from cron.
Fig. 3 — Health checks & alerting
Degraded health or a failed run
sends you a message.
Health failures, failed scheduled runs and paused schedules reach you through email, Slack, Telegram or a webhook. Each message explains what broke and what it means.
Checks and thresholds
Connection probes every 70 seconds. Missing containers fail their probes;
instances in error are reported broken.
Below 1 GB free disk or above 95% CPU load counts as unhealthy. Both thresholds are adjustable; the degraded alert includes host failures.
oddk checklist audits instance health, snapshot coverage, schedules,
stored copies and notification configuration in one screen.
Alerts and their triggers
After 3 consecutive failed health checks. One message per transition, so an
instance parked in error alerts once rather than every 70 seconds.
Any scheduled snapshot or backup ending with a failed phase. Names every failed phase and its recorded cause.
A clean run after a failed one, and health returning after 2 consecutive good checks. A clean run after a clean run sends nothing.
A schedule left paused by snapshot apply reminds you daily, and once
at daemon start, until it is resumed or removed. See Fig. 4.
Health alerts get 3 attempts per channel. Delivery failures never fail the task being reported. Set up a channel before relying on the schedule. Configure and test notifications →
The scheduled snapshot for the whole deployment did not complete cleanly. capture: the archive was written but 1 of 3 instance(s) could not be captured and hold NO database contents in it: billing (base backup: pg_basebackup failed with status 1: … No space left on device …) AN ARCHIVE WAS PRODUCED, but it is NOT a complete capture: the instance(s) named above hold NO database contents in it and would restore as EMPTY clusters. It was still kept, uploaded and catalogued, because it remains the newest restore point for every other instance. Run 'oddk checklist' to see which instances are covered. See 'oddk cron logs' for the full run history, or the daemon log for detail.
The body says which of these happened, because each needs a different response: no archive was produced, the archive is incomplete, or the archive is fine but could not be shipped or pruned.
Fig. 4 — Recovery procedure
Rebuilding a host
that no longer exists.
It needs the archive and the master key, and runs locally against the data directory with the daemon stopped, so it works even where the daemon cannot start.
Preflight, key first
A wrong key is refused first, naming the key the archive needs. Then the archive, locales and ports are checked, and an instance recorded larger than this host is sized to fit it, before existing oddk state is changed.
Images pulled before anything destructive
Missing Postgres images are pulled before configuration is installed.
Clusters restored and proven
Each restored cluster must start successfully. Instances captured stopped are stopped again after verification.
Schedules restored paused
Restored schedules stay paused until you confirm this host owns its offsite destination. A rehearsal must not prune production's backups.
# no daemon running; apply does not need one $ sudo -u oddk oddk snapshot apply \ --file /mnt/restore/snapshot.tar.zst.age \ --master-key /mnt/restore/master.key # output trimmed Preflight: ✓ Master key opens the snapshot (key 3f9a1c07) ✓ Daemon is not running ✓ Target deployment is empty ✓ Master key decrypts instance credentials ✓ Host can run the recorded instance sizes # … remaining checks; confirm to continue Installing configuration... ✓ master.key installed ✓ oddk.db installed (2 instances) # … clusters restored and verified Snapshot applied. ⚠️ SCHEDULES ARE PAUSED: snapshot schedule. # resume once this host owns its bucket: # oddk snapshot setup-cron --resume
Fig. 5 — Buy or run
You already have
a server.
Owned or rented, any size. Managed Postgres sells failover, elasticity and a platform around the database. Before paying for them, ask how much of that you would use:
- Can you run a few commands if the server dies? Failover keeps a standby running all year so the database comes back on its own. oddk rebuilds a lost host from one archive and one key. If your service can wait for that, use oddk. See Fig. 4.
- Does Postgres fit on your server? Elastic scaling is for load that
swings far past one machine. If yours has the cores and memory, oddk sizes Postgres to
them, and one
instance applyresizes it when that changes. See Fig. 1. - Do you need a platform, or a database? Branching, auth and realtime
APIs come bundled with some services. If your application needs Postgres, oddk runs the
official images, and compatible ones such as
pgvectorandpostgis. - You already run the server. Your application's host is yours to patch and watch either way. oddk puts Postgres on it with scheduled snapshots, offsite copies and alerts, instead of adding another service. See Fig. 3.
If you need automatic failover or replicas, oddk is the wrong tool. Fig. 6 lists what it will not do.
Fig. 6 — Out of scope
Deliberate limits.
If you need any of these, oddk is the wrong choice, and will stay so.
Install with
one command.
Updating is the same command.
curl -fsSL https://oddk.dev/install | sh