Here you can find the documentation for deploying a loadbalanced application with Coolify on Hetzner.
Buy Servers
Add & validate them in Coolify
Add Server
button in the Coolify dashboard and following the instructions.Coolify will automatically install the necessary software on your servers.Optional: Deploy your database
Server
tab and switch to a None
proxy type.Ports Mappings
correctly to allow your application servers to connect to the database server.5432:5432
3306:3306
3306:3306
27017:27017
Deploy your applications
Server
tab and switch to a None
proxy type.Ports Mappings
correctly to forward your application ports to the public IP address of the server.If your application uses a database, make sure you update the database connection string to point to the database server.Make sure you enable the private network feature on your servers and use it in the database connection string.
Add & configure the loadbalancer
port 8000
on both servers and you have a domain name example.com
.Load Balancers
in the left sidebar.Create Load Balancer
button.(use the private network)
.TLS Termination
predefined service.Destination Port
enter 8000
(source port should be 443
).health check
section, configure the health check endpoint to your application health check endpoint. (just an endpoint that returns 200 OK
).Create & Buy now
.Setup DNS
load balancer's IP address
. You can do this by adding an A
record to your domain name provider’s DNS settings.A
record with the domain name and the value of the load balancer’s IP address.Setup Firewall
Inbound
rules includes everything that is allowed. Everyting else is blocked by default.Firewalls
in the left sidebar.Create Firewall
button.Inbound
rules.Apply rule
section.Create Firewall
.