How to run your own personal Coolify instance on AWS.
Coolify is an an open-source & self-hostable Heroku / Netlify alternative.
Learn more about it at coolify.io.
You setup Coolify with AWS you will need:
- The Terraform CLI (0.14.9+) installed.
- The AWS CLI installed.
- AWS acount and associated credentials that allow you to create resources.
- The
direnv
shell extension installed. - A previously generated SSH Public Key.
To provision resources on AWS you'll need some environment variables set on your shell.
-
Copy the
.envrc.example
file into.envrc
:$ cp .envrc.example .envrc
-
Edit
.envrc
file with the appropriate variables:export AWS_ACCESS_KEY_ID="<YOUR_AWS_ACCESS_KEY_ID>" export AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_ACCESS_KEY>" export TF_VAR_aws_region="<YOUR_DEFAULT_AWS_REGION>" export TF_VAR_your_ssh_key="<YOUR_SSH_KEY>"
-
Load the new variables into your shell:
$ direnv allow
We'll use terraform to spin up our AWS infrastructure.
-
Set unknown variables and install any missing providers:
$ cd ./terraform $ terraform init
-
Make sure the infrastructure setup plan is good to execute:
$ terraform plan
-
Apply the infrastructure changes:
$ terraform apply
-
Check your logs, something like:
coolify_server_instance_id = "i-xxxxxxxxxxxxxxxxx" coolify_server_instance_public_dns = "ec2-x-xx-xxx-xxx.compute-1.amazonaws.com" coolify_server_instance_public_ip = "x.xx.xxx.xxx"
Visit your Coolify instance's public DNS at port 3000, something like http://ec2-x-xx-xxx-xxx.compute-1.amazonaws.com:3000