Coolify is quickly becoming the go-to open-source platform for developers and tech enthusiasts who want to simplify web hosting. Imagine deploying web applications, databases, and services like WordPress, Grafana, or even game servers, all without wrestling with complex server configurations. If you're looking for a user-friendly alternative to traditional server management, Coolify is your answer.
This tutorial will guide you through installing and configuring Coolify on a Hetzner Cloud Server running Ubuntu. Whether you're a seasoned developer or just starting, these step-by-step instructions will have you up and running in no time. Plus, these steps are generally applicable to most Linux distributions supported by Coolify, making this guide a valuable resource for various setups.
Get Your Coolify Server Ready with Hetzner
Before we dive into the installation, let's ensure you have everything prepared. Here's what you'll need:
1. A Fresh Ubuntu Server on Hetzner Cloud
- Recommended Ubuntu Version: Ubuntu 22.04 or 20.04 (64-bit, AMD64 or ARM64 architecture). These versions are known for their stability and compatibility.
- Server Resources: For optimal Coolify performance, aim for a Hetzner Cloud Server with at least 2 vCPUs, 2 GB of RAM, and 30 GB of storage. Hetzner's
are perfect for this, offering a balance of performance and cost-effectiveness.server offerings - Root Access: You'll need root user privileges or the ability to use
sudo
commands to install software and configure your server.
2. Secure Server Access
- SSH Key (Strongly Recommended): Enhance your server's security by using an SSH key for access. This is a best practice for any Linux server.
3. Custom Domain (Optional, but Highly Recommended for HTTPS)
- Domain Name: If you plan to enable HTTPS and access Coolify with a proper domain (like
yourdomain.com
), you'll need a registered domain name and access to manage its DNS records.
Step-by-Step: Installing Coolify on Your Hetzner Ubuntu Server
Let's get Coolify installed! Follow these steps carefully to set up your self-hosting platform.
Step 1: Connect to Your Ubuntu Server and Prepare the System
-
Log in as Root or Elevate Privileges:
Open your terminal and connect to your Hetzner server via SSH as root. If you're logged in as a non-root user with
sudo
privileges, switch to the root user for easier command execution:Bashsudo -i
-
Update Your Ubuntu Packages:
Start with updating your server's package lists and upgrading existing packages. This ensures you have the latest software versions and security patches:
Bashapt update && apt dist-upgrade -y
-
Install
curl
:curl
is a command-line tool used to transfer data with URLs. Coolify's installation script relies oncurl
. Check if it's installed; if not, install it:Bashapt install curl -y
Tip: Regularly updating your server is crucial for maintaining system security and stability. It's a simple habit that can prevent many potential issues down the line.
Step 2: Execute the Coolify Installation Script
Installing Coolify is incredibly simple thanks to the official installation script.
-
Run the Installation Command:
Execute the following command in your terminal. This command downloads and runs the Coolify installation script directly from Coolify's CDN:
Bashcurl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
-
Verify Successful Installation:
Once the script completes, you should see a success message in your terminal similar to this:
Congratulations, Your Coolify instance is ready to use. Please visit http://YOUR_SERVER_IP:8000 to get started.
This message confirms that Coolify services are now installed and running on your Hetzner server!
Step 3: Create Your Coolify Account
Now that Coolify is installed, let's set up your admin account.
-
Access the Coolify Dashboard:
Open your web browser and navigate to the following URL, replacing
YOUR_SERVER_IP
with the actual public IP address of your Hetzner server:http://YOUR_SERVER_IP:8000
For example:
http://203.0.113.1:8000
-
Register Your Account:
On the Coolify dashboard, you'll be prompted to register a new account. Enter your preferred email address and a strong, secure password. Remember these credentials – you'll use them to log in and manage your Coolify platform.
Step 4: (Optional but Recommended) Configure Your Domain and HTTPS for Secure Access
For production environments and secure access, configuring a domain name with HTTPS is highly recommended.
-
Configure DNS Records at Your Domain Registrar:
Log in to your domain registrar's control panel (e.g., GoDaddy, Namecheap, Cloudflare). You need to create two
A
records that point to your Hetzner server's IP address:| Host | Record Type | Value | | :------------ | :---------- | :--------------------- | |
@
|A
|YOUR_SERVER_IP
| |*
|A
|YOUR_SERVER_IP
|- Replace
YOUR_SERVER_IP
with your server's actual IP address. @
represents your root domain (e.g.,example.com
).*
is a wildcard record, allowing all subdomains (likeapp.example.com
) to point to your server.
- Replace
-
Point Coolify to Your Domain:
- In the Coolify dashboard, go to Settings.
- Find the Instance Domain setting and enter your domain name (e.g.,
example.com
). - Coolify will automatically handle the SSL certificate setup using Let's Encrypt.
-
Wait for DNS Propagation and Access via HTTPS:
DNS propagation can take some time (usually a few minutes to a few hours). Once it's complete and the SSL certificate is issued, you should be able to access your Coolify dashboard securely via HTTPS at
https://yourdomain.com
.
Step 5: Enhance Security with Hetzner Cloud Firewall (Recommended for Hetzner Users)
Hetzner Cloud provides a built-in firewall feature that adds an extra layer of security to your server.
-
Access Hetzner Cloud Firewall:
Go to the Firewalls section in your
.Hetzner Cloud Console -
Create Inbound Firewall Rules:
Create inbound rules to allow traffic on the following ports:
- Port 22: For SSH access (essential for server management).
- Port 80: For HTTP (initially needed for Let's Encrypt SSL verification, can be closed later if only using HTTPS).
- Port 443: For HTTPS (secure web access).
-
Apply Firewall to Your Server:
Attach the newly created firewall configuration to your Ubuntu server within the Hetzner Cloud Console.
-
Disable UFW (Optional):
If you have UFW (Uncomplicated Firewall) enabled locally on your Ubuntu server and it's conflicting with the Hetzner Cloud Firewall, you might consider disabling UFW to avoid rule conflicts. However, for most setups, using just the Hetzner Cloud Firewall is sufficient.
Conclusion: Your Coolify Platform is Ready!
Congratulations! You have successfully installed Coolify on your Ubuntu server hosted on Hetzner Cloud. You've also secured it with HTTPS and a firewall. Now you have a powerful, user-friendly platform ready for deploying your web applications, databases, and various services.
Explore Coolify's Capabilities:
- Effortlessly Deploy Applications: Deploy containerized apps (Docker images), Node.js applications, static websites, and more with just a few clicks.
- One-Click Database Setup: Quickly set up databases like PostgreSQL, MySQL, MongoDB, and others without manual configuration.
- Real-time Monitoring and Scaling: Monitor logs, track resource usage, and easily scale your services as needed, all from the Coolify dashboard.
0 comments:
Post a Comment