<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Hetzner on Jafforge Blog</title><link>http://jafforge.com/tags/hetzner/</link><description>Recent content in Hetzner on Jafforge Blog</description><generator>Hugo -- 0.146.0</generator><language>en-us</language><lastBuildDate>Mon, 09 Jun 2025 21:53:26 +0200</lastBuildDate><atom:link href="http://jafforge.com/tags/hetzner/index.xml" rel="self" type="application/rss+xml"/><item><title>Coolify on Hetzner</title><link>http://jafforge.com/posts/coolify/</link><pubDate>Mon, 09 Jun 2025 21:53:26 +0200</pubDate><guid>http://jafforge.com/posts/coolify/</guid><description>A step-by-step walkthrough for setting up Coolify on a Hetzner VPS so you can self-host a blog, databases, n8n, and AI agents on a single server.</description><content:encoded><![CDATA[<p>I’ve recently been getting deeper into backend development and cross-platform mobile using Kotlin Multiplatform. On the side, I’ve been playing with tools like n8n, setting up databases, and building small AI agents and automation workflows. Pretty quickly, I realized I needed a solid self-hosting setup where I could run everything, from simple web apps to AI agents, and backend services, without relying on multiple different platforms. I used Heroku and Vercel before, but for someone mostly working on hobby projects, their pricing and limitations didn’t make much sense long-term.</p>
<p>That&rsquo;s when I found <a href="https://coolify.io">Coolify</a> and set it up on a Hetzner VPS - simple, powerful, and fully under my control. Technically, you could host all of this on something like a Raspberry Pi, an old laptop, or whatever, but for now, let&rsquo;s keep it on Hetzner.</p>
<p>So, let’s dive into the setup process.</p>
<h3 id="hetzner">Hetzner</h3>
<p>As I already said, for our server we will use a Hetzner VPS, this one in particular:</p>
<p><img alt="Hetzner" loading="lazy" src="/posts/coolify/vps.png"></p>
<p>As you can see, it is a VPS with 4 vCPU, 8 GB RAM, and 80 GB SSD with 20 TB traffic included. This is more than enough for my needs. There are even cheaper options like CX11 starting from 4€ per month, but I think this is a good balance between price and performance. After you choose your machine, Linux version, and location, we can proceed. I chose Ubuntu 24.04 (latest) and Helsinki as the location.</p>
<h3 id="vps-setup">VPS Setup</h3>
<p>Once my Hetzner VPS was up, I connected via SSH using the root user. The first thing I did was update all system packages to ensure everything was up to date:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo apt update <span style="color:#f92672">&amp;&amp;</span> sudo apt upgrade -y
</span></span></code></pre></div><p>Since I am not a Linux expert at all, I did some Googling and getting guidance from ChatGPT and found some best practices to secure my machine. First, I changed the default SSH port and disabled root login so I am only able to access my server via SSH.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo nano /etc/ssh/sshd_config
</span></span></code></pre></div><p>And changed the following lines:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>Port <span style="color:#75715e">#Some random port above 1024</span>
</span></span><span style="display:flex;"><span>PermitRootLogin prohibit-password
</span></span></code></pre></div><p>After that, I restarted the SSH service:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo systemctl restart sshd
</span></span></code></pre></div><p>There are other things I could do, like creating a new user and adding it to the sudo group, but for now, I think this setup is enough. Anyway, I have snapshots enabled so I can always restore my system to a previous state if something goes wrong. For now, we can say that we are ready to install Coolify. There&rsquo;s also a great firewall built into the Hetzner console where you can open any port needed. I skipped setting up UFW directly on the Linux machine and instead, I am using the one integrated in the Hetzner console. I guess two firewalls would be overkill for now.</p>
<h3 id="coolify-setup">Coolify Setup</h3>
<p>Run this in the terminal:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
</span></span></code></pre></div><p>This is how it will look after installation:</p>
<p><img alt="Coolify" loading="lazy" src="/posts/coolify/coolify_congratulation.png"></p>
<p>After that, you need to follow the onboarding steps and create an admin user, and then you can access Coolify at <code>http://&lt;your-server-ip&gt;:8080</code></p>
<p><img alt="Coolify" loading="lazy" src="/posts/coolify/coolify_dashboard.png"></p>
<p>Now for the sake of not breaking anything, I used a neat feature of Hetzner to create a snapshot backup that I can restore anytime:</p>
<p><img alt="Hetzner" loading="lazy" src="/posts/coolify/snapshot_backup.png"></p>
<p>P.S. I also added a custom domain to Coolify and enabled 2FA (I am really surprised that they have 2FA available for free). Also, Coolify is handling free SSL certificates for your domain and automatically renewing them.</p>
<p>Basically, to add a custom domain, you just need to add it in Coolify under Settings/Instance Settings/Instance Domain and adjust your DNS records to point to your server IP, depending on your domain registrar.</p>
<p>Add an A record pointing to your VPS IP and, optionally, a CNAME if you&rsquo;re using subdomains.</p>
<p><img alt="Coolify" loading="lazy" src="/posts/coolify/custom_domain.png"></p>
<p>After that, you can access Coolify at <code>https://yourdomain</code></p>
<p>That’s it Coolify is up and running, and you’re ready to start deploying projects. If you&rsquo;re thinking about self-hosting your own apps, I highly recommend trying this setup.</p>
<h3 id="benefits">Benefits</h3>
<p>One of the things I really like about Coolify is how easy it is to connect it with GitHub. I set it up so this blog gets automatically deployed every time I push to the main branch.</p>
<p>Right now, I have all of this running at the same time on the same server:</p>
<ul>
<li>
<p>This blog (Hugo static site)</p>
</li>
<li>
<p>An n8n instance</p>
</li>
<li>
<p>A backend app built with Spring Boot</p>
</li>
<li>
<p>A Postgres database</p>
</li>
</ul>
<p>So in summary, Coolify gives you:</p>
<ul>
<li>
<p>Push-to-deploy workflows for your code</p>
</li>
<li>
<p>Instant-ready runtimes for a wide range of languages and frameworks</p>
</li>
<li>
<p>One-click apps + managed databases</p>
</li>
</ul>
<p>It’s genuinely everything you need for a modern self-hosted PaaS.</p>
<p>That’s all for now. I’ll keep sharing more as I continue building, experimenting, and learning new things along the way. Whether it&rsquo;s another backend app, some automation with AI, or just a fun side project, I plan to document it here. Until the next cool thing, thanks for reading and see you in the next post!</p>
]]></content:encoded></item></channel></rss>