In this quick guide, we’ll walk through how to deploy a Docker application to Coolify in just five minutes. Coolify is a self-hosted platform that makes it easy to manage your applications with a user-friendly interface. Let’s get started!
Key Takeaways
- Set up a Coolify project to manage your application.
- Create a GitHub repository for your Dockerized app.
- Build and deploy your application using a Dockerfile.
- Access your app through a generated domain.
What Is Coolify?
Coolify is a platform that allows you to self-host applications easily. Think of it as your own version of Vercel, but with more control. You can deploy various applications, and it provides a clean UI to manage everything.
Setting Up Your Coolify Project
To begin, you need to have Coolify installed on your VPS. Once that’s done, follow these steps:
- Create a New Project: In the Coolify dashboard, create a new project. Let’s call it
Coolify App
. - Connect Your GitHub Repository: You’ll need a GitHub repo to store your Dockerized application. Create a new repository named
Coolify App
as well. - Link the Repository: Copy the GitHub URL and paste it into the Coolify dashboard to connect your project.
Creating Your Dockerized Application
Now that your project is set up, it’s time to create a simple Dockerized application. Here’s how:
- Clone Your GitHub Repository: Start by cloning the repository you just created.
- Set Up Your Application: Create a new
package.json
file and install Express. This will be the framework for your simple server. - Here’s a quick example of what your
index.js
might look like: - Create a .gitignore File: Don’t forget to add a
.gitignore
file to excludenode_modules
from your repository. - Create Your Dockerfile: This file tells Docker how to build your application. Here’s a simple Dockerfile:
Deploying to Coolify
With your application ready, it’s time to deploy:
- Push Your Code: Push your changes to the GitHub repository.
- Create a Deployment in Coolify: Back in the Coolify dashboard, create a new deployment. Coolify should automatically detect your Dockerfile.
- Monitor the Build Process: You can check the logs to see if the build is successful. Look for a message indicating that your app is running on port 3000.
Accessing Your Application
Once the deployment is complete, Coolify will generate a domain for your application. You can visit this domain to see your app in action. If everything went well, you should see the message you set up in your Express server.
Conclusion
And there you have it! In just five minutes, you’ve deployed a Dockerized application to Coolify. This platform makes it super easy to manage your apps without the hassle of complex setups. Give it a try, and see how it can simplify your development workflow!
Top comments (0)