# Fly.io Deployment Guide {#flyio-deployment-guide}


Deploy Ever Gauzy to Fly.io for global edge deployment.


## Prerequisites {#prerequisites}


- `flyctl` CLI installed
- Fly.io account


## Quick Start {#quick-start}



### 1. Launch App {#1-launch-app}


```bash
fly launch --name gauzy-api --image ghcr.io/ever-co/gauzy-api:latest
```


### 2. Create PostgreSQL {#2-create-postgresql}


```bash
fly postgres create --name gauzy-db
fly postgres attach gauzy-db --app gauzy-api
```


### 3. Create Redis {#3-create-redis}


```bash
fly redis create --name gauzy-redis
```


### 4. Set Secrets {#4-set-secrets}


```bash
fly secrets set \
  JWT_SECRET=$(openssl rand -base64 32) \
  JWT_REFRESH_SECRET=$(openssl rand -base64 32) \
  API_BASE_URL=https://gauzy-api.fly.dev \
  CLIENT_BASE_URL=https://gauzy-webapp.fly.dev
```


### 5. Deploy {#5-deploy}


```bash
fly deploy
```


## fly.toml {#flytoml}


```toml
[build]
  image = "ghcr.io/ever-co/gauzy-api:latest"

[env]
  NODE_ENV = "production"
  DB_TYPE = "postgres"
  PORT = "3000"

[[services]]
  internal_port = 3000
  protocol = "tcp"

  [[services.ports]]
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.http_checks]]
    interval = 10000
    grace_period = "5s"
    method = "get"
    path = "/api/health"
```


## Related Pages {#related-pages}


- [Production Deployment](https://sourcey-gauzy.pages.dev/devops/production-deployment/index.md) — general guide
- [Railway Deployment](https://sourcey-gauzy.pages.dev/deployment/cloud/railway-deployment/index.md) — Railway alternative
