When managing multiple servers and deploying applications, it’s crucial to have a streamlined system that simplifies server management and deployment workflows. Coolify is a powerful, self-hosted platform that allows you to deploy applications with minimal setup. In this guide, we’ll walk through the steps to connect a new server to your Coolify instance and set it up for seamless application deployment. Whether you're using a VPS provider like Hetzner or DigitalOcean, this guide will help you configure secure SSH access, set up key authentication, and validate the server with Coolify for future deployments.
By the end of this tutorial, you’ll have everything in place to deploy your solutions to a newly connected server with ease.
Prerequisites
- Server A: Running a Coolify instance for managing deployments.
- Server B: A VPS with SSH access via port 22 (e.g., from Hetzner).
Step 1: Purchase and Set Up Server B
Purchase Server B from your preferred VPS provider (e.g., Hetzner, DigitalOcean).
Make sure Server B is up and running. You can access it using SSH:
ssh root@your-server-ip
Note: Ensure port 22 is open to enable SSH access.
- [Optional]: Update and secure Server B by running:
sudo apt update && sudo apt upgrade -y
Step 2: Generate RSA SSH Key in Coolify
On Server A, open Coolify and navigate to Keys and Tokens in the side menu.
Click Add to create a new SSH key.
Select Generate new RSA SSH Key. Coolify will create the key for you.
Copy the Public Key that was generated, and then click Continue.
Step 3: Add the Public Key to Server B
- On Server B, navigate to the
.ssh
directory:
cd ~/.ssh/
- Open the
authorized_keys
file with a text editor (e.g.,nano
):
sudo nano authorized_keys
Paste the Public Key you copied earlier at the bottom of the file.
Save the file with
Ctrl + O
, pressEnter
, and exit withCtrl + X
.
Verification: After adding the key, try logging into Server B again using SSH:
ssh root@your-server-ip
If you log in without being prompted for a password, the key was added successfully.
Step 4: Add Server B to Coolify
Return to Coolify on Server A, and navigate to Servers.
Click Add, and provide the following information:
- Name: A descriptive name for Server B.
- IP Address/Domain: The public IP or domain of Server B.
- Private Key: Select the RSA key generated earlier.
- Username: Set to root
, unless you’ve changed the default username.
After filling in the details, click Continue.
On the next screen, click Validate Server & Install Docker Engine to complete the setup.
Next Steps
Now that you’ve added Server B to Coolify, you can start deploying applications or Docker containers. Enjoy!
Top comments (0)