Connect Your Server to Coolify: A Comprehensive Guide

Connecting your server to Coolify is the foundational step to managing your applications and services efficiently. Whether you are utilizing a local machine for development or a robust remote server for production, Coolify offers seamless integration. This guide will walk you through the essentials of connecting your server to Coolify, ensuring you meet all prerequisites and understand the different connection types available.

Understanding Server Connection in Coolify

Coolify’s power lies in its ability to orchestrate and manage applications across various server environments. Connecting a server to Coolify allows you to deploy applications, manage databases, and monitor resources from a centralized dashboard. This connection is crucial for streamlining your workflow and maximizing efficiency, regardless of your server setup.

Prerequisites for Connecting a Server

Before you begin connecting your server, ensure the following requirements are met:

SSH Connectivity

Secure Shell (SSH) connectivity is paramount for Coolify to communicate with and manage your server. This connection must be established using SSH key authentication for enhanced security.

Tip: Your public SSH key needs to be added to the ~/.ssh/authorized_keys file of the root user on your server. If you don’t have an SSH key pair, Coolify can generate one for you with a simple click. Alternatively, you can generate one manually using tools like ssh-keygen.

Docker Engine (24+)

Coolify relies on Docker Engine to containerize and manage applications. Ensure that Docker Engine version 24 or later is installed and running on the server you intend to connect. Docker provides the necessary environment for Coolify to deploy and manage applications consistently across different servers.

Types of Server Connections

Coolify supports different types of server connections to accommodate various user needs and environments:

Localhost Connection

Connecting to localhost refers to managing the server where Coolify itself is installed. This setup can be convenient for experimentation and development.

To manage the localhost server, Coolify’s Docker container needs to be able to reach the host server via SSH. While using localhost as a server for all your resources is possible, it’s generally not recommended for production environments. High server usage from applications can impact Coolify’s performance and accessibility.

Tip: For production deployments, consider using Coolify Cloud. This hosted version eliminates the need to manage the Coolify instance itself, allowing you to focus solely on your application servers. Coolify Cloud also includes additional benefits like free email notifications and S3 storage, depending on your subscription.

Remote Server Connection

Coolify’s flexibility extends to connecting to remote servers. This can be any Linux server, from a Virtual Private Server (VPS) to a Raspberry Pi or even a Linux-based laptop. This option is ideal for deploying applications in dedicated environments separate from your Coolify instance.

Tip: If you are looking for a server provider, Hetzner is a recommended option. Using the referral link supports the Coolify project, helping to sustain its development and maintenance.

Cloudflare Tunnels

For enhanced security and accessibility, Coolify supports the use of Cloudflare Tunnels for server connections. Cloudflare Tunnels provide a secure way to connect to your servers without exposing them directly to the internet.

Tip: Coolify does not automatically install cloudflared on your server. You need to install and configure Cloudflare Tunnel on your server beforehand. Coolify then configures the necessary ProxyCommand (ProxyCommand <ip hostname=""> access ssh --hostname %h</ip>) to establish SSH connections through the Cloudflare Tunnel.

Key Features After Server Connection

Once your server is connected to Coolify, you can leverage several features to optimize your server and application management:

Disk Cleanup Threshold

Coolify offers automated disk cleanup to manage server storage efficiently. You can configure a disk cleanup threshold to automatically remove unused Docker images and containers when disk space falls below a certain level. More details can be found in the Automated Cleanup documentation.

Wildcard Domain

Setting up a wildcard domain for your server simplifies application access. By defining a wildcard domain (e.g., example.com), Coolify can automatically generate Fully Qualified Domain Names (FQDNs) for your applications.

For instance, if your application’s UUID is vgsco4o and your wildcard domain is example.com, Coolify will generate vgsco4o.example.com as the application’s FQDN.

If no wildcard domain is set, Coolify intelligently uses sslip.io to provide a free and universally accessible domain. In this case, the FQDN would be vgsco4o.127.0.0.1.sslip.io, where 127.0.0.1 is your server’s IP address.

Proxy Configuration

Coolify provides flexible proxy options to manage traffic to your applications:

Traefik

By default, Coolify utilizes Traefik (v2) as a reverse proxy. Traefik is automatically configured based on your deployed resources, simplifying routing and SSL certificate management.

Tip: Traefik will only start if you haven’t selected a custom proxy for your server and you have configured a domain for a resource or your Coolify instance.

Custom/None

For advanced users who require specific proxy configurations, Coolify offers the Custom/None option. This allows you to manually configure your own proxy solution.

Tip: Future updates will include automated configuration support for Nginx and Caddy, further expanding proxy options within Coolify.

Dynamic Configuration

Coolify’s user interface provides a dedicated section for dynamic proxy configuration. You can access these settings at /server/<server_uuid>/proxy within your Coolify dashboard. This allows you to fine-tune proxy settings and add custom configurations as needed.

Connecting your server to Coolify is a straightforward process that unlocks a range of powerful features for application management and deployment. By following this guide and understanding the available options, you can seamlessly integrate your servers with Coolify and streamline your development and deployment workflows.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *