Debugging Dan

Tech enthusiast, avid side project builder. 🚀

S02E03: Migrating to Coolify

last Wednesday at 9:09 PM, duration: 10:09

category: Podcast
/

S02E03: Migrating to Coolify

Migrating to Coolify

In this episode, I discuss my current journey of migrating my application from an old server to a new one. The decision was triggered by a price increase from my hosting provider, prompting me to seek better options. I’m moving to a new server with larger disk space and a more cost-effective plan. Additionally, I’m transitioning to Coolify, a self-hosting application that simplifies container management and automates many tasks. I’ve encountered challenges while adapting my previous methods to this new environment, but I’m excited about the potential for improved efficiency and better user interfaces for my applications using AI tools.

Stay connected! Follow me on Bluesky at @debuggingdan.com for the latest updates, and subscribe to my YouTube channel @debuggingdan for the podcast and other interesting videos!

My active side projects are:

  1. observalyze.com: Enhance user engagement, satisfaction, and overall experience for your application by applying Gamification
  2. teletron.me: Build personal dashboards. Visualize and make your most important information available at a glance. Your dashboards will be accessible, privacy-first, non-technical and available on multiple devices.
  3. datasthor.com: The hassle-free solution for seamless remote data storage for you or your application, making data management a breeze.
  4. supersave: Open Source: Bootstrap your project with a simple database abstraction and automatically generated REST API

Video

Transcript

Sure! Here’s the transcript grouped into neat paragraphs:


Hey, you're listening to the Debugging Dan podcast. This is season two, episode three. Today I will be talking about how I am currently busy migrating my current server to a new server. And I'll explain the reasons why, the price difference, and what I'm doing differently this time. So stay tuned.

All right, so the trigger for migrating my data from an old server to a new server is price. And maybe I should go back a little. So what I'm doing with my application, I'm self-hosting. So I'm not using Vercel or any other servers to host my applications. I have a virtual server somewhere. I bought somewhere a single server. It has enough CPU, enough disk, enough memory. And all the applications that I build, I deploy there and I run it there. And the current server that I'm using, I have it for like three years or something like that.

So recently I got a mail from the hosting provider saying, hey, we're going to raise your price because you're using one of our old offerings and it's costing us more money to keep that around. So we're raising your price. And for me, that was an indicator to look around and see, hey, if it's old, what's already here now then? What's new and what's different there?

And so the specs for the current server is I'm paying €12.70 and the price was going to be raised to €15.50 a month. I currently have six CPU cores, 16 gigabytes of RAM and 100 gigabyte disk. And the disk has been proving an issue in the past because downloading Docker images and some tests with video AI models, I found that the disk is filling up pretty fast. So I had to implement some strategies to clear up the disk often. And I even opted not to do AI models on the server itself because it was just getting too big.

The new server that I found is that the same hosting provider, it's Contabo. It's a German hosting provider, but they have locations all over the world. It's cheaper, it's 9.83, so €9.83 and that's a little bit lower than the monthly price because I prepaid it for six months since I figured it'll be around at least that amount of time. It has 12 gigabytes of RAM, so it has a little bit less RAM, but still enough. And the big thing for me is that it has a 300 gigabyte disk, so no problems crunching for disk space because that takes a lot of time and then I need to look up where the problems are, how I can fix it, depending on where the problem is.

So for me, having a bigger disk is a big advantage. And I'm currently in the process of migrating from the old server to the new server. And it's taking longer than I'd hoped, but that's because I'm also migrating to a different method of hosting. So what I did on the old server, I would just push a build and push Docker images to GitHub. I would download the images on the server and on the server, I would create a script that would start the new Docker container with the correct environment variables and it would bind a volume and a port to the host server. So each application would be listening to a specific port on the server on localhost. And then I would have a Caddy web server and a MySQL server, which were just installed natively, so not via Docker.

And I would then manually update the Caddy configuration with the host name and configure a proxy for Caddy to retrieve the data. And that worked pretty okay. I'm used to how it's working. I've been using it for a couple of years. So no real annoyances there, but I figured it could be easier and friendlier. And a colleague of mine last year, he got me on the track of using Coolify, which is a self-hosting application where you're able to manage everything via the web interface. And it utilizes Docker and it automatically configures the proxy and ports and SSL certificates and stuff like that.

Coolify adds a proxy and it automates the publishing of the running the Docker container volumes. It even has a catalog of applications that you can run out of the box. You can just configure them. And Coolify takes care of backups for databases, for example. So that's pretty cool. I've been working with it and it takes a while to learn the specifics. So in the beginning, I was trying to run one of my first Docker containers, a simple application, and I couldn't really figure out why it didn't work.

The first problem was, is that I was trying to replicate what I was doing originally, originally myself in Coolify. So I was spinning up images containers. I was exposing ports on localhost and then I couldn't really figure out why it wasn't working. And then later on, I found out that traffic, the proxy, has a function that if you add certain labels to Docker containers, you can just point traffic to say, hey, use the Docker connection. And then it just scans all the containers and sees, is there any Docker container with labels specific for traffic, then I will parse those labels and make it available.

And you can also customize those labels within Coolify. I found that later on. So now what I've learned is, I don't need to expose the ports to the host machine. I just tell Coolify, or I configure in Coolify, hey, this is this application, it has this port. And then instead of having the proxy connecting to the host machine, it just directly connects to the container. So that's pretty smart. I was impressed by that. And after that, I kind of got the ball rolling and I'm almost done now.

And I still need to do the difficult application. So I have my podcast. I use that with Castropod, which I host myself on podcast.debuggingden.com. But I don't want the detail pages that Castropod generates. I didn't like those. I wanted to expose those on www.debuggingden.com. So I have some rewrite rules. So now, using ZGPT and documentations, I'm learning how I can have specific paths and configure those in the Docker labels within Coolify to add some rewrites, redirects. And then I can do the latest, I should be able to do the latest applications.

Yeah. So it's been wrapping up. I haven't been programming for the last few weeks, also because I was on holiday last week. But I'm kind of missing it. I'm kind of missing cursor, using AI to generate stuff. During the migration, I've also been looking at the applications that I delivered earlier. So ObserverLize, DataStore, and other applications. And now that I haven't really worked with it for a while and see it again, I kind of also see that they look not really crap. But the UI is not that impressive. And I think that if I want to make a difference there, I should improve the UI and maybe also first dumb it down and then start again.

So with AI, that's possible because I can, for example, have a screenshot and ask Cursor, hey, using this screenshot, using my component library, can you replicate this in HTML? And so that should be easier and simpler and with what I've been generating now with DanCuts, for example, I just ask Cursor to generate a timeline component for me and it's pretty okay. And that's only using vanilla HTML. So hopefully that will help me in creating better applications and that will also make them more appealing to users to use those applications and to work with them.

So I need to stop using the stop word. So and but, I also say but a lot. But that was it for this time, busy migrating and let me know what you think. Leave a comment at YouTube, your favorite podcast app. You can reach out to me on Blue Sky. Have a good day. Bye.