
Welcome to our deep dive into setting up Coolify, specifically focusing on how to host your Payload NextJS applications effectively. This guide will take you through an advanced setup that allows multiple VPS (Virtual Private Servers) to be managed from a single Coolify instance. This setup is not only efficient but also scalable, allowing you to manage different projects seamlessly. Let’s get started!
This article provides a detailed step-by-step written companion to our video tutorial on setting up Coolify across multiple servers for hosting Payload applications. For visual learners or those who prefer following along with video instruction, you can watch the complete guide on YouTube at https://www.youtube.com/watch?v=s0uC-bjiUDE. The video covers the same content but offers additional context and real-time demonstrations of each step in the process.
Coolify is an innovative platform that simplifies the deployment and management of applications, particularly those built with frameworks like Next.js and databases like MongoDB or Supabase. As developers, we often seek ways to streamline our workflows, and Coolify offers just that. It allows you to host multiple applications on your own infrastructure, giving you more control over your projects.
In our previous discussion, we explored a basic setup involving a single VPS running Coolify. However, today, we will elevate that setup to a multi-server configuration, which is particularly beneficial for larger applications or when you need to separate different environments.
The setup process can be broken down into three distinct stages:
Today, we will concentrate on the second stage, which provides a robust way to manage multiple projects with ease.
For this setup, we recommend using Hetzner. They offer excellent performance at a competitive price, making them a favorite among developers. Being a German company, they also ensure compliance with GDPR regulations, which is essential for those concerned about data privacy.
Let’s begin by creating two servers. The first will host Coolify, and the second will be designated for your projects. Follow these steps:
Once configured, name your first server "Coolify" and the second server "Projects One". After confirming your settings, click "Create" for both servers. You should receive an email containing the IP addresses and login credentials for each server.

Open your terminal and use SSH to access your servers. You will need to use the command:
ssh root@
Replace with the actual IP address of your server. Upon first login, you'll be prompted to set a new password. Ensure that it is secure, as this is root access to your server.
With access to your Coolify server, the next step is to install the Coolify instance. Go to coolify.io and click on "Self Hosted" to find the installation script. Copy this script and paste it into your terminal. This process will take a few minutes to complete.

Once Coolify is installed, you will need to set up a domain for secure access. To do this, follow these steps:
For the domain, you will need to create an A record in your DNS settings pointing to your server’s IP address. After saving, Coolify will attempt to validate the DNS entry and create an SSL certificate. This may take some time due to DNS propagation.
Now, let’s integrate the second server into Coolify. Begin by generating a new RSA SSH key:
Copy the public key and move to your Projects One VPS.
Log into your Projects One server via SSH and navigate to the ~/.ssh/authorized_keys file. Open this file in a text editor (e.g., nano) and paste your public key. Save the changes to allow Coolify to access this server.

Return to your Coolify instance and add Projects One as a new server:
Click "Continue" to validate and install Docker on the Projects One server. This step is crucial as Coolify uses Docker to manage applications.
With everything set up, it's time to deploy a project. Create a new project called "Test Production" and add a MongoDB database:
Coolify will SSH into Projects One and set up the database for you. This is a great demonstration of how Coolify streamlines deployment processes.
Today, we explored how to set up Coolify in a multi-server configuration, allowing for efficient management of your Payload NextJS applications. This setup not only enhances your workflow but also prepares your infrastructure for future scaling. In upcoming videos, we will dive deeper into deploying a Payload project in combination with MongoDB, showcasing the full potential of Coolify.
If you have any questions or need assistance, feel free to reach out in the comments below. Happy coding!
Coolify is a platform that allows you to deploy and manage applications easily, particularly for frameworks like Next.js and databases like MongoDB.
Hetzner offers cost-effective and high-performance servers, with the added benefit of GDPR compliance.
You need to create an A record in your DNS settings that points to your server's IP address. Then, configure this domain in your Coolify settings.
Yes! This setup is designed to be scalable. You can easily add more servers and integrate a load balancer in the future.
Using multiple servers allows for better resource management, redundancy, and the ability to separate different environments or projects.
For more information, check out our resources on Coolify and Payload CMS.