Skip to main content

Overview

Coolify is an open-source, self-hostable Platform as a Service (PaaS) that simplifies application deployment. It provides a user-friendly interface for managing Docker-based applications like PhotoFlow.
Coolify is ideal if you want Docker’s benefits without manually managing containers and configurations.

What is Coolify?

Coolify offers:

Web Interface

Manage deployments through a clean UI instead of command line

Automatic Deployments

Deploy from Git repos with automatic rebuilds on push

Built-in Monitoring

View logs, resource usage, and health status

Zero Downtime

Rolling updates without service interruption

Backup Management

Scheduled database backups with easy restoration

SSL Certificates

Automatic HTTPS with Let’s Encrypt

Prerequisites

Before deploying with Coolify:
  • Server with Linux (Ubuntu 22.04+ recommended)
  • 2 GB RAM minimum (4 GB recommended)
  • 20 GB disk space minimum
  • Docker installed (Coolify can install it for you)
  • Domain name (optional, for SSL/HTTPS)
  • SSH access to your server

Install Coolify

1

Connect to Server

SSH into your server:
ssh user@your-server-ip
2

Run Installation Script

Install Coolify with one command:
curl -fsSL https://cdn.coolify.io/install.sh | bash
This installs:
  • Docker (if not present)
  • Docker Compose
  • Coolify application
  • Required dependencies
3

Access Coolify

Once installed, access Coolify at:
http://your-server-ip:8000
4

Complete Setup

Follow the setup wizard:
  1. Create admin account
  2. Set up your first server
  3. Configure basic settings
Coolify installation takes 5-10 minutes depending on your server speed.

PhotoFlow Coolify Configuration

PhotoFlow includes a Coolify-specific Docker Compose file: docker-compose.coolify.yml
docker-compose.coolify.yml
version: '3.8'

services:
  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-photoflow}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB:-photoflow}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 5s
      timeout: 5s
      retries: 5

  app:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
      - NODE_ENV=production
      - VITE_SOCKET_URL=${COOLIFY_URL}
    depends_on:
      postgres:
        condition: service_healthy
    restart: unless-stopped

volumes:
  postgres_data:
Key differences from standard docker-compose.yml:
  1. Environment variables: Uses ${POSTGRES_PASSWORD} instead of hardcoded values
  2. No port mappings: Coolify handles port exposure
  3. COOLIFY_URL: Automatically set to your deployment URL
  4. Defaults: Uses :- syntax for fallback values

Deploy PhotoFlow to Coolify

1

Create New Resource

In Coolify dashboard:
  1. Click ”+ New Resource”
  2. Select “Docker Compose”
  3. Choose “From Repository” or “Upload File”
2

Configure Repository

If deploying from Git:
  • Repository: https://github.com/DomenicWalther/PhotoFlow.git
  • Branch: main
  • Docker Compose file: docker-compose.coolify.yml
3

Set Environment Variables

In Coolify’s environment configuration, add:
POSTGRES_USER=photoflow
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_DB=photoflow
Use a strong, unique password for POSTGRES_PASSWORD!
Coolify automatically provides:
  • COOLIFY_URL - Your app’s public URL
4

Configure Domain (Optional)

For custom domain:
  1. Add domain in Coolify settings
  2. Point DNS A record to your server IP
  3. Enable “Generate SSL Certificate”
Coolify automatically sets up HTTPS with Let’s Encrypt.
5

Deploy

Click “Deploy” button.Coolify will:
  1. Clone the repository
  2. Build Docker images
  3. Start containers
  4. Run database migrations
  5. Configure networking
6

Monitor Deployment

Watch the deployment logs in real-time.Successful deployment shows:
✓ Database healthy
✓ Migrations complete
✓ Application started
7

Access PhotoFlow

Once deployed, access your PhotoFlow instance at the provided URL:
https://photoflow.yourdomain.com

Managing PhotoFlow in Coolify

View Logs

Access logs through Coolify UI:
  1. Go to your PhotoFlow application
  2. Click “Logs” tab
  3. Select service (app or postgres)
  4. View real-time logs

Restart Services

  1. Navigate to your application
  2. Click “Actions” dropdown
  3. Select “Restart”

Update PhotoFlow

For automatic updates:
  1. Enable “Auto Deploy” in settings
  2. Coolify monitors Git repository
  3. Automatically rebuilds on new commits
For manual updates:
  1. Click “Redeploy” button
  2. Coolify pulls latest code
  3. Rebuilds and restarts containers

Database Backups

Coolify can automate backups:
  1. Go to “Backups” section
  2. Enable automatic backups
  3. Set schedule (daily, weekly, etc.)
  4. Choose backup retention period
Manual backup:
  1. Click “Backup Now”
  2. Download backup file

Environment Variables

Update environment variables:
  1. Go to “Environment” tab
  2. Edit variables
  3. Click “Save”
  4. Redeploy for changes to take effect

Network Configuration

Custom Domain

Set up a custom domain:
1

Add Domain in Coolify

  1. Application settings → Domains
  2. Add your domain (e.g., photoflow.yourdomain.com)
2

Configure DNS

Point your domain to the server:
Type: A
Name: photoflow
Value: [your-server-ip]
TTL: 3600
3

Enable SSL

Coolify automatically:
  1. Requests Let’s Encrypt certificate
  2. Configures HTTPS
  3. Redirects HTTP to HTTPS

Internal Network Access

For local network deployment without internet:
  1. Don’t configure a public domain
  2. Access via server IP:
    http://192.168.1.100:8000
    
  3. Update VITE_SOCKET_URL manually in environment variables

Monitoring and Health Checks

Resource Usage

Coolify dashboard shows:
  • CPU usage
  • Memory usage
  • Disk space
  • Network traffic

Health Checks

Coolify monitors:
  • Container status
  • PostgreSQL health
  • Application responsiveness
Receive notifications for:
  • Deployment failures
  • Service downtime
  • Resource limits exceeded

Configure Alerts

  1. Go to Settings → Notifications
  2. Add email or webhook
  3. Choose alert types
  4. Test notifications

Troubleshooting

Check logs for errors:
  1. View build logs
  2. Look for:
    • Missing environment variables
    • Build errors
    • Port conflicts
  3. Fix issues and redeploy
Verify:
  1. Environment variables are set correctly
  2. PostgreSQL container is healthy
  3. DATABASE_URL format is correct
  4. No typos in password
If HTTPS isn’t working:
  1. Verify DNS is pointing to correct IP
  2. Wait for DNS propagation (up to 24 hours)
  3. Check port 80 and 443 are open
  4. Try regenerating certificate
For internal network access:
  1. Use server IP, not localhost
  2. Update VITE_SOCKET_URL to server IP
  3. Ensure firewall allows connections
  4. Redeploy after environment changes

Coolify vs Manual Docker

FeatureCoolifyManual Docker
Ease of use✓ Web UICommand line
Auto updates✓ Built-inManual
SSL/HTTPS✓ AutomaticManual setup
Backups✓ ScheduledManual scripts
Monitoring✓ DashboardExternal tools
Learning curveLowModerate
FlexibilityLimited to UIFull control
Resource overheadHigherLower
Use Coolify if you want simplicity. Use manual Docker if you need maximum control or are deploying to offline networks.

Cost Considerations

Coolify itself is free and open-source. Costs:
  • Server hosting - $5-20/month (VPS providers)
  • Domain name - $10-15/year (optional)
  • SSL certificate - Free (Let’s Encrypt)
Recommended providers:
  • DigitalOcean
  • Linode/Akamai
  • Hetzner
  • Vultr
For offline/internal networks, use your own hardware (zero hosting cost).

Best Practices

Secure Passwords

Use strong, unique passwords for:
  • Coolify admin
  • PostgreSQL database
  • Server SSH access

Regular Backups

Enable automated backups:
  • Daily database backups
  • Store off-server
  • Test restoration

Monitor Resources

Check regularly:
  • Disk space usage
  • Memory consumption
  • CPU load

Update Strategy

Keep software current:
  • Enable auto-deploy
  • Test in staging first
  • Review changelogs

Advanced Configuration

Custom Build Arguments

Add build arguments in Coolify:
NODE_VERSION=20
BUILD_ARGS="--no-cache"

Multiple Environments

Deploy staging and production:
  1. Create two applications in Coolify
  2. Use different branches:
    • Production: main
    • Staging: develop
  3. Use different environment variables

Scaling

Coolify supports scaling:
  1. Go to application settings
  2. Adjust replica count
  3. Coolify manages load balancing
For PhotoFlow, ensure Socket.io is configured for multiple instances (requires sticky sessions or Redis adapter).

Migration from Manual Docker

Moving existing deployment to Coolify:
1

Backup Data

Export your database:
docker compose exec postgres pg_dump -U photoflow photoflow > backup.sql
2

Deploy to Coolify

Follow the deployment steps above.
3

Restore Data

Import your backup:
  1. Access Coolify terminal
  2. Restore database:
cat backup.sql | psql -U photoflow photoflow
4

Verify

Check all data is present and working.
5

Update DNS

Point your domain to new server if applicable.

Next Steps

Production Checklist

Ensure your deployment is production-ready

Network Setup

Configure multi-PC network access

Environment Variables

Learn about all configuration options

Docker Deployment

Alternative: Manual Docker deployment

Resources

Build docs developers (and LLMs) love