# How do I deploy my first app on Coolify?

https://www.seturack.com/en/knowledgebase/article/how-do-i-deploy-my-first-app-on-coolify

1. In the panel, open **My servers** and click your server.
2. On the **Overview** tab, wait for the **App** row to say "Coolify is ready".
3. Open the **Panel address** link and sign in with the **Email** and **Password** rows. The server and a first project are ready.

## Connect your repository

1. On the **Projects** page, open **My first project** and **production**, then press **New resource**.
2. For a public repository, choose **Public Git Repository**, enter the address and press **Check repository**.
3. For a private repository, first press **Generate ED25519** on the **Private Keys** page under **Keys & Tokens** and add the public key to the repository's **Deploy keys** on GitHub. Then choose **Private Git Repository (with Deploy Key)** and enter `git@github.com:user/project.git`.
4. Leave **Build pack** on **Railpack** and press **Continue**. Coolify marks Railpack as beta, so choose your own Dockerfile if it gives you trouble.
5. Enter your variables on the **Environment Variables** page and press **Deploy**. An HTTPS test address is on the **Domains** page.

## Deploying with git push

1. On the app's **Webhooks** page, copy the **Webhook URL** from the GitHub section, enter a random value of at least 16 characters in **Webhook secret** and save.
2. On GitHub, open the repository's **Settings**, go to **Webhooks** and press **Add webhook**. Use that address as **Payload URL**, `application/json` as **Content type**, the same value as **Secret**, and push as the only event.

From then on, every `git push` to the chosen branch builds and publishes a new version. After changing a variable that starts with `NEXT_PUBLIC_`, press **Redeploy**. If a build runs out of memory, [scale up from your panel](https://www.seturack.com/en/knowledgebase/article/how-to-scale-server-up-or-down).

## Your domain

Point the A record at the server's IP. On the **Domains** page, use **Add domain**, choose `https`, enter the domain, save and press **Redeploy**. Coolify gets the certificate.

## Closing ports 8000, 6001 and 6002

Once the panel opens on its HTTPS address, these ports aren't needed. Docker skips ufw on the ports it publishes, so ufw won't close them. [Connect over SSH](https://www.seturack.com/en/knowledgebase/article/how-to-connect-with-ssh) and follow Coolify's official route:

`cd /data/coolify/source`

`printf 'services:\n coolify:\n ports: !override\n - "127.0.0.1:8000:8080"\n - "127.0.0.1:6001:6001"\n - "127.0.0.1:6002:6002"\n' > docker-compose.custom.yml`

`curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash`

The last command refreshes the install and moves to a newer version if there is one. To undo this, delete the file and run the same command.

## Good to know

Coolify connects over SSH as root with its own key. Disabling root login or removing the `coolify` line from `/root/.ssh/authorized_keys` stops deployments.

**No server yet?** [Order a server with Coolify installed](https://www.seturack.com/en/coolify-vps): you choose the size and pay for what you choose.
