Here’s a quick overview on how to get everything deployed. Once you’re done, start with this tutorial to get your first service up and running in minutes. Let’s deploy it!

Prerequisites

Follow this steps to get everything ready for the deployment.
  1. A Cloudflare account. The free tier is sufficient, but you need to enable R2 and Access for the selfhoster.pro to work. Make sure you have the following information:
    • A domain name managed by Cloudflare
    • clean up the default DNS records (Cloudflare Zone dashboard > DNS > Delete all default A, CNAME and MX, records)
    • Your Cloudflare email, Zone ID and Account ID
    • Create a Cloudflare API token (Use template “Create Additional Tokens”)
    • Enable R2 (R2 > Choose free tier > Add your billing information)
    • Enable Access (Choose free tier > Add your billing information)
  2. An AWS account. You need to create an Access Key and Secret Key for the selfhoster.pro to work with AdministratorAccess. Make sure you have the following information:
    • Your AWS Access Key
    • Your AWS Secret Key
    • Your AWS Region (e.g. eu-west-1)
  3. Your local environment setup:
Make sure you’ve cleaned up DNS records and enabled R2 and Access in Cloudflare, and that you ran aws configure before proceeding

Launching Coolify

1. Generate a Cloudflare token

In your terminal, run the following commands one by one.
git clone https://github.com/troneras/selfhoster-pro.git
cd selfhoster-pro/create-token
export CLOUDFLARE_API_TOKEN="API_TOKEN_FROM_BEFORE"
go run create_token.go
You’ve just created a new token for your Cloudflare account. Save it somewhere safe, you will need it later
Go now to the terraform directory:
cd ../terraform

2. Configure the project.

(1/4) Fill in the secrets.auto.tfvars with your Cloudflare credentials and the token you just created.
mv secrets.auto.tfvars.example secrets.auto.tfvars
(2/4) Configure your project name and emails in variables.auto.tfvars. Follow the comments in the file to fill in the required information.
mv variables.auto.tfvars.example variables.auto.tfvars
(3/4) Add your public key or keys to /config/public_keys. You can add multiple keys, one per line.
You can use the one in your ssh folder ~/.ssh/id_rsa.pub or generate a new one with ssh-keygen -t rsa -b 4096 -C
(4/4) Add the following to your ~/.ssh/config file:
Host ssh.yourdomain.com
  User ubuntu
  IdentityFile ~/.ssh/id_rsa # or the path to your generated private key pair
  ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h
This will allow you to access the server with ssh ssh.yourdomain.com

3. Deploy

Run the following commands to deploy Coolify.
go run selfhoster.go --init --debug
Sometimes the command fails if AWS can’t verify your domain before attempting to create the new emails. Run again go run selfhoster.go --apply and it should solve the issue
After a couple of minutes, you will get some emails from AWS telling you that your domain is verified, and then some more emails to confirm the email identities.
After the installer runs a new file (credentials.txt) will appear with your email SMTP and R2 bucket credentials
In 5 minutes, you will be able to access Coolify at https://ops.yourdomain.com.

Next steps