Configure OpenSSH

Coolify uses SSH to manage the servers connected to it.

Choose Localhost when configuring the server where a self-hosted Coolify instance is installed. Choose Remote server when preparing another Linux server for Coolify Cloud or self-hosted Coolify.


Choose the server

The official Coolify installation script normally installs OpenSSH and creates the localhost SSH connection. Choose Semi-automatic to configure OpenSSH before installing Coolify, or Manual if the localhost connection is missing or broken.

Keep your current server session open

Do not close your current SSH or console session until the localhost server connects successfully. You will need this session to correct the configuration if SSH access stops working.

Configure OpenSSH before installing Coolify

Use this method when you want to install and configure OpenSSH yourself, but want the Coolify installation script to create the localhost SSH key and dashboard connection.

Log in to the server

Login as root user using SSH or use the console provided by your hosting provider.

Install OpenSSH

Run the commands below based on your server's operating system.

apt-get update
apt-get install -y openssh-server
systemctl enable --now ssh

Configure key-based SSH access

Open the OpenSSH configuration file:

nano /etc/ssh/sshd_config

Find these settings and change them to the values below. Add them at the bottom if they are missing.

PubkeyAuthentication yes
PermitRootLogin prohibit-password

PermitRootLogin prohibit-password allows root to connect with an SSH key but prevents password-based SSH login.

Confirm your current SSH key works

Before restarting OpenSSH, make sure the public key used for your current root login is already in /root/.ssh/authorized_keys. Otherwise, keep the console open so you can restore access.

Check and restart OpenSSH

Check the configuration:

sshd -t

The command should return no output. If it reports an error, correct the file before continuing.

Restart OpenSSH with the command for the server's operating system:

systemctl restart ssh

Run the Coolify installation script

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

The script uses the OpenSSH service you configured, creates the localhost SSH key, authorizes it, and adds the localhost server to Coolify.

Confirm the localhost server is ready

  1. Open the Coolify dashboard.
  2. Select Servers.
  3. Open localhost.
  4. Confirm that the General page says Server is reachable and validated.

If localhost is not reachable, use the Manual tab.


Troubleshooting

On this page