====== Always Add SSH Keys via Coolify UI, Never Directly to Database ====== **Affects:** [[folkzone:services:coolify|Coolify]] ===== Fact ===== Coolify stores private keys encrypted using Laravel's encryption (''APP_KEY''). Inserting a raw private key directly into the ''private_keys'' table will result in: * "The payload is invalid" errors * "Call to a member function getPublicKey() on null" errors Always use **Settings → Private Keys → Add Private Key** in the Coolify web UI. ===== Also: corrupted key files ===== Coolify caches keys as files in ''/var/www/html/storage/app/ssh/keys/''. If these contain only ''b:0;'' (a corrupted serialized PHP value), delete them and let Coolify regenerate from the database: docker exec coolify ls /var/www/html/storage/app/ssh/keys/ docker exec coolify rm /var/www/html/storage/app/ssh/keys/id_coolify ===== See Also ===== * [[folkzone:troubleshooting:start|Homelab Troubleshooting Index]] * [[folkzone:troubleshooting:coolify_ssh_setup|Coolify SSH Key Setup]] * [[folkzone:services:coolify|Coolify]] * [[start|Return to wiki home]]