DEV Community

Cover image for Deploy Coolify on AWS & Deploy Your App
Noureldin ehab for AWS Community Builders

Posted on • Originally published at stakpak.gitbook.io

Deploy Coolify on AWS & Deploy Your App

Overview

Coolify lets you run your own platform similar to Heroku or Vercel, on your own infrastructure.

In this tutorial, you will:

  • Deploy Coolify on AWS EC2

  • Deploy a real application using Coolify

  • Test that everything is working

  • Then use Stakpak Autopilot to monitor and maintain it automatically

all with just one prompt

Problem

Setting up Coolify on AWS is mostly manual steps and trial and error.

  • Create the server

  • Install dependencies

  • Run the install script

  • Make sure everything is configured correctly

A small mistake can leave you with a broken setup that’s hard to debug.

Application

What the app does

We’ll use a simple todo app built with Next.js and Turso.

It:

  • lets you create and delete tasks

  • stores data in a Turso database (SQLite over HTTP)

  • uses a modern stack (Next.js, Drizzle ORM, Tailwind)

This is a small app, but it’s enough to test:

  • deployment

  • database connectivity

  • container behavior

You can check the code source here

Now that we understand the app, we can start deploying it

Step-by-Step Guide

Prerequisites

  1. Install Stakpak

  2. Configure Stakpak

  3. Install Browser Extension(Optional)

  4. Cloud provider credentials configured

Deployment

  1. Open stakpak ask it to deploy my app on aws with coolify

  1. As you can see, it automatically find the coolify skill, let's press enter

  1. Now its asking us about which EC2 we want to use, lets choose t3.medium

  1. Now it's asking us where we want to deploy our app, choose the closest region to your users

  1. Now it's asking for the DB URL and Auth Token for our app

  1. Now, let's restrict SSH to our IP only for security

  1. Now that we have everything ready lets press enter

  1. Now that Coolify is deployed, let's make an admin account

  1. Then it configured Coolify by starting the reverse proxy and enabling API access

  2. It created a project and connected the GitHub repo as a new application

  3. It added the Turso database credentials as environment variables

  4. Finally, it triggered the deployment, and Coolify built and launched the app automatically

Now everything is working🥳

Now, let's ask it to set up Stakpak Autopilot

Note: Stakpak Autopilot monitors your apps 24/7, detects unexpected changes, fixes what’s safe, and only alerts you when it actually matters.

Monitoring

  1. Prompt: Set up stakpak autopilot to monitor the app

That's it!!

Extra Resources:

Related Use Cases

and more...

References

Top comments (0)