Can't Restore Coolify Backup Without the SSH Key? Here's What I Did
Sadeq Sheikhi
Lost your original Coolify SSH key and can't restore your backup? Here's how I recovered 20+ services by going directly to the database.
I moved to a new server. I had a Coolify backup. I had my database backed up to Cloudflare R2.
What I didn't have was the private SSH key from the original Coolify installation. Without it, Coolify couldn't decrypt the backup and restore my deployment configuration — all the services, environment variables, domains, and database connections I'd set up over months.
The restore failed. Here's how I recovered without starting from scratch.
What Coolify Backups Actually Contain
Coolify's backup exports the state of its own internal database — the services you've configured, your app definitions, environment variables, domains, and so on. This data is tied to the SSH key that was generated during the original Coolify installation.
If you don't have that key, the backup is encrypted content you can't access through Coolify's restore interface.
What you can do is access the raw backup data directly.
The Recovery Approach
Coolify uses PostgreSQL internally to store its configuration. When you export a backup, that backup is essentially a dump of the Coolify internal database.
Instead of trying to restore through Coolify's UI, I connected directly to the backup database and queried it manually to extract what I needed.
The steps:
1. Spin up a temporary PostgreSQL container
docker run --name coolify-recovery \
-e POSTGRES_PASSWORD=recovery \
-p 5433:5432 \
-d postgres:152. Load the backup into it
cat coolify-backup.sql | docker exec -i coolify-recovery \
psql -U postgres3. Query what you need
The tables I cared about most were the applications, services, and environment variables tables. Once the backup was loaded I could query them directly:
-- Get all applications with their domains
SELECT name, fqdn, git_repository, git_branch FROM applications;
-- Get environment variables per application
SELECT application_id, key, value FROM environment_variables;
-- Get services
SELECT name, type FROM services;This gave me a complete picture of everything I'd configured — without needing the original key.
4. Rebuild in Coolify manually
With the full list of services, their environment variables, domains, and configurations in front of me, I rebuilt everything in a fresh Coolify installation. It wasn't instant, but it wasn't guesswork either. I had the exact values I needed.
What This Actually Took
Rebuilding ~20 services manually is tedious but manageable when you have the source data. The hardest part was not the technical work — it was accepting that the automated restore wasn't going to work and switching to the manual approach quickly instead of spending hours trying to force the restore to work.
Total recovery time from fresh server to everything live: one day.
What I Do Differently Now
Save the SSH key. Coolify generates a key pair during setup, stored in /data/coolify/ssh/keys/. Back it up immediately and store it somewhere you'll actually have access to.
Test the restore before you need it. I hadn't tested my backup restore on a fresh server before. Now I have a recovery runbook and I know it works.
Back up Coolify's internal database separately. Backing up your application data is not the same as backing up Coolify's configuration. They're different things and both matter.
The Short Version
If you're stuck in the same situation:
- Don't waste time trying to force the encrypted restore
- Load the backup SQL into a temporary Postgres container
- Query the tables directly to extract your service configs and environment variables
- Rebuild manually in a fresh Coolify install with the extracted data
It's more work than a one-click restore. But it works — and it's faster than starting from memory.
Hi, Im a seniour software engineer building web platforms. I write about Nuxt, Typescript, DevOps, AI and engineering decisions behind real products, based on my real experience.