Tutorial Deploy Phoenix 1.8 with Coolify on Hetzner

A comprehensive guide for deploying Phoenix 1.8 applications using Coolify on Hetzner servers. Covers server setup, Coolify configuration, database creation, Phoenix app preparation with Docker, and complete deployment process including environment variable configuration. Uses a $4.99/month Hetzner server with 2 vCPUs and 2GB RAM.

https://medium.com/@rocket4ce/1-tutorial-deploy-phoenix-1-8-whit-coolify-on-hetzner-873504b9794e

16 Likes

I’ve been thinking about moving to Coolify from Dokku. Dokku does work, but it’s a one-man project and pretty rough around the edges.

1 Like

I agree, it’s a good decision.

Why are you considering migrating? I’ve got an app on coolify (cloud) that I’m looking at moving as well, but I’m looking at kamal and uncloud

I;m using kamal in one of our internal products.

@rocket4ce what are your thoughts on Kamal over Coolify?

Happy Coolify user here. This is a nice and comprehensive tutorial, good job!

I second using Dockerfile builds. Nixpacks builds are slow, and max out CPU on my small VPS, it led me to get a larger one that’s overkill for actual application load.

Hi @soyjeansoy, how are you? I hope you’re doing great. From my experience with Kamal and Coolify, if you need more control over deployments to scale, use Kamal. I think Coolify is a great tool, but I haven’t looked much into how to have full control over multiple machines inside a container.

Personally, I prefer Coolify for MVPs and quick testing—and then worry about scaling later.

1 Like

Thank you for the post!
I keep getting these errors when trying to get, i checked the database url and it still doesn’t work. Did you do anything else to set it up?

``
21:09:19.045 [error] Postgrex.Protocol (#PID<0.5574.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (qwkk0sgw40c4ocw04ggkkkks:5432): non-existing domain - :nxdomain
```

Hi @neophen, how are you? Thanks for reading the tutorial. Could you give me a bit more context? My first impression is that the environment variable in Coolify isn’t set.

did you create your database in the service your elixir app exists too?

after that in Postgres you have this field Postgres URL (internal) copy it

postgres://postgres:...@...:5432/postgres

and go to your source code environment-variables and add DATABASE_URL. as you see the value should be this! consider i just change the postgres with ecto

ecto://postgres:...@...:5432/postgres
1 Like

Hey, just figured out that i had ssl true, it worked all good after that

1 Like

Currently on Dokku, planning to migrate to Coolify too.

1 Like

Has anyone ran into this same error without SSL set? I’ve got a working app with a DATABASE_URL. Still see this error.

@Neophen He had the same problem—you could ask him how he managed to solve it

Just make sure that the ssl is truly not set, i had to do a double take, and i though it was the case too, but then i figured it out it took me clearing the build cache to have it removed.