I am writing this to help engineers with little or no cloud experience to have an all-in-one platform for hosting their frontend, backend, and database infrastructure using Coolify, an open-source hosting platform. I would like to know if having your own Heroku, Netlify, or Vercel alternative on a single Elastic Compute Cloud (EC2) on Amazon Web Services sounds fun to you because it’s fun to me! With $50 or less, you can have your entire web stack running in a Coolify instance on EC2.
Coolify provides the following:
- Application deployment
- Database management
- Dockerized environment
- Multiple languages and frameworks
- Custom domains and HTTPS
- Resource monitoring
- User-friendly UI for teams
If you do not have an AWS account, you can create a free AWS account here, this gives you 750 hours of computing (Amazon EC2) monthly for an entire year. The installation guide for Coolify is shown in the documentation here. Primarily, you need to create an EC2 instance with these minimum hardware requirements:
- 2-core CPU.
- 2 GB of memory (Random Access Memory—RAM).
- 30+ GB of storage for the images (overlay).
Setting up an EC2 Instance
Let’s create our sample EC2 instance on AWS and go through a sample installation of Coolify on that instance.
Create an EC2 instance and give it your preferred name. I named mine PAAS-HUB-TUTORIAL.
I selected a t2.medium instance type (2 vCPUs and 4 GB of RAM)
Create a key pair (paas-hub-tutorial); this allows you to log in with your preferred SSH client. Immediately this key pair is created, it downloads in your device’s default download location from the browser (Mine is Downloads on my Macintosh device)
Configure the storage of the instance, as stated in the installation guide; at least 30 GB is required, I configured 50 GB storage to allow more space for the overlay.
Configure your network settings; this involves you creating a security group and setting the network permission. I only allowed SSH traffic from my IP address and allowed both HTTP and HTTPS traffic from the internet.
Launch the instance and ensure it has a running state as shown in the diagram below.
Click on the instance to see the instance details as shown below.
Connecting to EC2 with your SSH Client
Click on the Connect button and open the SSH client tab. We are trying to SSH into our EC2 instance with our preferred SSH client (used Terminal on my Mac, Windows command prompt on Windows)
Remember the directory that our initially created key-pair was downloaded? For me, it was Downloads. So, change the directory on your open terminal or cmd prompt to that particular directory.
cd Downloads
chmod 400 "paas-hub-tutorial.pem"
ssh -i "paas-hub-tutorial.pem" [email protected]
With this, you would have gotten direct SSH access to your EC2 instance as shown below
You can now directly install Coolify on your EC2 instance. The command below will run the full installation of Coolify on your EC2 instance and EXPOSE it on port 8000.
Installing Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
Your Coolify instance can now be assessed through http://<IP-ADDRESS>:8000/
<YOUR-IP-ADDRESS>:8000
If you have any difficulty accessing port 8000 on your IP, you need to extend the Inbound rule on the security group you added for your EC2 instance.
Scroll down on your instance summary and click on the Security tab; click the security group as shown here.
Configuring your security group to allow inbound from Coolify
Click on the Edit inbound rules button, add a new CUSTOM TCP with Port range 8000, and set the source to anywhere (0.0.0.0/0)
You can give it a specific description as I did here (PAAS-HUB-TUTORIAL).
Save the new inbound rule by clicking on the Save rules button.
Setting up your running Coolify instance
Now, access your deployed Coolify instance, and it will return the setup page for you.
Do the necessary onboarding setup, and you now have your own PAAS solution running on your custom EC2 instance.
If you followed this tutorial from the beginning, you should have deployed a platform as a service in 5 minutes!