Add SSH Keys to Hostinger for Passwordless Login & Deploys

Add SSH keys to Hostinger for passwordless login and deploys

Adding an SSH key to Hostinger lets you log in and deploy without typing a password every time — and it’s a hard requirement for any automated pipeline, since CI servers have no one to type a password. This guide shows you how to add SSH keys to Hostinger two ways (the hPanel importer and the command line), verify the key works, and wire it into a deploy.

Step 1 — Have a key pair ready

You need a key pair: a private key that stays on your machine and a public key (.pub) you give to Hostinger. If you don’t have one yet, follow our guide on how to generate an SSH key. In short:

ssh-keygen -t ed25519 -C "hostinger-deploy"

Then print the public key — this is the text you’ll paste into Hostinger:

cat ~/.ssh/id_ed25519.pub
# ssh-ed25519 AAAAC3NzaC1lZDI1... hostinger-deploy

Step 2a — Add the key via hPanel (easiest)

In hPanel, go to Advanced → SSH Access and find Manage SSH keys → Import SSH Key. Give it a label (e.g. “laptop” or “bitbucket-deploy”), paste the full contents of your .pub file into the key field, and save. Hostinger appends it to the account’s authorized_keys for you.

Step 2b — Add the key from the command line (ssh-copy-id)

If you’d rather not click through hPanel, and password login is currently enabled, ssh-copy-id installs the key in one command — just remember Hostinger’s port:

ssh-copy-id -p 65002 -i ~/.ssh/id_ed25519.pub [email protected]

Enter your account password once; from then on the key takes over. (If ssh-copy-id isn’t available, you can SSH in and paste the public key onto a new line in ~/.ssh/authorized_keys yourself.)

Step 3 — Test passwordless login

ssh -p 65002 -i ~/.ssh/id_ed25519 [email protected]

If you land on the server without a password prompt, the key works. To avoid retyping the port and key path, add a Host alias in ~/.ssh/config:

Host hostinger
  HostName 123.45.67.89
  User u123456789
  Port 65002
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes

Now ssh hostinger just works.

Using the key for automated deploys

For a CI/CD deploy, generate a dedicated deploy key (don’t reuse your personal key), add its public half to Hostinger as above, and give the private half to your CI provider as a secured SSH key — never commit it to the repo. In Bitbucket that’s Repository settings → Pipelines → SSH keys. The full walkthrough is in our guide on deploying to Hostinger with Bitbucket Pipelines.

Security tips

  • One key per machine/purpose. Separate keys for your laptop and each CI pipeline make it easy to revoke one without disrupting the others.
  • Passphrase your personal key (and load it into ssh-agent). Deploy keys used by CI are usually passphrase-less but tightly scoped.
  • Remove keys you no longer use from hPanel’s key list.
  • Never paste a private key into hPanel or a repo — only the .pub goes on the server.

Troubleshooting

  • Still asked for a password. The public key wasn’t saved correctly, or you’re offering a different key. Run ssh -v to see which key is sent, and confirm the key is listed in hPanel.
  • “Permission denied (publickey).” Wrong username, or the key pair doesn’t match. The public key on Hostinger must be the partner of the private key you connect with.
  • Works locally, fails in CI. The pipeline is using a different (or no) key. Add the deploy key under your CI provider’s SSH-keys setting and the host under known_hosts.

Frequently asked questions

How do I add an SSH key to Hostinger?

In hPanel go to Advanced → SSH Access → Manage SSH keys → Import SSH Key, then paste the contents of your public .pub file. Alternatively run ssh-copy-id -p 65002 -i ~/.ssh/id_ed25519.pub user@ip from your machine.

Which key do I give Hostinger — public or private?

Always the public key (the .pub file). The private key never leaves your machine (or your CI provider’s secure key store).

Do I need a separate key for deployments?

It’s best practice. Use a dedicated deploy key for CI so you can revoke it independently of your personal key, and store its private half in your CI provider’s SSH-keys feature rather than in the repository.

Previous