Change Localhost Key
This guide will show you how to replace the stored localhost private key for Coolify.
Key deletion from database
In the Postgres database in which the data for Coolify is stored, there is a private_keys table. This table contains the private keys for all servers connected to the Coolify instance. Be careful to not accidentally delete the wrong keys, as there usually is no way to undo.
-
Navigate to the private_keys table in the Postgres database for Coolify
- Said table is located under the public schema in the database.
-
Select the row that is marked with:
- Row index and ID of 0, as well as the name of “localhost’s key”
-
Delete the selected row from the database
- If completed successfully, proceed to the next section.
Installing new keys in the host machine
After the key has been deleted from the database, you need to add the new keys into the correct place in the Coolify data folders.
-
Stop your Coolify instance completely.
-
Find the /ssh/keys directory for your Coolify installation.
- Usually located in /data/ssh/keys if you followed the quick install.
-
Write the public and private keys to the correct files
- Your ED25519 public key shall be stored in [email protected]
- Your ED25519 private key shall be stored in [email protected]
-
Start your Coolify instance
- Coolify will now proceed to seed your keys to the Postgres database.
- Make sure the Database\Seeders\PopulateSshKeysDirectorySeeder does not error.